From faf479dcd5baa61e133cbcf94142ab3a6f00a8c0 Mon Sep 17 00:00:00 2001 From: Lander Gallastegi Date: Wed, 26 Mar 2025 19:23:10 +0100 Subject: [PATCH] Adjust SPIR-V EmitReadConst --- .../backend/spirv/emit_spirv_context_get_set.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index e4071bb95..541222163 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp @@ -163,13 +163,11 @@ void EmitGetGotoVariable(EmitContext&) { using BufferAlias = EmitContext::BufferAlias; Id EmitReadConst(EmitContext& ctx, IR::Inst* inst) { - const u32 flatbuf_off_dw = inst->Flags(); const auto& srt_flatbuf = ctx.buffers.back(); - ASSERT(srt_flatbuf.binding >= 0 && flatbuf_off_dw > 0 && - srt_flatbuf.buffer_type == BufferType::ReadConstUbo); + ASSERT(srt_flatbuf.binding >= 0 && srt_flatbuf.buffer_type == BufferType::ReadConstUbo); const auto [id, pointer_type] = srt_flatbuf[BufferAlias::U32]; const Id ptr{ - ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, ctx.ConstU32(flatbuf_off_dw))}; + ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, ctx.Def(inst->Arg(1)))}; return ctx.OpLoad(ctx.U32[1], ptr); }