Skip to content

Commit

Permalink
Merge pull request #1524 from chaoc/master
Browse files Browse the repository at this point in the history
Fix inferred output primitive for GL_NV_geometry_shader_passthrough
  • Loading branch information
johnkslang authored Oct 5, 2018
2 parents 2f78b9c + 07ef0e4 commit 732623e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions Test/baseResults/spv.GeometryShaderPassthrough.geom.out
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion glslang/MachineIndependent/ParseHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
12 changes: 2 additions & 10 deletions glslang/MachineIndependent/linkValidate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 732623e

Please sign in to comment.