From 07ef0e4c844a682fc32abddabb9bf63a106493ad Mon Sep 17 00:00:00 2001 From: Chao Chen Date: Thu, 4 Oct 2018 18:39:27 -0700 Subject: [PATCH] For GL_NV_geometry_shader_passthrough extension, the Inferred output primitive for ElgTriangles should be ElgTriangleStrip. Also removed unnecessary relax for GL_NV_geometry_shader_passthrough in link validate --- Test/baseResults/spv.GeometryShaderPassthrough.geom.out | 1 + glslang/MachineIndependent/ParseHelper.cpp | 2 +- glslang/MachineIndependent/linkValidate.cpp | 12 ++---------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Test/baseResults/spv.GeometryShaderPassthrough.geom.out b/Test/baseResults/spv.GeometryShaderPassthrough.geom.out index 015bd0f..5db845e 100644 --- a/Test/baseResults/spv.GeometryShaderPassthrough.geom.out +++ b/Test/baseResults/spv.GeometryShaderPassthrough.geom.out @@ -11,6 +11,7 @@ spv.GeometryShaderPassthrough.geom EntryPoint Geometry 4 "main" 10 14 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip ExecutionMode 4 OutputVertices 3 Source GLSL 450 SourceExtension "GL_NV_geometry_shader_passthrough" diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 40c5674..df29560 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -4487,7 +4487,7 @@ void TParseContext::finish() switch (intermediate.getInputPrimitive()) { case ElgPoints: intermediate.setOutputPrimitive(ElgPoints); break; case ElgLines: intermediate.setOutputPrimitive(ElgLineStrip); break; - case ElgTriangles: intermediate.setOutputPrimitive(ElgTriangles); break; + case ElgTriangles: intermediate.setOutputPrimitive(ElgTriangleStrip); break; default: break; } } diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 7ce7cdd..566d563 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -689,17 +689,9 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) case EShLangGeometry: if (inputPrimitive == ElgNone) error(infoSink, "At least one shader must specify an input layout primitive"); - if (outputPrimitive == ElgNone -#ifdef NV_EXTENSIONS - && !getGeoPassthroughEXT() -#endif - ) + if (outputPrimitive == ElgNone) error(infoSink, "At least one shader must specify an output layout primitive"); - if (vertices == TQualifier::layoutNotSet -#ifdef NV_EXTENSIONS - && !getGeoPassthroughEXT() -#endif - ) + if (vertices == TQualifier::layoutNotSet) error(infoSink, "At least one shader must specify a layout(max_vertices = value)"); break; case EShLangFragment: -- 2.7.4