diff options
| author | Yong He <yonghe@outlook.com> | 2023-08-08 13:54:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-08 13:54:05 -0700 |
| commit | ea1f1653896163d0f3aadc35f7fedf3d8102a71b (patch) | |
| tree | 115ba46ed1ecb4804258af176338594f044087c2 /tests/hlsl | |
| parent | 0b2d7533d475a4853a9c8fbc14537a1a8ec2c3f6 (diff) | |
Support `-fvk-use-gl-layout` for ByteAddressBuffer load/store. (#3068)
* Support `-fvk-use-gl-layout` for ByteAddressBuffer load/store.
* Fix.
* Fix.
* Add test for unaligned load.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/hlsl')
| -rw-r--r-- | tests/hlsl/byte-buffer-load-std430.slang | 22 | ||||
| -rw-r--r-- | tests/hlsl/byte-buffer-load-std430.slang.expected.txt | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/hlsl/byte-buffer-load-std430.slang b/tests/hlsl/byte-buffer-load-std430.slang new file mode 100644 index 000000000..b526250eb --- /dev/null +++ b/tests/hlsl/byte-buffer-load-std430.slang @@ -0,0 +1,22 @@ +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type -xslang -fvk-use-gl-layout + +//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer +RWStructuredBuffer<float> outputBuffer; + +//TEST_INPUT:set inBuffer = ubuffer(data=[1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0], stride=4) +RWByteAddressBuffer inBuffer; + +struct MyStruct +{ + float v0; + float2 v1; + float2 v2; +} + +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + var v = inBuffer.Load<MyStruct>(0); + var g = inBuffer.Load<float4>(4); + outputBuffer[dispatchThreadID.x] = v.v2.x + v.v1.x + g.x; // expect 10.0 +} diff --git a/tests/hlsl/byte-buffer-load-std430.slang.expected.txt b/tests/hlsl/byte-buffer-load-std430.slang.expected.txt new file mode 100644 index 000000000..0c174890f --- /dev/null +++ b/tests/hlsl/byte-buffer-load-std430.slang.expected.txt @@ -0,0 +1,2 @@ +type: float +10.000000 |
