} else {
shader->Geom.OutputType = PRIM_UNKNOWN;
}
+
+ shader->Geom.Invocations = 0;
+ if (state->in_qualifier->flags.q.invocations)
+ shader->Geom.Invocations = state->in_qualifier->invocations;
break;
case MESA_SHADER_COMPUTE:
unsigned num_shaders)
{
linked_shader->Geom.VerticesOut = 0;
+ linked_shader->Geom.Invocations = 0;
linked_shader->Geom.InputType = PRIM_UNKNOWN;
linked_shader->Geom.OutputType = PRIM_UNKNOWN;
}
linked_shader->Geom.VerticesOut = shader->Geom.VerticesOut;
}
+
+ if (shader->Geom.Invocations != 0) {
+ if (linked_shader->Geom.Invocations != 0 &&
+ linked_shader->Geom.Invocations != shader->Geom.Invocations) {
+ linker_error(prog, "geometry shader defined with conflicting "
+ "invocation count (%d and %d)\n",
+ linked_shader->Geom.Invocations,
+ shader->Geom.Invocations);
+ return;
+ }
+ linked_shader->Geom.Invocations = shader->Geom.Invocations;
+ }
}
/* Just do the intrastage -> interstage propagation right now,
return;
}
prog->Geom.VerticesOut = linked_shader->Geom.VerticesOut;
+
+ if (linked_shader->Geom.Invocations == 0)
+ linked_shader->Geom.Invocations = 1;
+
+ prog->Geom.Invocations = linked_shader->Geom.Invocations;
}
*/
struct {
GLint VerticesOut;
+ /**
+ * 0 - Invocations count not declared in shader, or
+ * 1 .. MAX_GEOMETRY_SHADER_INVOCATIONS
+ */
+ GLint Invocations;
/**
* GL_POINTS, GL_LINES, GL_LINES_ADJACENCY, GL_TRIANGLES, or
* GL_TRIANGLES_ADJACENCY, or PRIM_UNKNOWN if it's not set in this
struct {
GLint VerticesIn;
GLint VerticesOut;
+ /**
+ * 1 .. MAX_GEOMETRY_SHADER_INVOCATIONS
+ */
+ GLint Invocations;
GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB,
GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */
GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */