Fixed a bug in the HLSL shader code generation
このコミットが含まれているのは:
1 親
3cafe6795e
コミット
58aeb9f080
1ファイル変更
+6
-6
@@ -176,7 +176,7 @@ namespace ComputeSharp.Shaders.Translation
|
||||
// Constant buffer
|
||||
if (HlslKnownTypes.IsConstantBufferType(fieldType))
|
||||
{
|
||||
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 1, this.constantBuffersCount++);
|
||||
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 1, this.constantBuffersCount);
|
||||
|
||||
this.d3D12DescriptorRanges1.Add(d3D12DescriptorRange1);
|
||||
|
||||
@@ -184,12 +184,12 @@ namespace ComputeSharp.Shaders.Translation
|
||||
|
||||
string typeName = HlslKnownTypes.GetMappedName(fieldType.GenericTypeArguments[0]);
|
||||
|
||||
this.hlslBuffersInfo.Add(new ConstantBufferFieldInfo(fieldType, typeName, fieldName, (int)this.constantBuffersCount));
|
||||
this.hlslBuffersInfo.Add(new ConstantBufferFieldInfo(fieldType, typeName, fieldName, (int)this.constantBuffersCount++));
|
||||
}
|
||||
else if (HlslKnownTypes.IsReadOnlyBufferType(fieldType))
|
||||
{
|
||||
// Root parameter for a readonly buffer
|
||||
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, this.readOnlyBuffersCount++);
|
||||
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, this.readOnlyBuffersCount);
|
||||
|
||||
this.d3D12DescriptorRanges1.Add(d3D12DescriptorRange1);
|
||||
|
||||
@@ -197,12 +197,12 @@ namespace ComputeSharp.Shaders.Translation
|
||||
|
||||
string typeName = HlslKnownTypes.GetMappedName(fieldType);
|
||||
|
||||
this.hlslBuffersInfo.Add(new ReadOnlyBufferFieldInfo(fieldType, typeName, fieldName, (int)this.readOnlyBuffersCount));
|
||||
this.hlslBuffersInfo.Add(new ReadOnlyBufferFieldInfo(fieldType, typeName, fieldName, (int)this.readOnlyBuffersCount++));
|
||||
}
|
||||
else if (HlslKnownTypes.IsReadWriteBufferType(fieldType))
|
||||
{
|
||||
// Root parameter for a read write buffer
|
||||
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, this.readWriteBuffersCount++);
|
||||
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, this.readWriteBuffersCount);
|
||||
|
||||
this.d3D12DescriptorRanges1.Add(d3D12DescriptorRange1);
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace ComputeSharp.Shaders.Translation
|
||||
|
||||
string typeName = HlslKnownTypes.GetMappedName(fieldType);
|
||||
|
||||
this.hlslBuffersInfo.Add(new ReadWriteBufferFieldInfo(fieldType, typeName, fieldName, (int)this.readWriteBuffersCount));
|
||||
this.hlslBuffersInfo.Add(new ReadWriteBufferFieldInfo(fieldType, typeName, fieldName, (int)this.readWriteBuffersCount++));
|
||||
}
|
||||
else if (HlslKnownTypes.IsKnownScalarType(fieldType) || HlslKnownTypes.IsKnownVectorType(fieldType))
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする