summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-07-19 16:20:52 -0700
committerGitHub <noreply@github.com>2023-07-19 16:20:52 -0700
commit3509059cd8357455155260d8587b8a438c34e49f (patch)
tree59933528a4e93bb02b93d80c8f4ebfe38509b24d /tests
parenta5987aad211d2e0b9391bdda4b67873ec9873074 (diff)
Add `sampleCount` parameter for MS textures. (#3001)
* Add `sampleCount` parameter for MS textures. * Fix test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hlsl-intrinsic/texture/texture-sample-count.slang21
1 files changed, 21 insertions, 0 deletions
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<uint > t_0 : register(u0);
+// CHECK: RWTexture2DMS<uint, 4 > tExplicit_0 : register(u1);
+
+RWTexture2DMS<uint> t;
+RWTexture2DMS<uint, 4> tExplicit;
+
+SamplerState s;
+RWBuffer<uint4> 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;
+}