summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJerran Schmidt <jerrans@nvidia.com>2025-06-27 02:33:16 +1000
committerGitHub <noreply@github.com>2025-06-26 16:33:16 +0000
commit83c7b7c7716c31596d9e2829d4afa708ce23a182 (patch)
treef2a152b41273399e015d476aaca60278fa10928c /tests
parentbf94fc3f5b73033334db28846580f16df42d6a85 (diff)
Fix for OpUConvert producing invalid opcode when to/from signs differ (#7398)
* Fix for OpUConvert outputting scalar type for mixed sign vector type conversions * Fix compiler warning * Added regression test for UConvert vector fix * Formatting * getUnsignedType helper * Formatting * Fix for addtional int types * Helper function to convert signed type to unsigned type
Diffstat (limited to 'tests')
-rw-r--r--tests/spirv/uconvert-vector-typecheck.slang20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/spirv/uconvert-vector-typecheck.slang b/tests/spirv/uconvert-vector-typecheck.slang
new file mode 100644
index 000000000..f4671c89f
--- /dev/null
+++ b/tests/spirv/uconvert-vector-typecheck.slang
@@ -0,0 +1,20 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+// CHECK: %[[PTR:[0-9a-zA-Z_]+]] = OpVectorShuffle %v2uint %{{.*}} %{{.*}} 0 1
+// CHECK: %{{.*}} = OpUConvert %v2ushort %[[PTR]]
+
+RWTexture2D<uint> tex;
+
+void writeFlags(int2 position, RWTexture2D<uint> flagsTexture, uint flags)
+{
+ flagsTexture[position] = flags;
+}
+
+[shader("compute")]
+[numthreads(1,1,1)]
+void main(uint3 threadId : SV_DispatchThreadID)
+{
+ uint16_t2 position = uint16_t2(threadId.xy);
+ uint flags = 1;
+ writeFlags(position, tex, flags);
+}