From f7f0f3067c4c9662add8e9ac6ddb89dbd8657c78 Mon Sep 17 00:00:00 2001 From: Jeff Bolz Date: Thu, 12 Sep 2024 12:10:19 -0500 Subject: [PATCH] Add tests for compute shader derivatives with spec constant workgroup size --- .../baseResults/spv.computeShaderDerivativesSpec.comp.out | 6 ++++++ .../spv.computeShaderDerivativesSpec2.comp.out | 6 ++++++ Test/spv.computeShaderDerivativesSpec.comp | 8 ++++++++ Test/spv.computeShaderDerivativesSpec2.comp | 8 ++++++++ gtests/Spv.FromFile.cpp | 2 ++ 5 files changed, 30 insertions(+) create mode 100644 Test/baseResults/spv.computeShaderDerivativesSpec.comp.out create mode 100644 Test/baseResults/spv.computeShaderDerivativesSpec2.comp.out create mode 100644 Test/spv.computeShaderDerivativesSpec.comp create mode 100644 Test/spv.computeShaderDerivativesSpec2.comp diff --git a/Test/baseResults/spv.computeShaderDerivativesSpec.comp.out b/Test/baseResults/spv.computeShaderDerivativesSpec.comp.out new file mode 100644 index 0000000000..be4cc3ec41 --- /dev/null +++ b/Test/baseResults/spv.computeShaderDerivativesSpec.comp.out @@ -0,0 +1,6 @@ +spv.computeShaderDerivativesSpec.comp +ERROR: 0:5: 'derivative_group_quadsNV' : requires local_size_x and local_size_y to be multiple of two +ERROR: 1 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/Test/baseResults/spv.computeShaderDerivativesSpec2.comp.out b/Test/baseResults/spv.computeShaderDerivativesSpec2.comp.out new file mode 100644 index 0000000000..3417ff778f --- /dev/null +++ b/Test/baseResults/spv.computeShaderDerivativesSpec2.comp.out @@ -0,0 +1,6 @@ +spv.computeShaderDerivativesSpec2.comp +ERROR: 0:5: 'derivative_group_linearNV' : requires total group size to be multiple of four +ERROR: 1 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/Test/spv.computeShaderDerivativesSpec.comp b/Test/spv.computeShaderDerivativesSpec.comp new file mode 100644 index 0000000000..dd452d371a --- /dev/null +++ b/Test/spv.computeShaderDerivativesSpec.comp @@ -0,0 +1,8 @@ +#version 450 +#extension GL_NV_compute_shader_derivatives : require + +layout (local_size_x_id = 0, local_size_y_id = 1) in; +layout(derivative_group_quadsNV) in; + +void main(){ +} diff --git a/Test/spv.computeShaderDerivativesSpec2.comp b/Test/spv.computeShaderDerivativesSpec2.comp new file mode 100644 index 0000000000..48310ef56c --- /dev/null +++ b/Test/spv.computeShaderDerivativesSpec2.comp @@ -0,0 +1,8 @@ +#version 320 es +#extension GL_NV_compute_shader_derivatives : require + +layout (local_size_x_id = 0, local_size_y_id = 1) in; +layout(derivative_group_linearNV) in; + +void main(){ +} diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp index c8a24eca89..2267181654 100644 --- a/gtests/Spv.FromFile.cpp +++ b/gtests/Spv.FromFile.cpp @@ -896,6 +896,8 @@ INSTANTIATE_TEST_SUITE_P( "spv.fragmentShaderBarycentric2.frag", "spv.computeShaderDerivatives.comp", "spv.computeShaderDerivatives2.comp", + "spv.computeShaderDerivativesSpec.comp", + "spv.computeShaderDerivativesSpec2.comp", "spv.shaderImageFootprint.frag", "spv.meshShaderBuiltins.mesh", "spv.meshShaderUserDefined.mesh",