diff options
Diffstat (limited to 'src/shader_recompiler')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | 12 |
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 | |||
| 162 | } | 162 | } |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, | 165 | Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& index) { |
| 166 | [[maybe_unused]] const IR::Value& index) { | 166 | if (!index.IsImmediate() || index.U32() != 0) { |
| 167 | throw NotImplementedException("Indirect image indexing"); | ||
| 168 | } | ||
| 167 | if (info.type == TextureType::Buffer) { | 169 | if (info.type == TextureType::Buffer) { |
| 168 | const TextureBufferDefinition& def{ctx.texture_buffers.at(info.descriptor_index)}; | 170 | const TextureBufferDefinition& def{ctx.texture_buffers.at(info.descriptor_index)}; |
| 169 | if (def.count > 1) { | 171 | if (def.count > 1) { |
| @@ -182,14 +184,14 @@ Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, | |||
| 182 | } | 184 | } |
| 183 | 185 | ||
| 184 | Id Image(EmitContext& ctx, const IR::Value& index, IR::TextureInstInfo info) { | 186 | Id Image(EmitContext& ctx, const IR::Value& index, IR::TextureInstInfo info) { |
| 185 | if (!index.IsImmediate()) { | 187 | if (!index.IsImmediate() || index.U32() != 0) { |
| 186 | throw NotImplementedException("Indirect image indexing"); | 188 | throw NotImplementedException("Indirect image indexing"); |
| 187 | } | 189 | } |
| 188 | if (info.type == TextureType::Buffer) { | 190 | if (info.type == TextureType::Buffer) { |
| 189 | const ImageBufferDefinition def{ctx.image_buffers.at(index.U32())}; | 191 | const ImageBufferDefinition def{ctx.image_buffers.at(info.descriptor_index)}; |
| 190 | return ctx.OpLoad(def.image_type, def.id); | 192 | return ctx.OpLoad(def.image_type, def.id); |
| 191 | } else { | 193 | } else { |
| 192 | const ImageDefinition def{ctx.images.at(index.U32())}; | 194 | const ImageDefinition def{ctx.images.at(info.descriptor_index)}; |
| 193 | return ctx.OpLoad(def.image_type, def.id); | 195 | return ctx.OpLoad(def.image_type, def.id); |
| 194 | } | 196 | } |
| 195 | } | 197 | } |