diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/spirv/sb-load-2.slang | 23 | ||||
| -rw-r--r-- | tests/spirv/sb-load.slang | 24 |
2 files changed, 47 insertions, 0 deletions
diff --git a/tests/spirv/sb-load-2.slang b/tests/spirv/sb-load-2.slang new file mode 100644 index 000000000..b4c10cb4a --- /dev/null +++ b/tests/spirv/sb-load-2.slang @@ -0,0 +1,23 @@ +//TEST:SIMPLE(filecheck=CHECK): -target glsl -entry main -stage compute + +struct Test1 +{ + float2x3 a; // 24B + float3x4 b; // 48B + float16_t3x2 c; // 12B + float16_t2x4 d; // 16B +}; + +StructuredBuffer<Test1> dp; +RWStructuredBuffer<float4> outputBuffer; + +// CHECK-COUNT-2: unpackStorage +// CHECK-NOT: unpackStorage +[numthreads(4, 4, 1)] +void main(uint3 GTid : SV_GroupThreadID, + uint GI : SV_GroupIndex) +{ + var tmp = dp[0]; + var rs = tmp.a[0][0] + tmp.a[0][1]; + outputBuffer[GI] = float4(rs); +}
\ No newline at end of file diff --git a/tests/spirv/sb-load.slang b/tests/spirv/sb-load.slang new file mode 100644 index 000000000..1b0df0be8 --- /dev/null +++ b/tests/spirv/sb-load.slang @@ -0,0 +1,24 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv + +#define FILL_PATTERN_DIMENSIONS_X 16 +#define FILL_PATTERN_DIMENSIONS_Y 16 + +struct FillPatternBuffer +{ + float4 px[FILL_PATTERN_DIMENSIONS_Y][FILL_PATTERN_DIMENSIONS_X]; +}; + +StructuredBuffer<FillPatternBuffer> dp; +RWStructuredBuffer<float4> outputBuffer; + +// CHECK-NOT: OpCompositeConstruct + +[numthreads(4, 4, 1)] +void main(uint3 GTid : SV_GroupThreadID, + uint GI : SV_GroupIndex) +{ + const uint ii = GTid.x; + const uint jj = GTid.y; + const float4 pmv = dp[0].px[ii][jj]; + outputBuffer[GI] = pmv; +}
\ No newline at end of file |
