Updated mustache template for readonly buffers

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-13 11:07:23 +02:00
1 親 a93bcc807c
コミット ee96c29f83
2ファイル変更
+10 -3

検索条件に一致するファイルはありません

+9 -2
ファイルの表示
@@ -12,10 +12,15 @@ namespace ComputeSharp.Shaders.Renderer.Models.Fields
/// </summary>
public bool IsConstantBuffer { get; } = true;
/// <summary>
/// Gets whether or not this constant buffer actually contains a single, explicit variable
/// </summary>
public bool IsSingleValue { get; }
/// <summary>
/// Gets the index of the current constant buffer field
/// </summary>
public int ConstantBufferIndex { get; set; }
public int ConstantBufferIndex { get; }
/// <summary>
/// Creates a new <see cref="ConstantBufferFieldInfo"/> instance with the specified parameters
@@ -23,9 +28,11 @@ namespace ComputeSharp.Shaders.Renderer.Models.Fields
/// <param name="fieldType">The type of the current field</param>
/// <param name="fieldName">The name of the current field</param>
/// <param name="bufferIndex">The index of the current constant buffer field</param>
public ConstantBufferFieldInfo(string fieldType, string fieldName, int bufferIndex) : base(fieldType, fieldName)
/// <param name="singleValue">Whether or not this constant buffer actually contains a single, explicit variable</param>
public ConstantBufferFieldInfo(string fieldType, string fieldName, int bufferIndex, bool singleValue) : base(fieldType, fieldName)
{
ConstantBufferIndex = bufferIndex;
IsSingleValue = singleValue;
}
}
}
+1 -1
ファイルの表示
@@ -7,7 +7,7 @@ static {{&FieldType}} {{FieldName}} = {{FieldValue}};
{{#IsConstantBuffer}}
cbuffer {{FieldName}}Buffer : register(b{{ConstantBufferIndex}})
{
{{&FieldType}} {{FieldName}};
{{&FieldType}} {{FieldName}}{{^IsSingleValue}}[2]{{/IsSingleValue}};
}
{{/IsConstantBuffer}}
{{!Read write buffer}}