diff options
| author | Mukund Keshava <mkeshava@nvidia.com> | 2025-05-16 21:00:53 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-16 18:30:53 +0300 |
| commit | 1fd7b2296d8360c245a0c732e7f842876533f92a (patch) | |
| tree | 942ea20a3713f98280008d76fbba6a85a5ad6062 /tests | |
| parent | b39ec87cccaadebbb9325dd2adb8c0b13b364805 (diff) | |
Fix RWStructuredBuffer emission (#7139)
Fixes #7127
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cuda/compile-to-cuda.slang | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/cuda/compile-to-cuda.slang b/tests/cuda/compile-to-cuda.slang index d7399d469..f383bbd22 100644 --- a/tests/cuda/compile-to-cuda.slang +++ b/tests/cuda/compile-to-cuda.slang @@ -2,14 +2,23 @@ //DISABLE_TEST(compute):COMPARE_COMPUTE:-cpu -compute //TEST(compute):COMPARE_COMPUTE:-cuda -compute -//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer +//TEST_INPUT:ubuffer(data=[1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer RWStructuredBuffer<int> outputBuffer : register(u0); +[shader("compute")] [numthreads(4, 1, 1)] void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) { - int tid = int(dispatchThreadID.x); - + int tid = int(dispatchThreadID.x); + for(;;) + { + if(outputBuffer[0] == 1) + { + // This is just a statement to trigger bug #7127 + outputBuffer[0] = tid; + break; + } + } outputBuffer[tid * 4] = tid; outputBuffer[tid * 4 + 1] = tid + 1; outputBuffer[tid * 4 + 2] = tid + 2; |
