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/language-feature/bit-cast/struct-bit-cast-2.slang | 2 +- tests/language-feature/bit-cast/struct-reinterpret.slang | 2 +- tests/language-feature/bitfield/bitfield-insert-extract-non32bit.slang | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/language-feature') diff --git a/tests/language-feature/bit-cast/struct-bit-cast-2.slang b/tests/language-feature/bit-cast/struct-bit-cast-2.slang index edf91e00b..dd9922ee8 100644 --- a/tests/language-feature/bit-cast/struct-bit-cast-2.slang +++ b/tests/language-feature/bit-cast/struct-bit-cast-2.slang @@ -1,7 +1,7 @@ // struct-bit-cast-2.slang // Test bit casts for read across boundaries of scalar types. -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -shaderobj +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -shaderobj -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -cpu -shaderobj //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -cuda -shaderobj diff --git a/tests/language-feature/bit-cast/struct-reinterpret.slang b/tests/language-feature/bit-cast/struct-reinterpret.slang index 6be359d79..4b9518a4b 100644 --- a/tests/language-feature/bit-cast/struct-reinterpret.slang +++ b/tests/language-feature/bit-cast/struct-reinterpret.slang @@ -1,7 +1,7 @@ // struct-bit-cast-2.slang // Test bit casts for read across boundaries of scalar types. -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -shaderobj +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -shaderobj -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -cpu -shaderobj //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -cuda -shaderobj diff --git a/tests/language-feature/bitfield/bitfield-insert-extract-non32bit.slang b/tests/language-feature/bitfield/bitfield-insert-extract-non32bit.slang index 0edbb049a..ded0baed4 100644 --- a/tests/language-feature/bitfield/bitfield-insert-extract-non32bit.slang +++ b/tests/language-feature/bitfield/bitfield-insert-extract-non32bit.slang @@ -1,4 +1,4 @@ -//TEST:COMPARE_COMPUTE(filecheck-buffer=BUF): -vk -output-using-type +//TEST:COMPARE_COMPUTE(filecheck-buffer=BUF): -vk -output-using-type -emit-spirv-directly //TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer RWStructuredBuffer outputBuffer; -- cgit v1.2.3