From b066cfc1a3e31bf7197ddbd0f4d774b886cd9d65 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 12 Oct 2020 21:40:50 -0300 Subject: Add support for shader constant buffer slot indexing (#1608) * Add support for shader constant buffer slot indexing * Fix typo --- Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 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 91ab7ad5..50b9bc9f 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs @@ -12,6 +12,8 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl public ShaderConfig Config { get; } + public bool CbIndexable { get; } + public List CBufferDescriptors { get; } public List SBufferDescriptors { get; } public List TextureDescriptors { get; } @@ -25,9 +27,10 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl private string _indentation; - public CodeGenContext(ShaderConfig config) + public CodeGenContext(ShaderConfig config, bool cbIndexable) { Config = config; + CbIndexable = cbIndexable; CBufferDescriptors = new List(); SBufferDescriptors = new List(); @@ -85,9 +88,9 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl int cBufSlot = bindless ? operand.CbufSlot : 0; int cBufOffset = bindless ? operand.CbufOffset : 0; - return TextureDescriptors.FindIndex(descriptor => - descriptor.Type == texOp.Type && - descriptor.HandleIndex == texOp.Handle && + return TextureDescriptors.FindIndex(descriptor => + descriptor.Type == texOp.Type && + descriptor.HandleIndex == texOp.Handle && descriptor.CbufSlot == cBufSlot && descriptor.CbufOffset == cBufOffset); } -- cgit v1.2.3