summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-05-29 07:49:40 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:34 +0200
commitd738ad4d0ba02be5603712b3f615d4794a71df9c (patch)
tree06ea70d5086dba1709fc8a198d2230503081c082
parentglasm: Fix immediate texture coordinate (diff)
downloadyuzu-d738ad4d0ba02be5603712b3f615d4794a71df9c.tar
yuzu-d738ad4d0ba02be5603712b3f615d4794a71df9c.tar.gz
yuzu-d738ad4d0ba02be5603712b3f615d4794a71df9c.tar.bz2
yuzu-d738ad4d0ba02be5603712b3f615d4794a71df9c.tar.lz
yuzu-d738ad4d0ba02be5603712b3f615d4794a71df9c.tar.xz
yuzu-d738ad4d0ba02be5603712b3f615d4794a71df9c.tar.zst
yuzu-d738ad4d0ba02be5603712b3f615d4794a71df9c.zip
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_image.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp
index 99b883746..cf842e1e0 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp
@@ -162,8 +162,10 @@ Id Texture(EmitContext& ctx, IR::TextureInstInfo info, [[maybe_unused]] const IR
}
}
-Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info,
- [[maybe_unused]] const IR::Value& index) {
+Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& index) {
+ if (!index.IsImmediate() || index.U32() != 0) {
+ throw NotImplementedException("Indirect image indexing");
+ }
if (info.type == TextureType::Buffer) {
const TextureBufferDefinition& def{ctx.texture_buffers.at(info.descriptor_index)};
if (def.count > 1) {
@@ -182,14 +184,14 @@ Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info,
}
Id Image(EmitContext& ctx, const IR::Value& index, IR::TextureInstInfo info) {
- if (!index.IsImmediate()) {
+ if (!index.IsImmediate() || index.U32() != 0) {
throw NotImplementedException("Indirect image indexing");
}
if (info.type == TextureType::Buffer) {
- const ImageBufferDefinition def{ctx.image_buffers.at(index.U32())};
+ const ImageBufferDefinition def{ctx.image_buffers.at(info.descriptor_index)};
return ctx.OpLoad(def.image_type, def.id);
} else {
- const ImageDefinition def{ctx.images.at(index.U32())};
+ const ImageDefinition def{ctx.images.at(info.descriptor_index)};
return ctx.OpLoad(def.image_type, def.id);
}
}