From 02e2e561ac136473d4d259d872dc5e211c6a3e67 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 8 Jun 2021 19:42:25 -0300 Subject: Support bindless textures with separate constant buffers for texture and sampler (#2339) --- .../Translation/Optimizations/BindlessElimination.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Ryujinx.Graphics.Shader/Translation/Optimizations') diff --git a/Ryujinx.Graphics.Shader/Translation/Optimizations/BindlessElimination.cs b/Ryujinx.Graphics.Shader/Translation/Optimizations/BindlessElimination.cs index 3a523adc..6156a6f4 100644 --- a/Ryujinx.Graphics.Shader/Translation/Optimizations/BindlessElimination.cs +++ b/Ryujinx.Graphics.Shader/Translation/Optimizations/BindlessElimination.cs @@ -50,13 +50,16 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations Operand src0 = Utils.FindLastOperation(handleCombineOp.GetSource(0), block); Operand src1 = Utils.FindLastOperation(handleCombineOp.GetSource(1), block); - if (src0.Type != OperandType.ConstantBuffer || - src1.Type != OperandType.ConstantBuffer || src0.GetCbufSlot() != src1.GetCbufSlot()) + if (src0.Type != OperandType.ConstantBuffer || src1.Type != OperandType.ConstantBuffer) { continue; } - SetHandle(config, texOp, src0.GetCbufOffset() | (src1.GetCbufOffset() << 16), src0.GetCbufSlot()); + SetHandle( + config, + texOp, + src0.GetCbufOffset() | (src1.GetCbufOffset() << 16), + src0.GetCbufSlot() | ((src1.GetCbufSlot() + 1) << 16)); } else if (texOp.Inst == Instruction.ImageLoad || texOp.Inst == Instruction.ImageStore) { -- cgit v1.2.3