From 72f7ea60461df520668de0947f350b85219db577 Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:54:06 -0400 Subject: Fix for `ConstantBuffer` causing a segfault (#4705) Fixes: #4704 Change the type we assign when getting the member variable of a legalized `ConstantBuffer`. --- tests/bugs/gh-4704.slang | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/bugs/gh-4704.slang (limited to 'tests/bugs') diff --git a/tests/bugs/gh-4704.slang b/tests/bugs/gh-4704.slang new file mode 100644 index 000000000..8e8f6fc36 --- /dev/null +++ b/tests/bugs/gh-4704.slang @@ -0,0 +1,18 @@ +//TEST:SIMPLE(filecheck=SPIRV): -entry computeMain -stage compute -target spirv +//TEST:SIMPLE(filecheck=HLSL): -entry computeMain -stage compute -target spirv +//TEST:SIMPLE(filecheck=GLSL): -entry computeMain -stage compute -target spirv + +// SPIRV: OpEntryPoint +// GLSL: main +// HLSL: computeMain + + +[[vk::binding(0, 0)]] uniform ConstantBuffer addresses; +RWStructuredBuffer buffer; + +[shader("compute")] +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID, uint groupIndex: SV_GroupIndex) +{ + printf("\nfrom gpu: %llu", addresses[0]); +} \ No newline at end of file -- cgit v1.2.3