slang_variable *var = _slang_variable_locate(oper->locals, name, GL_TRUE);
slang_ir_node *n;
if (!var || !var->declared) {
+ /* Geometry shader set gl_VerticesIn at link time
+ * so we need to way with resolving this variable
+ * until then */
if (A->program->Target == MESA_GEOMETRY_PROGRAM &&
!strcmp((char*)name, "gl_VerticesIn") ){
A->UnresolvedRefs = GL_TRUE;
}
}
+/* Returns the number of vertices per geometry shader
+ * input primitive.
+ * XXX: duplicated in Gallium in u_vertices_per_prim
+ * method. Once Mesa core will start using Gallium
+ * this should be removed
+ */
static int
vertices_per_prim(int prim)
{
return NULL;
}
+ /* Geometry shader will inject definition of
+ * const int gl_VerticesIn */
if (shaderType == GL_GEOMETRY_SHADER_ARB) {
totalLen += 32;
}
len += shaderLengths[i];
}
}
+ /* if it's geometry shader we need to inject definition
+ * of "const int gl_VerticesIn = X;" where X is the number
+ * of vertices per input primitive
+ */
if (shaderType == GL_GEOMETRY_SHADER_ARB) {
GLchar gs_pre[32];
GLuint num_verts = vertices_per_prim(shProg->Geom.InputType);