From 5795bb15282498b3824a5d15fe1ff78b85a18c23 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 27 May 2020 11:07:10 -0300 Subject: Support separate textures and samplers (#1216) * Support separate textures and samplers * Add missing bindless flag, fix SNORM format on buffer textures * Add missing separation * Add comments about the new handles --- Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs | 4 ++++ Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Graphics.Shader/CodeGen') diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs index a45c10c3..bd947ab7 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs @@ -324,6 +324,10 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl if (!images.TryAdd(imageName, texOp)) { + // Ensure that all texture operations share the same format. + // This avoid errors like mismatched formats. + texOp.Format = images[imageName].Format; + continue; } diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs index e9a37d87..4c3f802a 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs @@ -229,7 +229,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl } else { - suffix = texOp.Handle.ToString(); + suffix = texOp.Handle.ToString("X"); if ((texOp.Type & SamplerType.Indexed) != 0) { @@ -242,7 +242,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl public static string GetImageName(ShaderStage stage, AstTextureOperation texOp, string indexExpr) { - string suffix = texOp.Handle.ToString(); + string suffix = texOp.Handle.ToString("X"); if ((texOp.Type & SamplerType.Indexed) != 0) { -- cgit v1.2.3