[Mesa-dev] [PATCH 10/12] mesa: Delay display list save dispatch setup until Exec is set up.

Eric Anholt eric at anholt.net
Mon Jan 21 14:10:29 PST 2013


Ian Romanick <idr at freedesktop.org> writes:

> On 01/18/2013 02:30 PM, Eric Anholt wrote:
>> This will let us copy from the Exec dispatch to deal with our commands that
>> don't get compiled into display lists.
>> ---
>>   src/mesa/main/context.c |    5 ++++-
>>   src/mesa/main/dlist.c   |   12 +++---------
>>   src/mesa/main/dlist.h   |    2 +-
>>   3 files changed, 8 insertions(+), 11 deletions(-)
>>
>> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
>> index d583f98..6861893 100644
>> --- a/src/mesa/main/context.c
>> +++ b/src/mesa/main/context.c
>> @@ -912,6 +912,9 @@ _mesa_initialize_dispatch_tables(struct gl_context *ctx)
>>   {
>>      /* Do the code-generated setup of the exec table in api_exec.c. */
>>      _mesa_initialize_exec_table(ctx);
>> +
>> +   if (ctx->Save)
>> +      _mesa_initialize_save_table(ctx);
>>   }
>>
>>   /**
>> @@ -1018,7 +1021,7 @@ _mesa_initialize_context(struct gl_context *ctx,
>>      switch (ctx->API) {
>>      case API_OPENGL_COMPAT:
>>         ctx->BeginEnd = create_beginend_table(ctx);
>> -      ctx->Save = _mesa_create_save_table(ctx);
>> +      ctx->Save = _mesa_alloc_dispatch_table();
>>         if (!ctx->BeginEnd || !ctx->Save)
>>            goto fail;
>>
>> diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
>> index 7eb2cb2..06c44b9 100644
>> --- a/src/mesa/main/dlist.c
>> +++ b/src/mesa/main/dlist.c
>> @@ -9566,14 +9566,10 @@ exec_MultiModeDrawElementsIBM(const GLenum * mode,
>>    * initialized from _mesa_init_api_defaults and from the active vtxfmt
>>    * struct.
>>    */
>> -struct _glapi_table *
>> -_mesa_create_save_table(const struct gl_context *ctx)
>> +void
>> +_mesa_initialize_save_table(const struct gl_context *ctx)
>>   {
>> -   struct _glapi_table *table;
>> -
>> -   table = _mesa_alloc_dispatch_table();
>> -   if (table == NULL)
>> -      return NULL;
>> +   struct _glapi_table *table = ctx->Save;
>
> The compiler doesn't emit an error or a warning here for dropping const?

There's no const being dropped, since ctx->Save is a non-const pointer.
-------------- 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/20130121/a1c70b28/attachment.pgp>


More information about the mesa-dev mailing list