forked from microsoft/DirectXShaderCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow arrays of RW, consume, and append structured buffers. (microsof…
…t#5405) This is the first commit in a series that will enable array of RW, consume, and append Structured buffers. This commit removes the error when one is used on its own. There will be a failure if a counter variable is needed. This is the first PR is a series that will slowly enable different features for arrays of RWStructuredBuffers. To see the general direction the changes will go see microsoft#5407.
- Loading branch information
Showing
10 changed files
with
60 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
tools/clang/test/CodeGenSPIRV/type.append-structured-buffer.array.error.hlsl
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
tools/clang/test/CodeGenSPIRV/type.append-structured-buffer.array.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// RUN: %dxc -T ps_6_0 -E main -fvk-allow-rwstructuredbuffer-arrays | ||
|
||
struct T { | ||
float a; | ||
float3 b; | ||
}; | ||
|
||
// CHECK: %myAppendStructuredBuffer = OpVariable %_ptr_Uniform__runtimearr_type_AppendStructuredBuffer_T Uniform | ||
AppendStructuredBuffer<T> myAppendStructuredBuffer[]; | ||
|
||
void main() {} | ||
|
12 changes: 0 additions & 12 deletions
12
tools/clang/test/CodeGenSPIRV/type.consume-structured-buffer.array.error.hlsl
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
tools/clang/test/CodeGenSPIRV/type.consume-structured-buffer.array.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// RUN: %dxc -T ps_6_0 -E main -fvk-allow-rwstructuredbuffer-arrays | ||
|
||
struct T { | ||
float a; | ||
float3 b; | ||
}; | ||
|
||
|
||
// CHECK: %myConsumeStructuredBuffer = OpVariable %_ptr_Uniform__arr_type_ConsumeStructuredBuffer_T_uint_2 Uniform | ||
ConsumeStructuredBuffer<T> myConsumeStructuredBuffer[2]; | ||
|
||
void main() {} | ||
|
19 changes: 19 additions & 0 deletions
19
tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.nocounter.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// RUN: %dxc -T ps_6_6 -E main -fvk-allow-rwstructuredbuffer-arrays | ||
|
||
struct PSInput | ||
{ | ||
uint idx : COLOR; | ||
}; | ||
|
||
// CHECK: OpDecorate %g_rwbuffer DescriptorSet 2 | ||
// CHECK: OpDecorate %g_rwbuffer Binding 0 | ||
// CHECK: %g_rwbuffer = OpVariable %_ptr_Uniform__arr_type_RWStructuredBuffer_uint_uint_5 Uniform | ||
RWStructuredBuffer<uint> g_rwbuffer[5] : register(u0, space2); | ||
|
||
float4 main(PSInput input) : SV_TARGET | ||
{ | ||
// CHECK: [[ac1:%\w+]] = OpAccessChain %_ptr_Uniform_type_RWStructuredBuffer_uint %g_rwbuffer %35 | ||
// CHECK: [[ac2:%\w+]] = OpAccessChain %_ptr_Uniform_uint [[ac1]] %int_0 %uint_0 | ||
// CHECK: OpLoad %uint [[ac2]] | ||
return g_rwbuffer[input.idx][0]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters