From e1da7df2075f45ac3d19538f7781115978282100 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Mon, 2 Nov 2020 19:53:23 +0000 Subject: 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 --- Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs') 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 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]; -- cgit v1.2.3