From b39ec87cccaadebbb9325dd2adb8c0b13b364805 Mon Sep 17 00:00:00 2001 From: sricker-nvidia <115114531+sricker-nvidia@users.noreply.github.com> Date: Thu, 15 May 2025 17:01:08 -0700 Subject: Fix broken -emit-spirv-via-glsl test option (#7091) Fixes issue #6898 The -emit-spirv-via-glsl slang-test option has been broken for some amount of time. Tests that were using it were operating as if using -emit-spirv-directly, leading to many duplicated tests. After fixing the test option, there were an number of errors that appeared as a result. This change fixes the broken test option and the resulting test errors. Some of the test errors revealed some legitimate issues, such as: -The GLSL bitCount instrinsic only supports 32-bit integers and requires emulation for other bit widths. -Emitting GLSL 8-bit and 16-bit glsl integer types did not emit the proper extension requirements -Emitting GLSL and casting for 16-bit integers was missing a closing parenthesis. -Missing profile for GL_EXT_shader_explicit_arithmetic_types -Missing toType cases for UInt8/Int8 for the kIROp_BitCast case in tryEmitInstExprImpl. --- tests/spirv/spec-constant-generic.slang | 2 +- tests/spirv/spec-constant-sized-array-1.slang | 2 +- tests/spirv/spec-constant-sized-array-2.slang | 2 +- tests/spirv/spec-constant-sized-array-3.slang | 2 +- tests/spirv/spec-constant-sized-array-4.slang | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/spirv') diff --git a/tests/spirv/spec-constant-generic.slang b/tests/spirv/spec-constant-generic.slang index 65eed2810..9a9f7006f 100644 --- a/tests/spirv/spec-constant-generic.slang +++ b/tests/spirv/spec-constant-generic.slang @@ -1,5 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK): -target spirv -//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type +//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: %[[C1:[0-9A-Za-z_]+]] = OpSpecConstant %int 2 diff --git a/tests/spirv/spec-constant-sized-array-1.slang b/tests/spirv/spec-constant-sized-array-1.slang index e974fc37e..ea9081fbf 100644 --- a/tests/spirv/spec-constant-sized-array-1.slang +++ b/tests/spirv/spec-constant-sized-array-1.slang @@ -1,5 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK): -target spirv -//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type +//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type -emit-spirv-directly // CHECK: %[[C0:[0-9A-Za-z_]+]] = OpSpecConstant %int 5 // CHECK: %[[I3:[0-9A-Za-z_]+]] = OpConstant %int 3 diff --git a/tests/spirv/spec-constant-sized-array-2.slang b/tests/spirv/spec-constant-sized-array-2.slang index 95d2f4aee..0a4dea994 100644 --- a/tests/spirv/spec-constant-sized-array-2.slang +++ b/tests/spirv/spec-constant-sized-array-2.slang @@ -1,5 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK): -target spirv -//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type +//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: %[[I2:[0-9A-Za-z_]+]] = OpConstant %int 2 diff --git a/tests/spirv/spec-constant-sized-array-3.slang b/tests/spirv/spec-constant-sized-array-3.slang index 39106aa5b..45c11edde 100644 --- a/tests/spirv/spec-constant-sized-array-3.slang +++ b/tests/spirv/spec-constant-sized-array-3.slang @@ -1,5 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK): -target spirv -//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type +//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type -emit-spirv-directly // CHECK: %[[C0:[0-9A-Za-z_]+]] = OpSpecConstant %int 4 // CHECK: %[[I1:[0-9A-Za-z_]+]] = OpConstant %int 1 diff --git a/tests/spirv/spec-constant-sized-array-4.slang b/tests/spirv/spec-constant-sized-array-4.slang index 0c511bc01..a1f44abf4 100644 --- a/tests/spirv/spec-constant-sized-array-4.slang +++ b/tests/spirv/spec-constant-sized-array-4.slang @@ -1,5 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK): -target spirv -//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type +//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: %[[C1:[0-9A-Za-z_]+]] = OpSpecConstant %int 2 -- cgit v1.2.3