Commit e891afac by John Kessenich

GLSL: Fix #1330: default outputs for GL_NV_geometry_shader_passthrough

parent 9de57c81
...@@ -11,7 +11,7 @@ spv.GeometryShaderPassthrough.geom ...@@ -11,7 +11,7 @@ spv.GeometryShaderPassthrough.geom
EntryPoint Geometry 4 "main" 10 14 EntryPoint Geometry 4 "main" 10 14
ExecutionMode 4 Triangles ExecutionMode 4 Triangles
ExecutionMode 4 Invocations 1 ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputVertices ExecutionMode 4 OutputVertices 3
Source GLSL 450 Source GLSL 450
SourceExtension "GL_NV_geometry_shader_passthrough" SourceExtension "GL_NV_geometry_shader_passthrough"
Name 4 "main" Name 4 "main"
......
...@@ -3977,6 +3977,26 @@ void TParseContext::finish() ...@@ -3977,6 +3977,26 @@ void TParseContext::finish()
default: default:
break; break;
} }
// Set default outputs for GL_NV_geometry_shader_passthrough
if (language == EShLangGeometry && extensionTurnedOn(E_SPV_NV_geometry_shader_passthrough)) {
if (intermediate.getOutputPrimitive() == ElgNone) {
switch (intermediate.getInputPrimitive()) {
case ElgPoints: intermediate.setOutputPrimitive(ElgPoints); break;
case ElgLines: intermediate.setOutputPrimitive(ElgLineStrip); break;
case ElgTriangles: intermediate.setOutputPrimitive(ElgTriangles); break;
default: break;
}
}
if (intermediate.getVertices() == TQualifier::layoutNotSet) {
switch (intermediate.getInputPrimitive()) {
case ElgPoints: intermediate.setVertices(1); break;
case ElgLines: intermediate.setVertices(2); break;
case ElgTriangles: intermediate.setVertices(3); break;
default: break;
}
}
}
} }
// //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment