From 66993e26039ec5afb05c4fdc4eee92bc20605389 Mon Sep 17 00:00:00 2001 From: Exverge Date: Sat, 30 Mar 2024 19:34:32 -0400 Subject: [PATCH] Comment out unimplemented check In my testing on macOS, MK8 sometimes crashed at this function, giving a void type instead of u32. I've temporarily commented this out until (if) this is implemented and added a check for if it is implemented --- .../backend/spirv/emit_spirv_image.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index 945cdb42bc..75767448c3 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp @@ -196,8 +196,11 @@ Id Texture(EmitContext& ctx, IR::TextureInstInfo info, [[maybe_unused]] const IR } Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& index) { - if (!index.IsImmediate() || index.U32() != 0) { - throw NotImplementedException("Indirect image indexing"); + // if (!index.IsImmediate() || index.Type() != Shader::IR::Type::U32 || index.U32() != 0) { + // throw NotImplementedException("Indirect image indexing"); + // } + if (index.Type() != Shader::IR::Type::U32) { + LOG_WARNING(Shader_SPIRV, "Non-U32 type provided as index: {}", index.Type()); } if (info.type == TextureType::Buffer) { const TextureBufferDefinition& def{ctx.texture_buffers.at(info.descriptor_index)}; @@ -215,8 +218,11 @@ Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& ind } std::pair Image(EmitContext& ctx, const IR::Value& index, IR::TextureInstInfo info) { - if (!index.IsImmediate() || index.U32() != 0) { - throw NotImplementedException("Indirect image indexing"); + // if (!index.IsImmediate() || index.Type() != Shader::IR::Type::U32 || index.U32() != 0) { + // throw NotImplementedException("Indirect image indexing"); + // } + if (index.Type() != Shader::IR::Type::U32) { + LOG_WARNING(Shader_SPIRV, "Non-U32 type provided as index: {}", index.Type()); } if (info.type == TextureType::Buffer) { const ImageBufferDefinition def{ctx.image_buffers.at(info.descriptor_index)};