aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-07-25 07:15:29 -0700
committerIan Romanick <[email protected]>2012-08-29 15:09:34 -0700
commit6a9b8f897a8b59fae03c73e05203bc708fb17793 (patch)
treeba0dfc7ae0dac051796d720885efc61fcad313b0 /src/mesa
parent72e076cb17e47c608fa6534641653cdc6133fb27 (diff)
mesa/es: Validate primitive modes in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering. Signed-off-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/APIspec.xml40
-rw-r--r--src/mesa/main/api_validate.c7
2 files changed, 5 insertions, 42 deletions
diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml
index 34e41b49e17..6df4b921d00 100644
--- a/src/mesa/main/APIspec.xml
+++ b/src/mesa/main/APIspec.xml
@@ -1196,16 +1196,6 @@
<param name="first" type="GLint"/>
<param name="count" type="GLsizei"/>
</proto>
-
- <desc name="mode">
- <value name="GL_POINTS"/>
- <value name="GL_LINES"/>
- <value name="GL_LINE_LOOP"/>
- <value name="GL_LINE_STRIP"/>
- <value name="GL_TRIANGLES"/>
- <value name="GL_TRIANGLE_STRIP"/>
- <value name="GL_TRIANGLE_FAN"/>
- </desc>
</template>
<template name="DrawElements">
@@ -1216,16 +1206,6 @@
<param name="type" type="GLenum"/>
<param name="indices" type="const GLvoid *"/>
</proto>
-
- <desc name="mode">
- <value name="GL_POINTS"/>
- <value name="GL_LINES"/>
- <value name="GL_LINE_LOOP"/>
- <value name="GL_LINE_STRIP"/>
- <value name="GL_TRIANGLES"/>
- <value name="GL_TRIANGLE_STRIP"/>
- <value name="GL_TRIANGLE_FAN"/>
- </desc>
</template>
<template name="EnableClientState">
@@ -2179,16 +2159,6 @@
<param name="count" type="const GLsizei *"/>
<param name="primcount" type="GLsizei"/>
</proto>
-
- <desc name="mode">
- <value name="GL_POINTS"/>
- <value name="GL_LINES"/>
- <value name="GL_LINE_LOOP"/>
- <value name="GL_LINE_STRIP"/>
- <value name="GL_TRIANGLES"/>
- <value name="GL_TRIANGLE_STRIP"/>
- <value name="GL_TRIANGLE_FAN"/>
- </desc>
</template>
<template name="MultiDrawElements">
@@ -2200,16 +2170,6 @@
<param name="indices" type="const GLvoid **"/>
<param name="primcount" type="GLsizei"/>
</proto>
-
- <desc name="mode">
- <value name="GL_POINTS"/>
- <value name="GL_LINES"/>
- <value name="GL_LINE_LOOP"/>
- <value name="GL_LINE_STRIP"/>
- <value name="GL_TRIANGLES"/>
- <value name="GL_TRIANGLE_STRIP"/>
- <value name="GL_TRIANGLE_FAN"/>
- </desc>
</template>
<template name="EGLImageTargetTexture2D">
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 362cdf50e7e..d0d2ca4d451 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -220,16 +220,19 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name)
case GL_TRIANGLES:
case GL_TRIANGLE_STRIP:
case GL_TRIANGLE_FAN:
+ valid_enum = true;
+ break;
case GL_QUADS:
case GL_QUAD_STRIP:
case GL_POLYGON:
- valid_enum = true;
+ valid_enum = (ctx->API == API_OPENGL);
break;
case GL_LINES_ADJACENCY:
case GL_LINE_STRIP_ADJACENCY:
case GL_TRIANGLES_ADJACENCY:
case GL_TRIANGLE_STRIP_ADJACENCY:
- valid_enum = (ctx->Extensions.ARB_geometry_shader4);
+ valid_enum = _mesa_is_desktop_gl(ctx)
+ && ctx->Extensions.ARB_geometry_shader4;
break;
default:
valid_enum = false;