aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/dlist.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-09-21 08:22:07 -0600
committerBrian Paul <[email protected]>2011-09-21 08:22:07 -0600
commit0e6646db3248057b7750031d825535cd7a0e5aec (patch)
tree25fc910e905a30d3b7c0d04c84e71305a6e76ca9 /src/mesa/main/dlist.c
parent51002968c97758c30511eefab1bd1358b8380e15 (diff)
mesa: check glBegin()/glDrawArrays()/etc mode with _mesa_valid_prim_mode()
We now raise an GL_INVALID_ENUM in glBegin() if mode is illegal, as was done in Yuanhan Liu's original patch. Take geometry shaders support into account too. Reviewed-by: Yuanhan Liu <[email protected]>
Diffstat (limited to 'src/mesa/main/dlist.c')
-rw-r--r--src/mesa/main/dlist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 9bba52129eb..f11dae9d07b 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -34,6 +34,7 @@
#include "api_arrayelt.h"
#include "api_exec.h"
#include "api_loopback.h"
+#include "api_validate.h"
#if FEATURE_ATI_fragment_shader
#include "atifragshader.h"
#endif
@@ -5762,8 +5763,8 @@ save_Begin(GLenum mode)
Node *n;
GLboolean error = GL_FALSE;
- if ( /*mode < GL_POINTS || */ mode > GL_POLYGON) {
- _mesa_compile_error(ctx, GL_INVALID_ENUM, "Begin (mode)");
+ if (!_mesa_valid_prim_mode(ctx, mode)) {
+ _mesa_compile_error(ctx, GL_INVALID_ENUM, "glBegin(mode)");
error = GL_TRUE;
}
else if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN) {