summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-12-13 12:24:27 -0800
committerGitHub <noreply@github.com>2023-12-13 12:24:27 -0800
commit1406aa2bc9e398e5e5565ba9c6adbb780c29fee1 (patch)
treeab284f85a72d77db7462d3f38a272a3966ed7c83 /tests
parent6cbe215e58eeb8edc53d71e8f315e2fb55c0eeee (diff)
Add spirv intrinsics for `ConstBufferPointer`. (#3407)
Fixes #3305. Fixes #3404. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hlsl-intrinsic/const-buffer-pointer.slang13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/hlsl-intrinsic/const-buffer-pointer.slang b/tests/hlsl-intrinsic/const-buffer-pointer.slang
index eddfc3be0..ec242fa07 100644
--- a/tests/hlsl-intrinsic/const-buffer-pointer.slang
+++ b/tests/hlsl-intrinsic/const-buffer-pointer.slang
@@ -1,8 +1,10 @@
//TEST:SIMPLE(filecheck=CHECK):-target glsl -profile glsl_450 -entry main -stage compute
//TEST:SIMPLE(filecheck=SPV):-target spirv -profile glsl_450 -entry main -stage compute
-
+//TEST:SIMPLE(filecheck=SPV):-target spirv -profile glsl_450 -entry main -stage compute -emit-spirv-directly
+// SPV: OpMemoryModel PhysicalStorageBuffer64
// SPV: OpEntryPoint GLCompute {{.*}} "main" {{.*}}
-
+// SPV: OpTypePointer PhysicalStorageBuffer
+// SPV: OpINotEqual
struct MyStruct
{
float4 position;
@@ -34,6 +36,9 @@ RWStructuredBuffer<uint> outputBuffer;
[numthreads(1,1,1)]
void main(int3 tid: SV_DispatchThreadID)
{
- MyStruct s = gGlobals.pStruct.get();
- outputBuffer[tid.x] = uint(s.position.x);
+ if (gGlobals.pStruct.isValid())
+ {
+ MyStruct s = gGlobals.pStruct.get();
+ outputBuffer[tid.x] = uint(s.position.x);
+ }
}