diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp index d4b9228965..e4df9b3225 100644 --- a/src/shader_recompiler/ir_opt/texture_pass.cpp +++ b/src/shader_recompiler/ir_opt/texture_pass.cpp @@ -352,12 +352,12 @@ std::optional TryGetConstBuffer(const IR::Inst* inst, Environme case IR::Opcode::BitFieldUExtract: { const IR::Value base{inst->Arg(0)}; const IR::Value offset{inst->Arg(1)}; - const IR::Value count{inst->Arg(2)}; if (auto res = Track(base, env)) { if (offset.IsImmediate()) { - res->offset += (offset.U32() / 8); - res->shift_left = offset.U32() % 32; + const u32 total_bits = offset.U32(); + res->offset += (total_bits / 8); + res->shift_left = total_bits % 32; } return res; }