summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-12-02 14:24:31 -0800
committerIan Romanick <[email protected]>2013-01-11 18:13:53 -0800
commit8e2e670007a31f2dcdf5f260bc2f902701ee6a0a (patch)
treecea9e1f498f44fe3cf41e657da27dc23fc56bc8b
parente3f273e2f4ac9df5f5e6939fef103accdc71ea91 (diff)
mesa: Emit errors for geometry shader enums when ARB_gs4 is not supported
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/main/shaderapi.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index bf738b94185..b921be3b24e 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1571,6 +1571,9 @@ _mesa_ProgramParameteri(GLuint program, GLenum pname, GLint value)
switch (pname) {
case GL_GEOMETRY_VERTICES_OUT_ARB:
+ if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_geometry_shader4)
+ break;
+
if (value < 1 ||
(unsigned) value > ctx->Const.MaxGeometryOutputVertices) {
_mesa_error(ctx, GL_INVALID_VALUE,
@@ -1579,8 +1582,11 @@ _mesa_ProgramParameteri(GLuint program, GLenum pname, GLint value)
return;
}
shProg->Geom.VerticesOut = value;
- break;
+ return;
case GL_GEOMETRY_INPUT_TYPE_ARB:
+ if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_geometry_shader4)
+ break;
+
switch (value) {
case GL_POINTS:
case GL_LINES:
@@ -1595,8 +1601,11 @@ _mesa_ProgramParameteri(GLuint program, GLenum pname, GLint value)
_mesa_lookup_enum_by_nr(value));
return;
}
- break;
+ return;
case GL_GEOMETRY_OUTPUT_TYPE_ARB:
+ if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_geometry_shader4)
+ break;
+
switch (value) {
case GL_POINTS:
case GL_LINE_STRIP:
@@ -1609,12 +1618,13 @@ _mesa_ProgramParameteri(GLuint program, GLenum pname, GLint value)
_mesa_lookup_enum_by_nr(value));
return;
}
- break;
+ return;
default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameteri(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
break;
}
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameteri(pname=%s)",
+ _mesa_lookup_enum_by_nr(pname));
}
void