aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2020-11-02 19:53:23 +0000
committerGitHub <noreply@github.com>2020-11-02 16:53:23 -0300
commite1da7df2075f45ac3d19538f7781115978282100 (patch)
treed46ae3ffedd2886adba64f1044b699f99b13f795 /Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs
parent11a7c99764ed4e6c575c877c69ca627645702a42 (diff)
Support res scale on images, correctly blacklist for SUST, move logic out of backend. (#1657)
* Support res scale on images, correctly blacklist for SUST, move logic out of backend. * Fix Typo
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs')
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs
index 85347dfd..f86e82da 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs
@@ -84,7 +84,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
AppendLine("}" + suffix);
}
- public int FindTextureDescriptorIndex(AstTextureOperation texOp)
+ private int FindDescriptorIndex(List<TextureDescriptor> list, AstTextureOperation texOp)
{
AstOperand operand = texOp.GetSource(0) as AstOperand;
bool bindless = (texOp.Flags & TextureFlags.Bindless) > 0;
@@ -92,13 +92,24 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
int cBufSlot = bindless ? operand.CbufSlot : 0;
int cBufOffset = bindless ? operand.CbufOffset : 0;
- return TextureDescriptors.FindIndex(descriptor =>
+ return list.FindIndex(descriptor =>
descriptor.Type == texOp.Type &&
descriptor.HandleIndex == texOp.Handle &&
+ descriptor.Format == texOp.Format &&
descriptor.CbufSlot == cBufSlot &&
descriptor.CbufOffset == cBufOffset);
}
+ public int FindTextureDescriptorIndex(AstTextureOperation texOp)
+ {
+ return FindDescriptorIndex(TextureDescriptors, texOp);
+ }
+
+ public int FindImageDescriptorIndex(AstTextureOperation texOp)
+ {
+ return FindDescriptorIndex(ImageDescriptors, texOp);
+ }
+
public StructuredFunction GetFunction(int id)
{
return _info.Functions[id];