From: Ian Romanick Date: Sun, 2 Dec 2012 22:24:31 +0000 (-0800) Subject: mesa: Emit errors for geometry shader enums when ARB_gs4 is not supported X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e2e670007a31f2dcdf5f260bc2f902701ee6a0a;p=mesa.git mesa: Emit errors for geometry shader enums when ARB_gs4 is not supported Signed-off-by: Ian Romanick Reviewed-by: Kenneth Graunke --- 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