summaryrefslogtreecommitdiffstats
path: root/tests/spirv
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-07-21 21:35:44 -0700
committerGitHub <noreply@github.com>2025-07-22 04:35:44 +0000
commit9d47a352960efd71494c7dfa0918debd5b405077 (patch)
treef0acf898cb5c4de8a1951ac8010168b119bf94ff /tests/spirv
parent9adac4069fbcc7ce5bea2c42d19c61eb1dcd7f25 (diff)
Fix Conditioanl<T, false> fields with a semantic. (#7855)
* Fix Conditioanl<T, false> fields with a semantic. * Add unit test. * Fix test.
Diffstat (limited to 'tests/spirv')
-rw-r--r--tests/spirv/spec-constant-generic.slang10
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/spirv/spec-constant-generic.slang b/tests/spirv/spec-constant-generic.slang
index 9a9f7006f..1d7e3c1fe 100644
--- a/tests/spirv/spec-constant-generic.slang
+++ b/tests/spirv/spec-constant-generic.slang
@@ -1,14 +1,13 @@
//TEST:SIMPLE(filecheck=CHECK): -target spirv
//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type -emit-spirv-directly
-// CHECK: %[[C0:[0-9A-Za-z_]+]] = OpSpecConstant %int 32
+// CHECK: %[[C0:[0-9A-Za-z_]+]] = OpConstant %int 32
// CHECK: %[[C1:[0-9A-Za-z_]+]] = OpSpecConstant %int 2
// CHECK: %[[COP0:[0-9A-Za-z_]+]] = OpSpecConstantOp %int SDiv %[[C0]] %[[C1]]
// CHECK: %[[ARR_TYPE:[0-9A-Za-z_]+]] = OpTypeArray %float %[[COP0]]
// CHECK: %[[PT_TYPE:[0-9A-Za-z_]+]] = OpTypePointer Function %[[ARR_TYPE]]
-[SpecializationConstant]
-const int constValue0 = 32;
+static const int constValue0 = 32;
[SpecializationConstant]
const int constValue1 = 2;
@@ -33,11 +32,8 @@ struct MyStruct<let N: int>
[numthreads(1, 1, 1)]
void computeMain()
{
- // This test checks we can use spec constants for generic arguments, and also
- // we can show that the array size is computed correctly.
- // The function call shows that the two arrays are the same type.
+ // This test checks we can use spec constants for array sizes.
MyStruct<constValue0> s;
- // CHECK: OpVariable %[[PT_TYPE]] Function
func(s.buffer);