From ca4cfb9d6fe2b7618abda78455fd03a56318de26 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Tue, 25 Jan 2022 21:39:05 +0000 Subject: [PATCH] GLSL: implement interpolation qualifiers. Bug: tint:1399 tint:451 Change-Id: Idf02a98d2c51ab4d93847fc24a9d5a447ce3aaa3 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78222 Reviewed-by: Ben Clayton Kokoro: Kokoro Commit-Queue: Stephen White --- src/writer/glsl/generator_impl.cc | 76 ++++++++----------- src/writer/glsl/generator_impl.h | 13 ++-- test/bug/tint/1081.wgsl.expected.glsl | 11 +-- ...ragment_input_locations.wgsl.expected.glsl | 13 +--- ..._input_locations_struct.wgsl.expected.glsl | 13 +--- .../fragment_input_mixed.wgsl.expected.glsl | 8 +- ...polate_input_parameters.wgsl.expected.glsl | 6 +- ...nterpolate_input_struct.wgsl.expected.glsl | 6 +- .../interpolate_integers.wgsl.expected.glsl | 25 ++---- ...terpolate_return_struct.wgsl.expected.glsl | 6 +- ..._struct_helper_function.wgsl.expected.glsl | 4 +- ...d_struct_storage_buffer.wgsl.expected.glsl | 2 +- ...output_locations_struct.wgsl.expected.glsl | 4 +- ...tWrapping_IOLocations.spvasm.expected.glsl | 64 ---------------- .../no_image_store/1.spvasm.expected.glsl | 65 ---------------- .../no_image_store/1.wgsl.expected.glsl | 65 ---------------- .../no_output_write/1.spvasm.expected.glsl | 61 --------------- .../no_output_write/1.wgsl.expected.glsl | 61 --------------- .../1.spvasm.expected.glsl | 62 --------------- .../1.wgsl.expected.glsl | 62 --------------- .../no_ssbo_store/1.spvasm.expected.glsl | 2 +- .../no_ssbo_store/1.wgsl.expected.glsl | 2 +- .../1.spvasm.expected.glsl | 2 +- .../1.wgsl.expected.glsl | 2 +- .../terminate_loop/1.spvasm.expected.glsl | 76 ------------------- .../terminate_loop/1.wgsl.expected.glsl | 76 ------------------- 26 files changed, 72 insertions(+), 715 deletions(-) delete mode 100644 test/unittest/reader/spirv/SpvModuleScopeVarParserTest_EntryPointWrapping_IOLocations.spvasm.expected.glsl delete mode 100644 test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.spvasm.expected.glsl delete mode 100644 test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.wgsl.expected.glsl delete mode 100644 test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write/1.spvasm.expected.glsl delete mode 100644 test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write/1.wgsl.expected.glsl delete mode 100644 test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write_before_terminate/1.spvasm.expected.glsl delete mode 100644 test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write_before_terminate/1.wgsl.expected.glsl delete mode 100644 test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/terminate_loop/1.spvasm.expected.glsl delete mode 100644 test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/terminate_loop/1.wgsl.expected.glsl diff --git a/src/writer/glsl/generator_impl.cc b/src/writer/glsl/generator_impl.cc index 1444a69eb6..fa5e06bd4a 100644 --- a/src/writer/glsl/generator_impl.cc +++ b/src/writer/glsl/generator_impl.cc @@ -1840,33 +1840,30 @@ const char* GeneratorImpl::builtin_to_string(ast::Builtin builtin, } } -std::string GeneratorImpl::interpolation_to_modifiers( - ast::InterpolationType type, - ast::InterpolationSampling sampling) const { - std::string modifiers; - switch (type) { - case ast::InterpolationType::kPerspective: - modifiers += "linear "; - break; - case ast::InterpolationType::kLinear: - modifiers += "noperspective "; - break; - case ast::InterpolationType::kFlat: - modifiers += "nointerpolation "; - break; +void GeneratorImpl::EmitInterpolationQualifiers( + std::ostream& out, + const ast::DecorationList& decorations) { + for (auto* deco : decorations) { + if (auto* interpolate = deco->As()) { + switch (interpolate->type) { + case ast::InterpolationType::kPerspective: + case ast::InterpolationType::kLinear: + break; + case ast::InterpolationType::kFlat: + out << "flat "; + break; + } + switch (interpolate->sampling) { + case ast::InterpolationSampling::kCentroid: + out << "centroid "; + break; + case ast::InterpolationSampling::kSample: + case ast::InterpolationSampling::kCenter: + case ast::InterpolationSampling::kNone: + break; + } + } } - switch (sampling) { - case ast::InterpolationSampling::kCentroid: - modifiers += "centroid "; - break; - case ast::InterpolationSampling::kSample: - modifiers += "sample "; - break; - case ast::InterpolationSampling::kCenter: - case ast::InterpolationSampling::kNone: - break; - } - return modifiers; } bool GeneratorImpl::EmitDecorations(std::ostream& out, @@ -1980,6 +1977,10 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) { if (!EmitDecorations(out, decorations)) { return false; } + // GLSL does not support interpolation qualifiers on vertex inputs + if (func->PipelineStage() != ast::PipelineStage::kVertex) { + EmitInterpolationQualifiers(out, decorations); + } if (!EmitTypeAndName( out, member->Type(), ast::StorageClass::kInput, ast::Access::kReadWrite, @@ -2001,6 +2002,10 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) { if (!EmitDecorations(out, decorations)) { return false; } + // GLSL does not support interpolation qualifiers on fragment outputs + if (func->PipelineStage() != ast::PipelineStage::kFragment) { + EmitInterpolationQualifiers(out, decorations); + } if (!EmitTypeAndName( out, member->Type(), ast::StorageClass::kOutput, ast::Access::kReadWrite, @@ -2614,28 +2619,11 @@ bool GeneratorImpl::EmitStructMembers(TextBuffer* b, const sem::Struct* str) { auto out = line(b); - std::string pre, post; - - if (auto* decl = mem->Declaration()) { - for (auto* deco : decl->decorations) { - if (auto* interpolate = deco->As()) { - auto mod = interpolation_to_modifiers(interpolate->type, - interpolate->sampling); - if (mod.empty()) { - diagnostics_.add_error(diag::System::Writer, - "unsupported interpolation"); - return false; - } - } - } - } - - out << pre; if (!EmitTypeAndName(out, ty, ast::StorageClass::kNone, ast::Access::kReadWrite, name)) { return false; } - out << post << ";"; + out << ";"; } return true; } diff --git a/src/writer/glsl/generator_impl.h b/src/writer/glsl/generator_impl.h index e53fd225cf..ce6a4bb96c 100644 --- a/src/writer/glsl/generator_impl.h +++ b/src/writer/glsl/generator_impl.h @@ -292,6 +292,11 @@ class GeneratorImpl : public TextGenerator { /// @returns true on success bool EmitWorkgroupVariable(const sem::Variable* var); + /// Handles emitting interpolation qualifiers + /// @param out the output of the expression stream + /// @param decos the decorations + void EmitInterpolationQualifiers(std::ostream& out, + const ast::DecorationList& decos); /// Handles emitting decorations /// @param out the output of the expression stream /// @param decos the decorations @@ -410,14 +415,6 @@ class GeneratorImpl : public TextGenerator { /// @returns the appropriate semantic type or null on error. sem::Type* builtin_type(ast::Builtin builtin); - /// Converts interpolation attributes to a GLSL modifiers - /// @param type the interpolation type - /// @param sampling the interpolation sampling - /// @returns the string name of the attribute or blank on error - std::string interpolation_to_modifiers( - ast::InterpolationType type, - ast::InterpolationSampling sampling) const; - private: enum class VarType { kIn, kOut }; diff --git a/test/bug/tint/1081.wgsl.expected.glsl b/test/bug/tint/1081.wgsl.expected.glsl index 3637e846c7..a0b53fa9f6 100644 --- a/test/bug/tint/1081.wgsl.expected.glsl +++ b/test/bug/tint/1081.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -34,7 +32,7 @@ tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { wrapper_result.value = inner_result; return wrapper_result; } -layout(location = 1) in ivec3 x; +layout(location = 1) flat in ivec3 x; layout(location = 2) out int value; void main() { tint_symbol_2 inputs; @@ -45,10 +43,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:35: 'int' : must be qualified as flat in -ERROR: 0:35: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/shader_io/fragment_input_locations.wgsl.expected.glsl b/test/shader_io/fragment_input_locations.wgsl.expected.glsl index 66c175d5a4..8f917962bf 100644 --- a/test/shader_io/fragment_input_locations.wgsl.expected.glsl +++ b/test/shader_io/fragment_input_locations.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -21,8 +19,8 @@ void tint_symbol(tint_symbol_2 tint_symbol_1) { tint_symbol_inner(tint_symbol_1.loc0, tint_symbol_1.loc1, tint_symbol_1.loc2, tint_symbol_1.loc3); return; } -layout(location = 0) in int loc0; -layout(location = 1) in uint loc1; +layout(location = 0) flat in int loc0; +layout(location = 1) flat in uint loc1; layout(location = 2) in float loc2; layout(location = 3) in vec4 loc3; void main() { @@ -35,10 +33,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:22: 'int' : must be qualified as flat in -ERROR: 0:22: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/shader_io/fragment_input_locations_struct.wgsl.expected.glsl b/test/shader_io/fragment_input_locations_struct.wgsl.expected.glsl index 54cf564848..a187ac5747 100644 --- a/test/shader_io/fragment_input_locations_struct.wgsl.expected.glsl +++ b/test/shader_io/fragment_input_locations_struct.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -28,8 +26,8 @@ void tint_symbol(tint_symbol_2 tint_symbol_1) { tint_symbol_inner(tint_symbol_3); return; } -layout(location = 0) in int loc0; -layout(location = 1) in uint loc1; +layout(location = 0) flat in int loc0; +layout(location = 1) flat in uint loc1; layout(location = 2) in float loc2; layout(location = 3) in vec4 loc3; void main() { @@ -42,10 +40,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:29: 'int' : must be qualified as flat in -ERROR: 0:29: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/shader_io/fragment_input_mixed.wgsl.expected.glsl b/test/shader_io/fragment_input_mixed.wgsl.expected.glsl index 3304037e13..a8469155c3 100644 --- a/test/shader_io/fragment_input_mixed.wgsl.expected.glsl +++ b/test/shader_io/fragment_input_mixed.wgsl.expected.glsl @@ -39,8 +39,8 @@ void tint_symbol(tint_symbol_2 tint_symbol_1) { tint_symbol_inner(tint_symbol_3, tint_symbol_1.front_facing, tint_symbol_1.loc1, tint_symbol_1.sample_index, tint_symbol_4, tint_symbol_1.loc2); return; } -layout(location = 0) in int loc0; -layout(location = 1) in uint loc1; +layout(location = 0) flat in int loc0; +layout(location = 1) flat in uint loc1; layout(location = 2) in float loc2; layout(location = 3) in vec4 loc3; void main() { @@ -58,8 +58,8 @@ void main() { Error parsing GLSL shader: -ERROR: 0:40: 'int' : must be qualified as flat in -ERROR: 0:40: '' : compilation terminated +ERROR: 0:52: 'gl_SampleID' : required extension not requested: GL_OES_sample_variables +ERROR: 0:52: '' : compilation terminated ERROR: 2 compilation errors. No code generated. diff --git a/test/shader_io/interpolate_input_parameters.wgsl.expected.glsl b/test/shader_io/interpolate_input_parameters.wgsl.expected.glsl index 73269ca842..b02bb3495f 100644 --- a/test/shader_io/interpolate_input_parameters.wgsl.expected.glsl +++ b/test/shader_io/interpolate_input_parameters.wgsl.expected.glsl @@ -20,12 +20,12 @@ void tint_symbol(tint_symbol_3 tint_symbol_2) { return; } layout(location = 0) in float none; -layout(location = 1) in float tint_symbol_1; +layout(location = 1) flat in float tint_symbol_1; layout(location = 2) in float perspective_center; -layout(location = 3) in float perspective_centroid; +layout(location = 3) centroid in float perspective_centroid; layout(location = 4) in float perspective_sample; layout(location = 5) in float linear_center; -layout(location = 6) in float linear_centroid; +layout(location = 6) centroid in float linear_centroid; layout(location = 7) in float linear_sample; void main() { tint_symbol_3 inputs; diff --git a/test/shader_io/interpolate_input_struct.wgsl.expected.glsl b/test/shader_io/interpolate_input_struct.wgsl.expected.glsl index b5aa84ceb7..b4ebc59696 100644 --- a/test/shader_io/interpolate_input_struct.wgsl.expected.glsl +++ b/test/shader_io/interpolate_input_struct.wgsl.expected.glsl @@ -31,12 +31,12 @@ void tint_symbol_1(tint_symbol_4 tint_symbol_3) { return; } layout(location = 0) in float none; -layout(location = 1) in float tint_symbol; +layout(location = 1) flat in float tint_symbol; layout(location = 2) in float perspective_center; -layout(location = 3) in float perspective_centroid; +layout(location = 3) centroid in float perspective_centroid; layout(location = 4) in float perspective_sample; layout(location = 5) in float linear_center; -layout(location = 6) in float linear_centroid; +layout(location = 6) centroid in float linear_centroid; layout(location = 7) in float linear_sample; void main() { tint_symbol_4 inputs; diff --git a/test/shader_io/interpolate_integers.wgsl.expected.glsl b/test/shader_io/interpolate_integers.wgsl.expected.glsl index 721460e3b6..736525ab50 100644 --- a/test/shader_io/interpolate_integers.wgsl.expected.glsl +++ b/test/shader_io/interpolate_integers.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -44,10 +42,10 @@ tint_symbol vert_main() { wrapper_result.pos = inner_result.pos; return wrapper_result; } -layout(location = 0) out int i; -layout(location = 1) out uint u; -layout(location = 2) out ivec4 vi; -layout(location = 3) out uvec4 vu; +layout(location = 0) flat out int i; +layout(location = 1) flat out uint u; +layout(location = 2) flat out ivec4 vi; +layout(location = 3) flat out uvec4 vu; void main() { tint_symbol outputs; outputs = vert_main(); @@ -99,10 +97,10 @@ tint_symbol_3 frag_main(tint_symbol_2 tint_symbol_1) { wrapper_result_1.value = inner_result_1; return wrapper_result_1; } -layout(location = 0) in int i; -layout(location = 1) in uint u; -layout(location = 2) in ivec4 vi; -layout(location = 3) in uvec4 vu; +layout(location = 0) flat in int i; +layout(location = 1) flat in uint u; +layout(location = 2) flat in ivec4 vi; +layout(location = 3) flat in uvec4 vu; layout(location = 0) out int value; void main() { tint_symbol_2 inputs; @@ -117,10 +115,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:40: 'int' : must be qualified as flat in -ERROR: 0:40: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/shader_io/interpolate_return_struct.wgsl.expected.glsl b/test/shader_io/interpolate_return_struct.wgsl.expected.glsl index f4ed345e18..c9ee276993 100644 --- a/test/shader_io/interpolate_return_struct.wgsl.expected.glsl +++ b/test/shader_io/interpolate_return_struct.wgsl.expected.glsl @@ -44,12 +44,12 @@ tint_symbol_2 tint_symbol_1() { return wrapper_result; } layout(location = 0) out float none; -layout(location = 1) out float tint_symbol; +layout(location = 1) flat out float tint_symbol; layout(location = 2) out float perspective_center; -layout(location = 3) out float perspective_centroid; +layout(location = 3) centroid out float perspective_centroid; layout(location = 4) out float perspective_sample; layout(location = 5) out float linear_center; -layout(location = 6) out float linear_centroid; +layout(location = 6) centroid out float linear_centroid; layout(location = 7) out float linear_sample; void main() { tint_symbol_2 outputs; diff --git a/test/shader_io/shared_struct_helper_function.wgsl.expected.glsl b/test/shader_io/shared_struct_helper_function.wgsl.expected.glsl index c94bcbdd26..875731b606 100644 --- a/test/shader_io/shared_struct_helper_function.wgsl.expected.glsl +++ b/test/shader_io/shared_struct_helper_function.wgsl.expected.glsl @@ -32,7 +32,7 @@ tint_symbol vert_main1() { wrapper_result.loc0 = inner_result.loc0; return wrapper_result; } -layout(location = 0) out int loc0; +layout(location = 0) flat out int loc0; void main() { tint_symbol outputs; outputs = vert_main1(); @@ -75,7 +75,7 @@ tint_symbol_1 vert_main2() { wrapper_result_1.loc0 = inner_result_1.loc0; return wrapper_result_1; } -layout(location = 0) out int loc0; +layout(location = 0) flat out int loc0; void main() { tint_symbol_1 outputs; outputs = vert_main2(); diff --git a/test/shader_io/shared_struct_storage_buffer.wgsl.expected.glsl b/test/shader_io/shared_struct_storage_buffer.wgsl.expected.glsl index 06aedda60f..b8b01eb7be 100644 --- a/test/shader_io/shared_struct_storage_buffer.wgsl.expected.glsl +++ b/test/shader_io/shared_struct_storage_buffer.wgsl.expected.glsl @@ -34,7 +34,7 @@ void frag_main(tint_symbol_3 tint_symbol_2) { return; } layout(location = 0) in float f; -layout(location = 1) in uint u; +layout(location = 1) flat in uint u; void main() { tint_symbol_3 inputs; inputs.f = f; diff --git a/test/shader_io/vertex_output_locations_struct.wgsl.expected.glsl b/test/shader_io/vertex_output_locations_struct.wgsl.expected.glsl index 0a758bcc6a..90910ba50e 100644 --- a/test/shader_io/vertex_output_locations_struct.wgsl.expected.glsl +++ b/test/shader_io/vertex_output_locations_struct.wgsl.expected.glsl @@ -31,8 +31,8 @@ tint_symbol_1 tint_symbol() { wrapper_result.position = inner_result.position; return wrapper_result; } -layout(location = 0) out int loc0; -layout(location = 1) out uint loc1; +layout(location = 0) flat out int loc0; +layout(location = 1) flat out uint loc1; layout(location = 2) out float loc2; layout(location = 3) out vec4 loc3; void main() { diff --git a/test/unittest/reader/spirv/SpvModuleScopeVarParserTest_EntryPointWrapping_IOLocations.spvasm.expected.glsl b/test/unittest/reader/spirv/SpvModuleScopeVarParserTest_EntryPointWrapping_IOLocations.spvasm.expected.glsl deleted file mode 100644 index d4c764d2b6..0000000000 --- a/test/unittest/reader/spirv/SpvModuleScopeVarParserTest_EntryPointWrapping_IOLocations.spvasm.expected.glsl +++ /dev/null @@ -1,64 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -uint x_1 = 0u; -uint x_2 = 0u; -uint x_3 = 0u; -uint x_4 = 0u; - -void main_1() { - return; -} - -struct main_out { - uint x_2_1; - uint x_4_1; -}; -struct tint_symbol_2 { - uint x_1_param; - uint x_3_param; -}; -struct tint_symbol_3 { - uint x_2_1; - uint x_4_1; -}; - -main_out tint_symbol_inner(uint x_1_param, uint x_3_param) { - x_1 = x_1_param; - x_3 = x_3_param; - main_1(); - main_out tint_symbol_4 = main_out(x_2, x_4); - return tint_symbol_4; -} - -tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { - main_out inner_result = tint_symbol_inner(tint_symbol_1.x_1_param, tint_symbol_1.x_3_param); - tint_symbol_3 wrapper_result = tint_symbol_3(0u, 0u); - wrapper_result.x_2_1 = inner_result.x_2_1; - wrapper_result.x_4_1 = inner_result.x_4_1; - return wrapper_result; -} -layout(location = 0) in uint x_1_param; -layout(location = 30) in uint x_3_param; -layout(location = 0) out uint x_2_1; -layout(location = 6) out uint x_4_1; -void main() { - tint_symbol_2 inputs; - inputs.x_1_param = x_1_param; - inputs.x_3_param = x_3_param; - tint_symbol_3 outputs; - outputs = tint_symbol(inputs); - x_2_1 = outputs.x_2_1; - x_4_1 = outputs.x_4_1; -} - - -Error parsing GLSL shader: -ERROR: 0:41: 'uint' : must be qualified as flat in -ERROR: 0:41: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.spvasm.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.spvasm.expected.glsl deleted file mode 100644 index f8c14c2404..0000000000 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.spvasm.expected.glsl +++ /dev/null @@ -1,65 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -vec4 x_2 = vec4(0.0f, 0.0f, 0.0f, 0.0f); -int x_3 = 0; -int x_4 = 0; -layout(r32i) uniform highp writeonly iimage2D x_5_1; - -void main_1() { - x_4 = 1; - vec4 x_23 = x_2; - int x_27 = int(x_23.x); - int x_28 = int(x_23.y); - if (((((x_27 & 1) + (x_28 & 1)) + x_3) == int(x_23.z))) { - } - imageStore(x_5_1, ivec2(x_27, x_28), ivec4(x_27, 0, 0, 0)); - return; -} - -struct main_out { - int x_4_1; -}; -struct tint_symbol_2 { - int x_3_param; - vec4 x_2_param; -}; -struct tint_symbol_3 { - int x_4_1; -}; - -main_out tint_symbol_inner(vec4 x_2_param, int x_3_param) { - x_2 = x_2_param; - x_3 = x_3_param; - main_1(); - main_out tint_symbol_4 = main_out(x_4); - return tint_symbol_4; -} - -tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { - main_out inner_result = tint_symbol_inner(tint_symbol_1.x_2_param, tint_symbol_1.x_3_param); - tint_symbol_3 wrapper_result = tint_symbol_3(0); - wrapper_result.x_4_1 = inner_result.x_4_1; - return wrapper_result; -} -layout(location = 0) in int x_3_param; -layout(location = 0) out int x_4_1; -void main() { - tint_symbol_2 inputs; - inputs.x_3_param = x_3_param; - inputs.x_2_param = gl_FragCoord; - tint_symbol_3 outputs; - outputs = tint_symbol(inputs); - x_4_1 = outputs.x_4_1; -} - - -Error parsing GLSL shader: -ERROR: 0:45: 'int' : must be qualified as flat in -ERROR: 0:45: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.wgsl.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.wgsl.expected.glsl deleted file mode 100644 index f8c14c2404..0000000000 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.wgsl.expected.glsl +++ /dev/null @@ -1,65 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -vec4 x_2 = vec4(0.0f, 0.0f, 0.0f, 0.0f); -int x_3 = 0; -int x_4 = 0; -layout(r32i) uniform highp writeonly iimage2D x_5_1; - -void main_1() { - x_4 = 1; - vec4 x_23 = x_2; - int x_27 = int(x_23.x); - int x_28 = int(x_23.y); - if (((((x_27 & 1) + (x_28 & 1)) + x_3) == int(x_23.z))) { - } - imageStore(x_5_1, ivec2(x_27, x_28), ivec4(x_27, 0, 0, 0)); - return; -} - -struct main_out { - int x_4_1; -}; -struct tint_symbol_2 { - int x_3_param; - vec4 x_2_param; -}; -struct tint_symbol_3 { - int x_4_1; -}; - -main_out tint_symbol_inner(vec4 x_2_param, int x_3_param) { - x_2 = x_2_param; - x_3 = x_3_param; - main_1(); - main_out tint_symbol_4 = main_out(x_4); - return tint_symbol_4; -} - -tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { - main_out inner_result = tint_symbol_inner(tint_symbol_1.x_2_param, tint_symbol_1.x_3_param); - tint_symbol_3 wrapper_result = tint_symbol_3(0); - wrapper_result.x_4_1 = inner_result.x_4_1; - return wrapper_result; -} -layout(location = 0) in int x_3_param; -layout(location = 0) out int x_4_1; -void main() { - tint_symbol_2 inputs; - inputs.x_3_param = x_3_param; - inputs.x_2_param = gl_FragCoord; - tint_symbol_3 outputs; - outputs = tint_symbol(inputs); - x_4_1 = outputs.x_4_1; -} - - -Error parsing GLSL shader: -ERROR: 0:45: 'int' : must be qualified as flat in -ERROR: 0:45: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write/1.spvasm.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write/1.spvasm.expected.glsl deleted file mode 100644 index 3eb1c86409..0000000000 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write/1.spvasm.expected.glsl +++ /dev/null @@ -1,61 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -vec4 x_2 = vec4(0.0f, 0.0f, 0.0f, 0.0f); -int x_3 = 0; -int x_4 = 0; - -void main_1() { - vec4 x_16 = x_2; - if (((((int(x_16.x) & 1) + (int(x_16.y) & 1)) + x_3) == int(x_16.z))) { - } - x_4 = 1; - return; -} - -struct main_out { - int x_4_1; -}; -struct tint_symbol_2 { - int x_3_param; - vec4 x_2_param; -}; -struct tint_symbol_3 { - int x_4_1; -}; - -main_out tint_symbol_inner(vec4 x_2_param, int x_3_param) { - x_2 = x_2_param; - x_3 = x_3_param; - main_1(); - main_out tint_symbol_4 = main_out(x_4); - return tint_symbol_4; -} - -tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { - main_out inner_result = tint_symbol_inner(tint_symbol_1.x_2_param, tint_symbol_1.x_3_param); - tint_symbol_3 wrapper_result = tint_symbol_3(0); - wrapper_result.x_4_1 = inner_result.x_4_1; - return wrapper_result; -} -layout(location = 0) in int x_3_param; -layout(location = 0) out int x_4_1; -void main() { - tint_symbol_2 inputs; - inputs.x_3_param = x_3_param; - inputs.x_2_param = gl_FragCoord; - tint_symbol_3 outputs; - outputs = tint_symbol(inputs); - x_4_1 = outputs.x_4_1; -} - - -Error parsing GLSL shader: -ERROR: 0:41: 'int' : must be qualified as flat in -ERROR: 0:41: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write/1.wgsl.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write/1.wgsl.expected.glsl deleted file mode 100644 index 3eb1c86409..0000000000 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write/1.wgsl.expected.glsl +++ /dev/null @@ -1,61 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -vec4 x_2 = vec4(0.0f, 0.0f, 0.0f, 0.0f); -int x_3 = 0; -int x_4 = 0; - -void main_1() { - vec4 x_16 = x_2; - if (((((int(x_16.x) & 1) + (int(x_16.y) & 1)) + x_3) == int(x_16.z))) { - } - x_4 = 1; - return; -} - -struct main_out { - int x_4_1; -}; -struct tint_symbol_2 { - int x_3_param; - vec4 x_2_param; -}; -struct tint_symbol_3 { - int x_4_1; -}; - -main_out tint_symbol_inner(vec4 x_2_param, int x_3_param) { - x_2 = x_2_param; - x_3 = x_3_param; - main_1(); - main_out tint_symbol_4 = main_out(x_4); - return tint_symbol_4; -} - -tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { - main_out inner_result = tint_symbol_inner(tint_symbol_1.x_2_param, tint_symbol_1.x_3_param); - tint_symbol_3 wrapper_result = tint_symbol_3(0); - wrapper_result.x_4_1 = inner_result.x_4_1; - return wrapper_result; -} -layout(location = 0) in int x_3_param; -layout(location = 0) out int x_4_1; -void main() { - tint_symbol_2 inputs; - inputs.x_3_param = x_3_param; - inputs.x_2_param = gl_FragCoord; - tint_symbol_3 outputs; - outputs = tint_symbol(inputs); - x_4_1 = outputs.x_4_1; -} - - -Error parsing GLSL shader: -ERROR: 0:41: 'int' : must be qualified as flat in -ERROR: 0:41: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write_before_terminate/1.spvasm.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write_before_terminate/1.spvasm.expected.glsl deleted file mode 100644 index c882569476..0000000000 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write_before_terminate/1.spvasm.expected.glsl +++ /dev/null @@ -1,62 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -vec4 x_2 = vec4(0.0f, 0.0f, 0.0f, 0.0f); -int x_3 = 0; -int x_4 = 0; - -void main_1() { - vec4 x_16 = x_2; - int x_26 = x_3; - x_4 = 1; - if (((((int(x_16.x) & 1) + (int(x_16.y) & 1)) + x_26) == int(x_16.z))) { - } - return; -} - -struct main_out { - int x_4_1; -}; -struct tint_symbol_2 { - int x_3_param; - vec4 x_2_param; -}; -struct tint_symbol_3 { - int x_4_1; -}; - -main_out tint_symbol_inner(vec4 x_2_param, int x_3_param) { - x_2 = x_2_param; - x_3 = x_3_param; - main_1(); - main_out tint_symbol_4 = main_out(x_4); - return tint_symbol_4; -} - -tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { - main_out inner_result = tint_symbol_inner(tint_symbol_1.x_2_param, tint_symbol_1.x_3_param); - tint_symbol_3 wrapper_result = tint_symbol_3(0); - wrapper_result.x_4_1 = inner_result.x_4_1; - return wrapper_result; -} -layout(location = 0) in int x_3_param; -layout(location = 0) out int x_4_1; -void main() { - tint_symbol_2 inputs; - inputs.x_3_param = x_3_param; - inputs.x_2_param = gl_FragCoord; - tint_symbol_3 outputs; - outputs = tint_symbol(inputs); - x_4_1 = outputs.x_4_1; -} - - -Error parsing GLSL shader: -ERROR: 0:42: 'int' : must be qualified as flat in -ERROR: 0:42: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write_before_terminate/1.wgsl.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write_before_terminate/1.wgsl.expected.glsl deleted file mode 100644 index c882569476..0000000000 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_output_write_before_terminate/1.wgsl.expected.glsl +++ /dev/null @@ -1,62 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -vec4 x_2 = vec4(0.0f, 0.0f, 0.0f, 0.0f); -int x_3 = 0; -int x_4 = 0; - -void main_1() { - vec4 x_16 = x_2; - int x_26 = x_3; - x_4 = 1; - if (((((int(x_16.x) & 1) + (int(x_16.y) & 1)) + x_26) == int(x_16.z))) { - } - return; -} - -struct main_out { - int x_4_1; -}; -struct tint_symbol_2 { - int x_3_param; - vec4 x_2_param; -}; -struct tint_symbol_3 { - int x_4_1; -}; - -main_out tint_symbol_inner(vec4 x_2_param, int x_3_param) { - x_2 = x_2_param; - x_3 = x_3_param; - main_1(); - main_out tint_symbol_4 = main_out(x_4); - return tint_symbol_4; -} - -tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { - main_out inner_result = tint_symbol_inner(tint_symbol_1.x_2_param, tint_symbol_1.x_3_param); - tint_symbol_3 wrapper_result = tint_symbol_3(0); - wrapper_result.x_4_1 = inner_result.x_4_1; - return wrapper_result; -} -layout(location = 0) in int x_3_param; -layout(location = 0) out int x_4_1; -void main() { - tint_symbol_2 inputs; - inputs.x_3_param = x_3_param; - inputs.x_2_param = gl_FragCoord; - tint_symbol_3 outputs; - outputs = tint_symbol(inputs); - x_4_1 = outputs.x_4_1; -} - - -Error parsing GLSL shader: -ERROR: 0:42: 'int' : must be qualified as flat in -ERROR: 0:42: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_ssbo_store/1.spvasm.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_ssbo_store/1.spvasm.expected.glsl index e7a03335e8..c06c74435d 100644 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_ssbo_store/1.spvasm.expected.glsl +++ b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_ssbo_store/1.spvasm.expected.glsl @@ -50,7 +50,7 @@ tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { wrapper_result.x_4_1 = inner_result.x_4_1; return wrapper_result; } -layout(location = 0) in int x_3_param; +layout(location = 0) flat in int x_3_param; layout(location = 0) out int x_4_1; void main() { tint_symbol_2 inputs; diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_ssbo_store/1.wgsl.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_ssbo_store/1.wgsl.expected.glsl index ef745b9fa0..cf3ecc7193 100644 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_ssbo_store/1.wgsl.expected.glsl +++ b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_ssbo_store/1.wgsl.expected.glsl @@ -54,7 +54,7 @@ tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { wrapper_result.x_4_1 = inner_result.x_4_1; return wrapper_result; } -layout(location = 0) in int x_3_param; +layout(location = 0) flat in int x_3_param; layout(location = 0) out int x_4_1; void main() { tint_symbol_2 inputs; diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/ssbo_store_before_terminate/1.spvasm.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/ssbo_store_before_terminate/1.spvasm.expected.glsl index 50f2abdf79..18cb20e058 100644 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/ssbo_store_before_terminate/1.spvasm.expected.glsl +++ b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/ssbo_store_before_terminate/1.spvasm.expected.glsl @@ -51,7 +51,7 @@ tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { wrapper_result.x_4_1 = inner_result.x_4_1; return wrapper_result; } -layout(location = 0) in int x_3_param; +layout(location = 0) flat in int x_3_param; layout(location = 0) out int x_4_1; void main() { tint_symbol_2 inputs; diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/ssbo_store_before_terminate/1.wgsl.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/ssbo_store_before_terminate/1.wgsl.expected.glsl index 5a47c561a7..133921cb0f 100644 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/ssbo_store_before_terminate/1.wgsl.expected.glsl +++ b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/ssbo_store_before_terminate/1.wgsl.expected.glsl @@ -55,7 +55,7 @@ tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { wrapper_result.x_4_1 = inner_result.x_4_1; return wrapper_result; } -layout(location = 0) in int x_3_param; +layout(location = 0) flat in int x_3_param; layout(location = 0) out int x_4_1; void main() { tint_symbol_2 inputs; diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/terminate_loop/1.spvasm.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/terminate_loop/1.spvasm.expected.glsl deleted file mode 100644 index 89108cf440..0000000000 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/terminate_loop/1.spvasm.expected.glsl +++ /dev/null @@ -1,76 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -vec4 x_2 = vec4(0.0f, 0.0f, 0.0f, 0.0f); -int x_3 = 0; -int x_4 = 0; - -void main_1() { - int x_33_phi = 0; - vec4 x_18 = x_2; - int x_28 = x_3; - x_33_phi = 0; - if (((((int(x_18.x) & 1) + (int(x_18.y) & 1)) + x_28) == int(x_18.z))) { - while (true) { - int x_34 = 0; - int x_33 = x_33_phi; - if ((uint(x_33) < uint(10))) { - } else { - break; - } - { - x_34 = (x_33 + 1); - x_33_phi = x_34; - } - } - } - x_4 = 1; - return; -} - -struct main_out { - int x_4_1; -}; -struct tint_symbol_2 { - int x_3_param; - vec4 x_2_param; -}; -struct tint_symbol_3 { - int x_4_1; -}; - -main_out tint_symbol_inner(vec4 x_2_param, int x_3_param) { - x_2 = x_2_param; - x_3 = x_3_param; - main_1(); - main_out tint_symbol_4 = main_out(x_4); - return tint_symbol_4; -} - -tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { - main_out inner_result = tint_symbol_inner(tint_symbol_1.x_2_param, tint_symbol_1.x_3_param); - tint_symbol_3 wrapper_result = tint_symbol_3(0); - wrapper_result.x_4_1 = inner_result.x_4_1; - return wrapper_result; -} -layout(location = 0) in int x_3_param; -layout(location = 0) out int x_4_1; -void main() { - tint_symbol_2 inputs; - inputs.x_3_param = x_3_param; - inputs.x_2_param = gl_FragCoord; - tint_symbol_3 outputs; - outputs = tint_symbol(inputs); - x_4_1 = outputs.x_4_1; -} - - -Error parsing GLSL shader: -ERROR: 0:56: 'int' : must be qualified as flat in -ERROR: 0:56: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/terminate_loop/1.wgsl.expected.glsl b/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/terminate_loop/1.wgsl.expected.glsl deleted file mode 100644 index 89108cf440..0000000000 --- a/test/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/terminate_loop/1.wgsl.expected.glsl +++ /dev/null @@ -1,76 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -vec4 x_2 = vec4(0.0f, 0.0f, 0.0f, 0.0f); -int x_3 = 0; -int x_4 = 0; - -void main_1() { - int x_33_phi = 0; - vec4 x_18 = x_2; - int x_28 = x_3; - x_33_phi = 0; - if (((((int(x_18.x) & 1) + (int(x_18.y) & 1)) + x_28) == int(x_18.z))) { - while (true) { - int x_34 = 0; - int x_33 = x_33_phi; - if ((uint(x_33) < uint(10))) { - } else { - break; - } - { - x_34 = (x_33 + 1); - x_33_phi = x_34; - } - } - } - x_4 = 1; - return; -} - -struct main_out { - int x_4_1; -}; -struct tint_symbol_2 { - int x_3_param; - vec4 x_2_param; -}; -struct tint_symbol_3 { - int x_4_1; -}; - -main_out tint_symbol_inner(vec4 x_2_param, int x_3_param) { - x_2 = x_2_param; - x_3 = x_3_param; - main_1(); - main_out tint_symbol_4 = main_out(x_4); - return tint_symbol_4; -} - -tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) { - main_out inner_result = tint_symbol_inner(tint_symbol_1.x_2_param, tint_symbol_1.x_3_param); - tint_symbol_3 wrapper_result = tint_symbol_3(0); - wrapper_result.x_4_1 = inner_result.x_4_1; - return wrapper_result; -} -layout(location = 0) in int x_3_param; -layout(location = 0) out int x_4_1; -void main() { - tint_symbol_2 inputs; - inputs.x_3_param = x_3_param; - inputs.x_2_param = gl_FragCoord; - tint_symbol_3 outputs; - outputs = tint_symbol(inputs); - x_4_1 = outputs.x_4_1; -} - - -Error parsing GLSL shader: -ERROR: 0:56: 'int' : must be qualified as flat in -ERROR: 0:56: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - -