[Mesa-dev] [PATCH 05/12] mesa: Install a minimal dispatch table during glBegin()/glEnd().
Eric Anholt
eric at anholt.net
Fri Jan 18 16:15:57 PST 2013
Brian Paul <brianp at vmware.com> writes:
> On 01/18/2013 03:30 PM, Eric Anholt wrote:
>> This is a step toward getting rid of ASSERT_OUTSIDE_BEGIN_END() in Mesa.
>> diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
>> index 84bcdd6..f987439 100644
>> --- a/src/mesa/vbo/vbo_exec_api.c
>> +++ b/src/mesa/vbo/vbo_exec_api.c
>> @@ -833,6 +833,17 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
>> exec->vtx.prim[i].base_instance = 0;
>>
>> ctx->Driver.CurrentExecPrimitive = mode;
>> +
>> + ctx->Exec = ctx->BeginEnd;
>> + /* We may have been called from a display list, in which case we should
>> + * leave dlist.c's dispatch table in place.
>> + */
>> + if (ctx->CurrentDispatch == ctx->OutsideBeginEnd) {
>> + ctx->CurrentDispatch = ctx->BeginEnd;
>> + _glapi_set_dispatch(ctx->CurrentDispatch);
>> + } else {
>> + assert(ctx->CurrentDispatch == ctx->Save);
>> + }
>
> If someone did this (in immediate mode):
>
> glBegin(mode);
> glBegin(mode);
>
> wouldn't the assert in the else clause fail? I think we'd want check
> for that before the assertion and raise GL_INVALID_OPERATION there.
> I'd have to test to be sure though.
This would already be caught by the early-exit for CurrentExecPrimitive
!= PRIM_OUTSIDE_BEGIN_END. (it's also covered by the piglit test)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130118/72de94bc/attachment.pgp>
More information about the mesa-dev
mailing list