diff options
Diffstat (limited to 'tests/spirv')
| -rw-r--r-- | tests/spirv/namespace-texture-array.slang | 20 | ||||
| -rw-r--r-- | tests/spirv/pointer-bug.slang | 18 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/spirv/namespace-texture-array.slang b/tests/spirv/namespace-texture-array.slang new file mode 100644 index 000000000..b9dff510f --- /dev/null +++ b/tests/spirv/namespace-texture-array.slang @@ -0,0 +1,20 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly +struct ComputePush +{ + uint image_id; +}; +[[vk::push_constant]] ComputePush p; + +namespace test_namespace +{ + [[vk::binding(0, 0)]] RWTexture2D<float4> textureTable[]; +} + +// CHECK: OpEntryPoint + +[shader("compute")] +[numthreads(8, 8, 1)] +void main(uint3 pixel_i : SV_DispatchThreadID) +{ + test_namespace.textureTable[p.image_id][pixel_i.xy] = float4(0,1,0,0); +}
\ No newline at end of file diff --git a/tests/spirv/pointer-bug.slang b/tests/spirv/pointer-bug.slang new file mode 100644 index 000000000..1668cec13 --- /dev/null +++ b/tests/spirv/pointer-bug.slang @@ -0,0 +1,18 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly +struct Foo { + float4 *positions; +}; + +struct Params { + Foo *foo; +}; + +// CHECK: %_ptr_PhysicalStorageBuffer_Foo = OpTypePointer PhysicalStorageBuffer %Foo + +[[vk::push_constant]] Params params; + +[shader("compute")] +[numthreads(1,1,1)] +void main() { + params.foo.positions[10] += float4(1, 1, 1, 1); +}
\ No newline at end of file |
