diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-10-12 21:40:50 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-12 21:40:50 -0300 |
| commit | b066cfc1a3e31bf7197ddbd0f4d774b886cd9d65 (patch) | |
| tree | 95a1d0bb640948c184857fd1bccb56cad90839fb /Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs | |
| parent | 14fd9aa640936d2455c9f0929fc904a5bdb2fada (diff) | |
Add support for shader constant buffer slot indexing (#1608)
* Add support for shader constant buffer slot indexing
* Fix typo
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs | 11 |
1 files changed, 7 insertions, 4 deletions
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<BufferDescriptor> CBufferDescriptors { get; } public List<BufferDescriptor> SBufferDescriptors { get; } public List<TextureDescriptor> 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<BufferDescriptor>(); SBufferDescriptors = new List<BufferDescriptor>(); @@ -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); } |
