From b7a1544e8b4e538272c491a746bdd19ec188a0c3 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 8 Nov 2021 11:39:30 -0300 Subject: Fix InvocationInfo on geometry shader and bindless default integer const (#2822) * Fix InvocationInfo on geometry shader and bindless default integer const * Shader cache version bump * Consistency for the default value --- .../CodeGen/Glsl/Instructions/InstGenMemory.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Ryujinx.Graphics.Shader/CodeGen') diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs index f976ec5e..abca03aa 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs @@ -18,12 +18,16 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions // TODO: Bindless texture support. For now we just return 0/do nothing. if (isBindless) { - return texOp.Inst switch + switch (texOp.Inst) { - Instruction.ImageStore => "// imageStore(bindless)", - Instruction.ImageLoad => NumberFormatter.FormatFloat(0), - _ => NumberFormatter.FormatInt(0) - }; + case Instruction.ImageStore: + return "// imageStore(bindless)"; + case Instruction.ImageLoad: + NumberFormatter.TryFormat(0, texOp.Format.GetComponentType(), out string imageConst); + return imageConst; + default: + return NumberFormatter.FormatInt(0); + } } bool isArray = (texOp.Type & SamplerType.Array) != 0; -- cgit v1.2.3