From 0e91cd389d347b756d0458daa466e3a8a99b10eb Mon Sep 17 00:00:00 2001 From: James Helferty Date: Tue, 11 Apr 2017 14:02:32 -0400 Subject: [PATCH] Cleanup PER_VERTEX declarations for specialization This change harmonizes all of the PER_VERTEX declarations in the shader specialization map so that they all use the same naming convention, and have the same code formatting style. It also corrects some values that were incorrect or missing for some tests. Fixes: KHR-GL44.geometry_shader.api.program_pipeline_vs_gs_capture KHR-GL44.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_MaxPatchVertices_Position_PointSize KHR-GL45.geometry_shader.api.program_pipeline_vs_gs_capture KHR-GL45.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_MaxPatchVertices_Position_PointSize Affects: KHR-GLES31.core.geometry_shader.api.incompatible_draw_call_mode KHR-GLES31.core.geometry_shader.api.insufficient_emitted_vertices KHR-GLES31.core.geometry_shader.api.program_pipeline_vs_gs_capture KHR-GLES31.core.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_MaxPatchVertices_Position_PointSize KHR-GLES31.core.tessellation_shader.single.xfb_captures_data_from_correct_stage KHR-GLES32.core.geometry_shader.api.incompatible_draw_call_mode KHR-GLES32.core.geometry_shader.api.insufficient_emitted_vertices KHR-GLES32.core.geometry_shader.api.program_pipeline_vs_gs_capture KHR-GLES32.core.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_MaxPatchVertices_Position_PointSize KHR-GLES32.core.tessellation_shader.single.xfb_captures_data_from_correct_stage KHR-GL44.geometry_shader.api.incompatible_draw_call_mode KHR-GL44.geometry_shader.api.insufficient_emitted_vertices KHR-GL44.geometry_shader.api.program_pipeline_vs_gs_capture KHR-GL44.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_MaxPatchVertices_Position_PointSize KHR-GL44.tessellation_shader.single.xfb_captures_data_from_correct_stage KHR-GL45.geometry_shader.api.incompatible_draw_call_mode KHR-GL45.geometry_shader.api.insufficient_emitted_vertices KHR-GL45.geometry_shader.api.program_pipeline_vs_gs_capture KHR-GL45.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_MaxPatchVertices_Position_PointSize KHR-GL45.tessellation_shader.single.xfb_captures_data_from_correct_stage Component: OpenGL VK-GL-CTS issue: 364 Change-Id: I1eb6d81b6de95a1f247615afe0ebc9dd99bddb1a --- .../modules/glesext/esextcTestCaseBase.cpp | 43 ++++++++++++++-------- .../geometry_shader/esextcGeometryShaderAPI.cpp | 17 +++++---- .../esextcTessellationShaderTCTE.cpp | 12 +++--- .../esextcTessellationShaderXFB.cpp | 8 ++-- 4 files changed, 47 insertions(+), 33 deletions(-) diff --git a/external/openglcts/modules/glesext/esextcTestCaseBase.cpp b/external/openglcts/modules/glesext/esextcTestCaseBase.cpp index 54a5691..5a8c624 100644 --- a/external/openglcts/modules/glesext/esextcTestCaseBase.cpp +++ b/external/openglcts/modules/glesext/esextcTestCaseBase.cpp @@ -230,31 +230,42 @@ void TestCaseBase::initGLSLSpecializationMap() if (glu::isContextTypeES(m_context.getRenderContext().getType())) { - m_specializationMap["OUT_PER_VERTEX_DECL"] = "\n"; - m_specializationMap["IN_PER_VERTEX_DECL"] = "\n"; - m_specializationMap["OUT_PER_VERTEX_DECL_POINT_SIZE"] = "\n"; - m_specializationMap["IN_PER_VERTEX_DECL_POINT_SIZE"] = "\n"; - m_specializationMap["IN_DATA_DECL"] = "\n"; - m_specializationMap["POSITION_WITH_IN_DATA"] = "gl_Position = gl_in[0].gl_Position;\n"; - m_specializationMap["OUT_PER_VERTEX_TCS_DECL"] = "\n"; + m_specializationMap["IN_PER_VERTEX_DECL_ARRAY"] = "\n"; + m_specializationMap["IN_PER_VERTEX_DECL_ARRAY_POINT_SIZE"] = "\n"; + m_specializationMap["OUT_PER_VERTEX_DECL"] = "\n"; + m_specializationMap["OUT_PER_VERTEX_DECL_POINT_SIZE"] = "\n"; + m_specializationMap["OUT_PER_VERTEX_DECL_ARRAY"] = "\n"; + m_specializationMap["OUT_PER_VERTEX_DECL_ARRAY_POINT_SIZE"] = "\n"; + m_specializationMap["IN_DATA_DECL"] = "\n"; + m_specializationMap["POSITION_WITH_IN_DATA"] = "gl_Position = gl_in[0].gl_Position;\n"; } else { + m_specializationMap["IN_PER_VERTEX_DECL_ARRAY"] = "in gl_PerVertex {\n" + " vec4 gl_Position;\n" + "} gl_in[];\n"; + m_specializationMap["IN_PER_VERTEX_DECL_ARRAY_POINT_SIZE"] = "in gl_PerVertex {\n" + " vec4 gl_Position;\n" + " float gl_PointSize;\n" + "} gl_in[];\n"; m_specializationMap["OUT_PER_VERTEX_DECL"] = "out gl_PerVertex {\n" " vec4 gl_Position;\n" "};\n"; - m_specializationMap["IN_PER_VERTEX_DECL"] = "in gl_PerVertex { vec4 gl_Position; } gl_in[];\n"; - m_specializationMap["OUT_PER_VERTEX_DECL_POINT_SIZE"] = - "out gl_PerVertex { vec4 gl_Position; float gl_PointSize;} gl_out[];\n"; - m_specializationMap["IN_PER_VERTEX_DECL_POINT_SIZE"] = - "in gl_PerVertex { vec4 gl_Position; float gl_PointSize;} gl_in[]\n"; + m_specializationMap["OUT_PER_VERTEX_DECL_POINT_SIZE"] = "out gl_PerVertex {\n" + " vec4 gl_Position;\n" + " float gl_PointSize;\n" + "};\n"; + m_specializationMap["OUT_PER_VERTEX_DECL_ARRAY"] = "out gl_PerVertex {\n" + " vec4 gl_Position;\n" + "} gl_out[];\n"; + m_specializationMap["OUT_PER_VERTEX_DECL_ARRAY_POINT_SIZE"] = "out gl_PerVertex {\n" + " vec4 gl_Position;\n" + " float gl_PointSize;\n" + "} gl_out[];\n"; m_specializationMap["IN_DATA_DECL"] = "in Data {\n" " vec4 pos;\n" "} input_data[1];\n"; - m_specializationMap["POSITION_WITH_IN_DATA"] = "gl_Position = input_data[0].pos;\n"; - m_specializationMap["OUT_PER_VERTEX_TCS_DECL"] = "out gl_PerVertex {\n" - " vec4 gl_Position;\n" - "} gl_out[];\n"; + m_specializationMap["POSITION_WITH_IN_DATA"] = "gl_Position = input_data[0].pos;\n"; } } diff --git a/external/openglcts/modules/glesext/geometry_shader/esextcGeometryShaderAPI.cpp b/external/openglcts/modules/glesext/geometry_shader/esextcGeometryShaderAPI.cpp index 893fb44..2695949 100644 --- a/external/openglcts/modules/glesext/geometry_shader/esextcGeometryShaderAPI.cpp +++ b/external/openglcts/modules/glesext/geometry_shader/esextcGeometryShaderAPI.cpp @@ -3031,7 +3031,7 @@ tcu::TestNode::IterateResult GeometryShaderIncompatibleDrawCallModeTest::iterate "layout (points) in;\n" "layout (points, max_vertices = 1) out;\n" "\n" - "${IN_PER_VERTEX_DECL}" + "${IN_PER_VERTEX_DECL_ARRAY}" "\n" "void main()\n" "{\n" @@ -3045,7 +3045,7 @@ tcu::TestNode::IterateResult GeometryShaderIncompatibleDrawCallModeTest::iterate "layout (lines) in;\n" "layout (points, max_vertices = 1) out;\n" "\n" - "${IN_PER_VERTEX_DECL}" + "${IN_PER_VERTEX_DECL_ARRAY}" "\n" "void main()\n" "{\n" @@ -3059,7 +3059,7 @@ tcu::TestNode::IterateResult GeometryShaderIncompatibleDrawCallModeTest::iterate "layout (lines_adjacency) in;\n" "layout (points, max_vertices = 1) out;\n" "\n" - "${IN_PER_VERTEX_DECL}" + "${IN_PER_VERTEX_DECL_ARRAY}" "\n" "void main()\n" "{\n" @@ -3073,7 +3073,7 @@ tcu::TestNode::IterateResult GeometryShaderIncompatibleDrawCallModeTest::iterate "layout (triangles) in;\n" "layout (points, max_vertices = 1) out;\n" "\n" - "${IN_PER_VERTEX_DECL}" + "${IN_PER_VERTEX_DECL_ARRAY}" "\n" "void main()\n" "{\n" @@ -3087,7 +3087,7 @@ tcu::TestNode::IterateResult GeometryShaderIncompatibleDrawCallModeTest::iterate "layout (triangles_adjacency) in;\n" "layout (points, max_vertices = 1) out;\n" "\n" - "${IN_PER_VERTEX_DECL}" + "${IN_PER_VERTEX_DECL_ARRAY}" "\n" "void main()\n" "{\n" @@ -3466,7 +3466,7 @@ tcu::TestNode::IterateResult GeometryShaderInsufficientEmittedVerticesTest::iter "layout (points) in;\n" "layout (line_strip, max_vertices = 2) out;\n" "\n" - "${IN_PER_VERTEX_DECL}" + "${IN_PER_VERTEX_DECL_ARRAY}" "\n" "void main()\n" "{\n" @@ -3481,7 +3481,7 @@ tcu::TestNode::IterateResult GeometryShaderInsufficientEmittedVerticesTest::iter "layout (points) in;\n" "layout (triangle_strip, max_vertices = 3) out;\n" "\n" - "${IN_PER_VERTEX_DECL}" + "${IN_PER_VERTEX_DECL_ARRAY}" "\n" "void main()\n" "{\n" @@ -3716,6 +3716,8 @@ tcu::TestNode::IterateResult GeometryShaderPipelineObjectTransformFeedbackVertex const char* gs_code = "${VERSION}\n" "${GEOMETRY_SHADER_REQUIRE}\n" + "${IN_PER_VERTEX_DECL_ARRAY}\n" + "${OUT_PER_VERTEX_DECL}\n" "\n" "layout (points) in;\n" "layout (points, max_vertices = 1) out;\n" @@ -3734,6 +3736,7 @@ tcu::TestNode::IterateResult GeometryShaderPipelineObjectTransformFeedbackVertex /* Define Vertex Shader for purpose of this test. */ const char* vs_code = "${VERSION}\n" + "${OUT_PER_VERTEX_DECL}\n" "\n" "flat out ivec4 out_vs_1;\n" "flat out int vertexID;\n" diff --git a/external/openglcts/modules/glesext/tessellation_shader/esextcTessellationShaderTCTE.cpp b/external/openglcts/modules/glesext/tessellation_shader/esextcTessellationShaderTCTE.cpp index 968a4b9..53d62aa 100644 --- a/external/openglcts/modules/glesext/tessellation_shader/esextcTessellationShaderTCTE.cpp +++ b/external/openglcts/modules/glesext/tessellation_shader/esextcTessellationShaderTCTE.cpp @@ -1993,13 +1993,13 @@ std::string TessellationShaderTCTEgl_MaxPatchVertices_Position_PointSize::getTes "\n"; if (should_pass_pointsize_data) { - result_code << "${IN_PER_VERTEX_DECL_POINT_SIZE}"; - result_code << "${OUT_PER_VERTEX_DECL_POINT_SIZE}"; + result_code << "${IN_PER_VERTEX_DECL_ARRAY_POINT_SIZE}"; + result_code << "${OUT_PER_VERTEX_DECL_ARRAY_POINT_SIZE}"; } else { - result_code << "${IN_PER_VERTEX_DECL}"; - result_code << "${OUT_PER_VERTEX_DECL}"; + result_code << "${IN_PER_VERTEX_DECL_ARRAY}"; + result_code << "${OUT_PER_VERTEX_DECL_ARRAY}"; } result_code << "out OUT_TC\n" "{\n" @@ -2079,12 +2079,12 @@ std::string TessellationShaderTCTEgl_MaxPatchVertices_Position_PointSize::getTes "\n"; if (should_pass_pointsize_data) { - result_sstream << "${IN_PER_VERTEX_DECL_POINT_SIZE}"; + result_sstream << "${IN_PER_VERTEX_DECL_ARRAY_POINT_SIZE}"; result_sstream << "${OUT_PER_VERTEX_DECL_POINT_SIZE}"; } else { - result_sstream << "${IN_PER_VERTEX_DECL}"; + result_sstream << "${IN_PER_VERTEX_DECL_ARRAY}"; result_sstream << "${OUT_PER_VERTEX_DECL}"; } result_sstream << "in OUT_TC\n" diff --git a/external/openglcts/modules/glesext/tessellation_shader/esextcTessellationShaderXFB.cpp b/external/openglcts/modules/glesext/tessellation_shader/esextcTessellationShaderXFB.cpp index 6f82f8f..b40241b 100644 --- a/external/openglcts/modules/glesext/tessellation_shader/esextcTessellationShaderXFB.cpp +++ b/external/openglcts/modules/glesext/tessellation_shader/esextcTessellationShaderXFB.cpp @@ -320,7 +320,7 @@ void TessellationShaderXFB::initTest() "layout(points, max_vertices = 1) out;\n" "\n" "precision highp float;\n" - "${IN_PER_VERTEX_DECL}" + "${IN_PER_VERTEX_DECL_ARRAY}" "${OUT_PER_VERTEX_DECL}" "in BLOCK_INOUT { vec4 value; } user_in[];\n" "out BLOCK_INOUT { vec4 value; } user_out;\n" @@ -365,8 +365,8 @@ void TessellationShaderXFB::initTest() "layout (vertices=4) out;\n" "\n" "precision highp float;\n" - "${IN_PER_VERTEX_DECL}" - "${OUT_PER_VERTEX_TCS_DECL}" + "${IN_PER_VERTEX_DECL_ARRAY}" + "${OUT_PER_VERTEX_DECL_ARRAY}" "in BLOCK_INOUT { vec4 value; } user_in[];\n" "out BLOCK_INOUT { vec4 value; } user_out[];\n" "\n" @@ -438,7 +438,7 @@ void TessellationShaderXFB::initTest() "layout (isolines, point_mode) in;\n" "\n" "precision highp float;\n" - "${IN_PER_VERTEX_DECL}" + "${IN_PER_VERTEX_DECL_ARRAY}" "${OUT_PER_VERTEX_DECL}" "in BLOCK_INOUT { vec4 value; } user_in[];\n" "out BLOCK_INOUT { vec4 value; } user_out;\n" -- 2.7.4