aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/CodeGen
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-11-08 11:39:30 -0300
committerGitHub <noreply@github.com>2021-11-08 11:39:30 -0300
commitb7a1544e8b4e538272c491a746bdd19ec188a0c3 (patch)
treeb325765ccd98613cb63350cb4d66bb19db38f0db /Ryujinx.Graphics.Shader/CodeGen
parent81e9b86cdb4b2a01cc41b8e8a4dff2c9e3c13843 (diff)
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
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen')
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs14
1 files changed, 9 insertions, 5 deletions
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;