diff options
| author | Yong He <yonghe@outlook.com> | 2024-11-06 16:42:14 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-06 16:42:14 -0800 |
| commit | 989847f6a9408b68e90ac242f4a19d3266054c3e (patch) | |
| tree | 1cfeb1b12f0c6d1de2669936878cce0f4c542709 /tests/bugs | |
| parent | d9cb281f5fd456d6a1df2e8e156810a86f56fc6e (diff) | |
Fix IntVal unification logic to insert type casts + buffer element lowering regression. (#5508)
* Fix IntVal unification logic to insert type casts.
* Fix regression.
Diffstat (limited to 'tests/bugs')
| -rw-r--r-- | tests/bugs/array-of-array-in-sb.slang | 25 | ||||
| -rw-r--r-- | tests/bugs/generic-type-duplication.slang | 1 |
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/bugs/array-of-array-in-sb.slang b/tests/bugs/array-of-array-in-sb.slang new file mode 100644 index 000000000..a449ce671 --- /dev/null +++ b/tests/bugs/array-of-array-in-sb.slang @@ -0,0 +1,25 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk + +struct S +{ + int vertices[3][3]; +} + +//TEST_INPUT:set cs = cbuffer(data=[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]) +ConstantBuffer<S> cs; + +//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0], stride=4),name=s_buf +RWStructuredBuffer<S> s_buf; + +//TEST_INPUT:ubuffer(data=[0 0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<int> outputBuffer; + +// CHECK: 6 + +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + s_buf[0].vertices[1][1] = 5; + outputBuffer[0] = s_buf[0].vertices[1][1] + cs.vertices[1][0]; +}
\ No newline at end of file diff --git a/tests/bugs/generic-type-duplication.slang b/tests/bugs/generic-type-duplication.slang index 9c5a0ae67..4117a7f81 100644 --- a/tests/bugs/generic-type-duplication.slang +++ b/tests/bugs/generic-type-duplication.slang @@ -2,7 +2,6 @@ //TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj //TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj -//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-wgpu struct MyGeneric<let addOne: bool> { |
