From 3651e8ea32c1cd7baaebd19d89ba5d540e423b38 Mon Sep 17 00:00:00 2001 From: Samuliak Date: Thu, 16 May 2024 15:49:29 +0200 Subject: [PATCH] determine type of buffer by its field types --- src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs index 1fe7f46ef..0d0d7470d 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/MslGenerator.cs @@ -115,12 +115,14 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl foreach (var constantBuffer in context.Properties.ConstantBuffers.Values) { - args = args.Append($"constant float4 *{constantBuffer.Name} [[buffer({constantBuffer.Binding})]]").ToArray(); + var varType = constantBuffer.Type.Fields[0].Type & ~AggregateType.Array; + args = args.Append($"constant {Declarations.GetVarTypeName(context, varType)} *{constantBuffer.Name} [[buffer({constantBuffer.Binding})]]").ToArray(); } foreach (var storageBuffers in context.Properties.StorageBuffers.Values) { - args = args.Append($"device float4 *{storageBuffers.Name} [[buffer({storageBuffers.Binding})]]").ToArray(); + var varType = storageBuffers.Type.Fields[0].Type & ~AggregateType.Array; + args = args.Append($"device {Declarations.GetVarTypeName(context, varType)} *{storageBuffers.Name} [[buffer({storageBuffers.Binding})]]").ToArray(); } foreach (var texture in context.Properties.Textures.Values)