On Tue, Sep 20, 2011 at 08:30:07PM -0600, Brian Paul wrote: > On Tue, Sep 20, 2011 at 7:54 PM, Yuanhan Liu > <yuanhan....@linux.intel.com> wrote: > > On Tue, Sep 20, 2011 at 08:51:45AM -0600, Brian Paul wrote: > >> From: Brian Paul <bri...@vmware.com> > >> > >> 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. > > >> + > >> /** > >> * Called via glBegin. > >> */ > >> @@ -563,6 +565,11 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) > >> struct vbo_exec_context *exec = &vbo_context(ctx)->exec; > >> int i; > >> > >> + if (!_mesa_valid_prim_mode(ctx, mode)) { > >> + _mesa_error(ctx, GL_INVALID_ENUM, "glBegin"); > >> + return; > >> + } > >> + > > > > Sorry, shouldn't we add the mode validation after the if(ctx->NewState) > > code block to make sure the previous states are updated? > > It really doesn't matter. If there's dirty state it'll get checked in > the next GL call. > We typically put the error checking code before everything else in the > GL functions.
Got it. Then Reviewed-by: Yuanhan Liu <yuanhan....@linux.intel.com> _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev