From d4145519dd86f6d18b07393d989141bda4d4ceb3 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 16 Feb 2022 22:34:20 -0800 Subject: Various gfx fixes. (#2132) * Various gfx fixes. * Fix test case. * Fix crash. * Trigger build * Trigger build 2 * Fix vulkan unit tests. Co-authored-by: Yong He --- tools/gfx-unit-test/sampler-array.slang | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tools/gfx-unit-test/sampler-array.slang (limited to 'tools/gfx-unit-test/sampler-array.slang') diff --git a/tools/gfx-unit-test/sampler-array.slang b/tools/gfx-unit-test/sampler-array.slang new file mode 100644 index 000000000..1439f6cdd --- /dev/null +++ b/tools/gfx-unit-test/sampler-array.slang @@ -0,0 +1,32 @@ +// sampler-array.slang + +// Test sampler array parameters. + +struct S1 +{ + Texture2D tex[32]; + SamplerState samplers[32]; + float data; + float test(int i) + { + return tex[i].SampleLevel(samplers[i], float2(0.0, 0.0), 0.0).x + data; + } +} + +struct S0 +{ + float data; + RaytracingAccelerationStructure acc; + ParameterBlock s; +} + +ParameterBlock g; +RWStructuredBuffer buffer; + +[shader("compute")] +[numthreads(1,1,1)] +void computeMain( + uint3 sv_dispatchThreadID : SV_DispatchThreadID) +{ + buffer[0] = g.data * g.s.test(sv_dispatchThreadID.x); +} -- cgit v1.2.3