aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-06-16 14:46:27 -0300
committerGitHub <noreply@github.com>2024-06-16 14:46:27 -0300
commit3193ef10833bc0d27e2701c7759ab02674d672d3 (patch)
tree8aae569f4943373450d181908f858cf03c0a0b42 /src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs
parent5a878ae9afe73d12bd344c139ee1b485335af3ff (diff)
Extend bindless elimination to catch a few more specific cases (#6921)
* Catch more cases on bindless elimination * Match blocks with the same comparison condition * Shader cache version bump
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs')
-rw-r--r--src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs
index 8703e660..273a38a5 100644
--- a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs
+++ b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs
@@ -156,6 +156,26 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
return false;
}
+ public static bool IsComparison(this Instruction inst)
+ {
+ switch (inst & Instruction.Mask)
+ {
+ case Instruction.CompareEqual:
+ case Instruction.CompareGreater:
+ case Instruction.CompareGreaterOrEqual:
+ case Instruction.CompareGreaterOrEqualU32:
+ case Instruction.CompareGreaterU32:
+ case Instruction.CompareLess:
+ case Instruction.CompareLessOrEqual:
+ case Instruction.CompareLessOrEqualU32:
+ case Instruction.CompareLessU32:
+ case Instruction.CompareNotEqual:
+ return true;
+ }
+
+ return false;
+ }
+
public static bool IsTextureQuery(this Instruction inst)
{
inst &= Instruction.Mask;