mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-19 13:39:59 +00:00
emit_glasm_image: Fix TXQ with MSAA textures
This commit is contained in:
parent
08feba2b56
commit
a1d8306bfd
1 changed files with 9 additions and 1 deletions
|
@ -59,6 +59,13 @@ std::string Image(EmitContext& ctx, IR::TextureInstInfo info,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsTextureMsaa(EmitContext& ctx, const IR::TextureInstInfo& info) {
|
||||||
|
if (info.type == TextureType::Buffer) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ctx.info.texture_descriptors.at(info.descriptor_index).is_multisample;
|
||||||
|
}
|
||||||
|
|
||||||
std::string_view TextureType(IR::TextureInstInfo info, bool is_ms = false) {
|
std::string_view TextureType(IR::TextureInstInfo info, bool is_ms = false) {
|
||||||
if (info.is_depth) {
|
if (info.is_depth) {
|
||||||
switch (info.type) {
|
switch (info.type) {
|
||||||
|
@ -535,7 +542,8 @@ void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value&
|
||||||
ScalarS32 lod, [[maybe_unused]] const IR::Value& skip_mips) {
|
ScalarS32 lod, [[maybe_unused]] const IR::Value& skip_mips) {
|
||||||
const auto info{inst.Flags<IR::TextureInstInfo>()};
|
const auto info{inst.Flags<IR::TextureInstInfo>()};
|
||||||
const std::string texture{Texture(ctx, info, index)};
|
const std::string texture{Texture(ctx, info, index)};
|
||||||
const std::string_view type{TextureType(info)};
|
const bool is_msaa{IsTextureMsaa(ctx, info)};
|
||||||
|
const std::string_view type{TextureType(info, is_msaa)};
|
||||||
ctx.Add("TXQ {},{},{},{};", inst, lod, texture, type);
|
ctx.Add("TXQ {},{},{},{};", inst, lod, texture, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue