summaryrefslogtreecommitdiffstats
path: root/src/mesa/slang/slang_link.c
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2010-07-07 16:41:01 -0400
committerZack Rusin <[email protected]>2010-07-08 00:28:29 -0400
commitf11e25ee957549ab867fac4f17a5c61fd9172794 (patch)
tree91743f66faed4bb398ebad70c7b2a5ebafc9b2dc /src/mesa/slang/slang_link.c
parent7c42390453e611367cf1ba11446692ec04e0abfb (diff)
slang: add some comments related to geometry shaders
Diffstat (limited to 'src/mesa/slang/slang_link.c')
-rw-r--r--src/mesa/slang/slang_link.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/slang/slang_link.c b/src/mesa/slang/slang_link.c
index c89ab8b9f66..bc2bd31fda5 100644
--- a/src/mesa/slang/slang_link.c
+++ b/src/mesa/slang/slang_link.c
@@ -810,6 +810,12 @@ remove_extra_version_directives(GLchar *source)
}
}
+/* 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)
{
@@ -865,6 +871,8 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType)
return NULL;
}
+ /* Geometry shader will inject definition of
+ * const int gl_VerticesIn */
if (shaderType == GL_GEOMETRY_SHADER_ARB) {
totalLen += 32;
}
@@ -883,6 +891,10 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType)
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);