diff options
author | gdkchan <gab.dark.100@gmail.com> | 2022-04-04 14:43:58 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-04 14:43:58 -0300 |
commit | 04bd87ed5a06d35f1e19d7af89e5d9d58a29f6ac (patch) | |
tree | b24f63c0d35de40f62ddf03d205c7e4f99071f0f /Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs | |
parent | 5158cdb308790e58d7e441ed127286ac1ef5ef69 (diff) |
Fix shader textureSize with multisample and buffer textures (#3240)1.1.86
* Fix shader textureSize with multisample and buffer textures
* Replace out param with tuple return value
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs')
-rw-r--r-- | Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs index b4823019..82534749 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/CodeGenContext.cs @@ -70,6 +70,25 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl AppendLine("}" + suffix); } + public (TextureDescriptor, int) FindTextureDescriptor(AstTextureOperation texOp) + { + TextureDescriptor[] descriptors = Config.GetTextureDescriptors(); + + for (int i = 0; i < descriptors.Length; i++) + { + var descriptor = descriptors[i]; + + if (descriptor.CbufSlot == texOp.CbufSlot && + descriptor.HandleIndex == texOp.Handle && + descriptor.Format == texOp.Format) + { + return (descriptor, i); + } + } + + return (default, -1); + } + private static int FindDescriptorIndex(TextureDescriptor[] array, AstTextureOperation texOp) { for (int i = 0; i < array.Length; i++) |