aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-08-19 09:03:18 +0200
committermarha <marha@users.sourceforge.net>2013-08-19 09:03:18 +0200
commit854ec4da20ddff9b830be0a7d5b81d8cb4774132 (patch)
tree223425d84b5ea3727f74546c92dee8b03c074158 /mesalib/src/mesa/main/api_validate.c
parent0659c77949b38440a2a9ba67e1ee9cacef1f3a7f (diff)
downloadvcxsrv-854ec4da20ddff9b830be0a7d5b81d8cb4774132.tar.gz
vcxsrv-854ec4da20ddff9b830be0a7d5b81d8cb4774132.tar.bz2
vcxsrv-854ec4da20ddff9b830be0a7d5b81d8cb4774132.zip
fontconfig libX11 libXdmcp libxcb xkeyboard-config mesa pixman xserver git update 19 aug 2013
xserver commit fe7463b8ce0de301c2f82b108c93963424f77219 libxcb commit 5648ddd2b97068f549268284129a438a6845e14c libxcb/xcb-proto commit 56a82005ac388fcb7a4d1c82e07c7e72eaf69a32 xkeyboard-config commit 87c865aee1844b2cc6b1a5a208116dd095f4d76a libX11 commit 9b291044a240e5b9b031ed814e0c84e53a1c3084 libXdmcp commit 66514a4af7eaa47e8718434356d7efce95e570cf libXext commit 7378d4bdbd33ed49ed6cfa5c4f73d7527982aab4 libfontenc commit 3acba630d8b57084f7e92c15732408711ed5137a libXinerama commit 6e1d1dc328ba8162bba2f4694e7f3c706a1491ff libXau commit 899790011304c4029e15abf410e49ce7cec17e0a xkbcomp commit 0ebdf47fd4bc434ac3d2339544c022a869510738 pixman commit 3518a0dafa63098d41e466f73d105b7e3e4b12de xextproto commit f27fcc99d1cf935cc289933326f7d3baacd5107a randrproto commit ca7cc541c2e43e6c784df19b4583ac35829d2f72 glproto commit 8e3407e02980d088e20041e79bdcdd3737e7827e mkfontscale commit f48de13423c7300f4da9f61993b624426b38ddc0 xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13 libXft commit c5e760a239afc62a1c75e0509868e35957c8df52 libXmu commit d5dac08d65c4865f311cb62c161dbb1300eecd11 libxtrans commit f6a161f2a003f4da0a2e414b4faa0ee0de0c01f0 fontconfig commit 084cf7c44e985dd48c088d921ad0d9a43b0b00b4 mesa commit d13003f544417db6de44c65a0c118bd2b189458a
Diffstat (limited to 'mesalib/src/mesa/main/api_validate.c')
-rw-r--r--mesalib/src/mesa/main/api_validate.c70
1 files changed, 69 insertions, 1 deletions
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c
index 7ab8e305d..243bb89d1 100644
--- a/mesalib/src/mesa/main/api_validate.c
+++ b/mesalib/src/mesa/main/api_validate.c
@@ -222,7 +222,7 @@ _mesa_is_valid_prim_mode(struct gl_context *ctx, GLenum mode)
case GL_LINE_STRIP_ADJACENCY:
case GL_TRIANGLES_ADJACENCY:
case GL_TRIANGLE_STRIP_ADJACENCY:
- return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_geometry_shader4;
+ return _mesa_has_geometry_shaders(ctx);
default:
return false;
}
@@ -245,6 +245,74 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name)
return GL_FALSE;
}
+ /* From the ARB_geometry_shader4 spec:
+ *
+ * The error INVALID_OPERATION is generated if Begin, or any command that
+ * implicitly calls Begin, is called when a geometry shader is active and:
+ *
+ * * the input primitive type of the current geometry shader is
+ * POINTS and <mode> is not POINTS,
+ *
+ * * the input primitive type of the current geometry shader is
+ * LINES and <mode> is not LINES, LINE_STRIP, or LINE_LOOP,
+ *
+ * * the input primitive type of the current geometry shader is
+ * TRIANGLES and <mode> is not TRIANGLES, TRIANGLE_STRIP or
+ * TRIANGLE_FAN,
+ *
+ * * the input primitive type of the current geometry shader is
+ * LINES_ADJACENCY_ARB and <mode> is not LINES_ADJACENCY_ARB or
+ * LINE_STRIP_ADJACENCY_ARB, or
+ *
+ * * the input primitive type of the current geometry shader is
+ * TRIANGLES_ADJACENCY_ARB and <mode> is not
+ * TRIANGLES_ADJACENCY_ARB or TRIANGLE_STRIP_ADJACENCY_ARB.
+ *
+ */
+ if (ctx->Shader.CurrentGeometryProgram) {
+ const GLenum geom_mode =
+ ctx->Shader.CurrentGeometryProgram->Geom.InputType;
+ switch (mode) {
+ case GL_POINTS:
+ valid_enum = (geom_mode == GL_POINTS);
+ break;
+ case GL_LINES:
+ case GL_LINE_LOOP:
+ case GL_LINE_STRIP:
+ valid_enum = (geom_mode == GL_LINES);
+ break;
+ case GL_TRIANGLES:
+ case GL_TRIANGLE_STRIP:
+ case GL_TRIANGLE_FAN:
+ valid_enum = (geom_mode == GL_TRIANGLES);
+ break;
+ case GL_QUADS:
+ case GL_QUAD_STRIP:
+ case GL_POLYGON:
+ valid_enum = false;
+ break;
+ case GL_LINES_ADJACENCY:
+ case GL_LINE_STRIP_ADJACENCY:
+ valid_enum = (geom_mode == GL_LINES_ADJACENCY);
+ break;
+ case GL_TRIANGLES_ADJACENCY:
+ case GL_TRIANGLE_STRIP_ADJACENCY:
+ valid_enum = (geom_mode == GL_TRIANGLES_ADJACENCY);
+ break;
+ default:
+ valid_enum = false;
+ break;
+ }
+ if (!valid_enum) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(mode=%s vs geometry shader input %s)",
+ name,
+ _mesa_lookup_prim_by_nr(mode),
+ _mesa_lookup_prim_by_nr(geom_mode));
+ return GL_FALSE;
+ }
+ }
+
/* From the GL_EXT_transform_feedback spec:
*
* "The error INVALID_OPERATION is generated if Begin, or any command