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/cooperative-vector/atan.slang | 2 +- tests/cooperative-vector/clamp.slang | 2 +- tests/cooperative-vector/conversion.slang | 2 +- tests/cooperative-vector/exp.slang | 2 +- tests/cooperative-vector/fma.slang | 2 +- tests/cooperative-vector/log.slang | 2 +- tests/cooperative-vector/matrix-mul-bias-packed-mut.slang | 2 +- tests/cooperative-vector/matrix-mul-bias-packed.slang | 2 +- tests/cooperative-vector/max.slang | 2 +- tests/cooperative-vector/min.slang | 2 +- tests/cooperative-vector/scalar-mul.slang | 2 +- tests/cooperative-vector/step.slang | 2 +- tests/cooperative-vector/tanh.slang | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) (limited to 'tests/cooperative-vector') diff --git a/tests/cooperative-vector/atan.slang b/tests/cooperative-vector/atan.slang index 4ae135dcd..83c4da5ab 100644 --- a/tests/cooperative-vector/atan.slang +++ b/tests/cooperative-vector/atan.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/clamp.slang b/tests/cooperative-vector/clamp.slang index 1250aaae0..72202ee98 100644 --- a/tests/cooperative-vector/clamp.slang +++ b/tests/cooperative-vector/clamp.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/conversion.slang b/tests/cooperative-vector/conversion.slang index 5bba7961b..c0f8f788a 100644 --- a/tests/cooperative-vector/conversion.slang +++ b/tests/cooperative-vector/conversion.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/exp.slang b/tests/cooperative-vector/exp.slang index 82c43c900..18e41b1b9 100644 --- a/tests/cooperative-vector/exp.slang +++ b/tests/cooperative-vector/exp.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/fma.slang b/tests/cooperative-vector/fma.slang index 9f0e194aa..cddf91ad2 100644 --- a/tests/cooperative-vector/fma.slang +++ b/tests/cooperative-vector/fma.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/log.slang b/tests/cooperative-vector/log.slang index 3e5cd32cf..99a5e1c49 100644 --- a/tests/cooperative-vector/log.slang +++ b/tests/cooperative-vector/log.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/matrix-mul-bias-packed-mut.slang b/tests/cooperative-vector/matrix-mul-bias-packed-mut.slang index 29038c83d..4abaaec8c 100644 --- a/tests/cooperative-vector/matrix-mul-bias-packed-mut.slang +++ b/tests/cooperative-vector/matrix-mul-bias-packed-mut.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/matrix-mul-bias-packed.slang b/tests/cooperative-vector/matrix-mul-bias-packed.slang index 16975cd09..c1f87b65c 100644 --- a/tests/cooperative-vector/matrix-mul-bias-packed.slang +++ b/tests/cooperative-vector/matrix-mul-bias-packed.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/max.slang b/tests/cooperative-vector/max.slang index 09eff40d7..55091127b 100644 --- a/tests/cooperative-vector/max.slang +++ b/tests/cooperative-vector/max.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/min.slang b/tests/cooperative-vector/min.slang index 25c363133..825891f6f 100644 --- a/tests/cooperative-vector/min.slang +++ b/tests/cooperative-vector/min.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/scalar-mul.slang b/tests/cooperative-vector/scalar-mul.slang index f9fed6d7d..bbb560daa 100644 --- a/tests/cooperative-vector/scalar-mul.slang +++ b/tests/cooperative-vector/scalar-mul.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/step.slang b/tests/cooperative-vector/step.slang index 620ad3398..4e6235f51 100644 --- a/tests/cooperative-vector/step.slang +++ b/tests/cooperative-vector/step.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type diff --git a/tests/cooperative-vector/tanh.slang b/tests/cooperative-vector/tanh.slang index 15fecbfa5..69334762e 100644 --- a/tests/cooperative-vector/tanh.slang +++ b/tests/cooperative-vector/tanh.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type -- cgit v1.2.3