mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-21 03:32:13 +00:00
determine type of buffer by its field types
This commit is contained in:
parent
2d609ad57b
commit
3651e8ea32
1 changed files with 4 additions and 2 deletions
|
@ -115,12 +115,14 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
|
|
||||||
foreach (var constantBuffer in context.Properties.ConstantBuffers.Values)
|
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)
|
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)
|
foreach (var texture in context.Properties.Textures.Values)
|
||||||
|
|
Loading…
Reference in a new issue