From 3509059cd8357455155260d8587b8a438c34e49f Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 19 Jul 2023 16:20:52 -0700 Subject: Add `sampleCount` parameter for MS textures. (#3001) * Add `sampleCount` parameter for MS textures. * Fix test. --------- Co-authored-by: Yong He --- .../texture/texture-sample-count.slang | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/hlsl-intrinsic/texture/texture-sample-count.slang (limited to 'tests') diff --git a/tests/hlsl-intrinsic/texture/texture-sample-count.slang b/tests/hlsl-intrinsic/texture/texture-sample-count.slang new file mode 100644 index 000000000..8c8068e24 --- /dev/null +++ b/tests/hlsl-intrinsic/texture/texture-sample-count.slang @@ -0,0 +1,21 @@ +//TEST:SIMPLE(filecheck=CHECK): -target hlsl -profile sm_6_6 -entry main -stage compute + +// Test that RWTexture2DMS accepts an optional sampleCount argument +// and the argument correctly appears in the output hlsl. + +// CHECK: RWTexture2DMS t_0 : register(u0); +// CHECK: RWTexture2DMS tExplicit_0 : register(u1); + +RWTexture2DMS t; +RWTexture2DMS tExplicit; + +SamplerState s; +RWBuffer b; + +[shader("compute")] +[numthreads(32, 1, 1)] +void main(uint3 tid : SV_DispatchThreadID) +{ + let v = t.Load(int2(0, 0), 1) + tExplicit.Load(int2(1,1),2); + b[tid.x] = v; +} -- cgit v1.2.3