Skip to content

Commit

Permalink
Fix StorageBuffer assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed Jun 23, 2024
1 parent 05a186b commit b772eff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,13 @@ private static void DeclareBufferStructures(CodeGenContext context, IEnumerable<
{
var name = constant ? "ConstantBuffers" : "StorageBuffers";
var count = constant ? Defaults.MaxUniformBuffersPerStage : Defaults.MaxStorageBuffersPerStage;
var addressSpace = constant ? "constant" : "device";

var argBufferPointers = new string[count];

foreach (BufferDefinition buffer in buffers)
{
argBufferPointers[buffer.Binding] = $"constant {Defaults.StructPrefix}_{buffer.Name}* {buffer.Name};";
argBufferPointers[buffer.Binding] = $"{addressSpace} {Defaults.StructPrefix}_{buffer.Name}* {buffer.Name};";

context.AppendLine($"struct {Defaults.StructPrefix}_{buffer.Name}");
context.EnterScope();
Expand Down

0 comments on commit b772eff

Please sign in to comment.