diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-05-20 15:12:15 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-20 15:12:15 -0300 |
| commit | b34c0a47b4d5d9cc4b3a6b51fbc76fe2b493b07d (patch) | |
| tree | 7b439f95d6ae99f3c05b385174bcee456cf0fcab /Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs | |
| parent | 7b8ad1c36ce7d0d9027d89e194d0abc2e879b08b (diff) | |
Fix constant buffer array size when indexing is used and other buffer descriptor and resolution scale regressions (#2298)
* Fix constant buffer array size when indexing is used
* Change default QueryConstantBufferUse value
* Fix more regressions
* Ensure proper order
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs index 6e67b682..cb17f18d 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs @@ -262,10 +262,10 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl string blockName = $"{ubName}_{DefaultNames.BlockSuffix}"; - context.AppendLine($"layout (binding = {descriptors[0].Binding}, std140) uniform {blockName}"); + context.AppendLine($"layout (binding = {context.Config.FirstConstantBufferBinding}, std140) uniform {blockName}"); context.EnterScope(); context.AppendLine("vec4 " + DefaultNames.DataName + ubSize + ";"); - context.LeaveScope($" {ubName}[{NumberFormatter.FormatInt(descriptors.Length)}];"); + context.LeaveScope($" {ubName}[{NumberFormatter.FormatInt(descriptors.Max(x => x.Slot) + 1)}];"); } else { @@ -291,10 +291,10 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl string blockName = $"{sbName}_{DefaultNames.BlockSuffix}"; - context.AppendLine($"layout (binding = {descriptors[0].Binding}, std430) buffer {blockName}"); + context.AppendLine($"layout (binding = {context.Config.FirstStorageBufferBinding}, std430) buffer {blockName}"); context.EnterScope(); context.AppendLine("uint " + DefaultNames.DataName + "[];"); - context.LeaveScope($" {sbName}[{NumberFormatter.FormatInt(descriptors.Length)}];"); + context.LeaveScope($" {sbName}[{NumberFormatter.FormatInt(descriptors.Max(x => x.Slot) + 1)}];"); } private static void DeclareSamplers(CodeGenContext context, TextureDescriptor[] descriptors) |
