[Mesa-dev] [PATCH 15/22] mesa: Add support for glUniformBlockBinding() in display lists.

Eric Anholt eric at anholt.net
Mon Aug 6 18:02:54 PDT 2012


Brian Paul <brianp at vmware.com> writes:

> On 07/31/2012 04:01 PM, Eric Anholt wrote:
>> Fixes piglit GL_ARB_uniform_buffer_object/dlist.
>> ---
>>   src/mesa/main/dlist.c |   27 +++++++++++++++++++++++++++
>>   1 file changed, 27 insertions(+)
>>
>> diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
>> index 510fd1e..e3dc9c0 100644
>> --- a/src/mesa/main/dlist.c
>> +++ b/src/mesa/main/dlist.c
>> @@ -482,6 +482,9 @@ typedef enum
>>      OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED,
>>      OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED,
>>
>> +   /* ARB_uniform_buffer_object */
>> +   OPCODE_UNIFORM_BLOCK_BINDING,
>> +
>>      /* The following three are meta instructions */
>>      OPCODE_ERROR,                /* raise compiled-in error */
>>      OPCODE_CONTINUE,
>> @@ -7582,6 +7585,23 @@ save_EndConditionalRender(void)
>>      }
>>   }
>>
>> +static void GLAPIENTRY
>> +save_UniformBlockBinding(GLuint prog, GLuint index, GLuint binding)
>> +{
>> +   GET_CURRENT_CONTEXT(ctx);
>> +   Node *n;
>> +   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
>> +   n = alloc_instruction(ctx, OPCODE_UNIFORM_BLOCK_BINDING, 3);
>> +   if (n) {
>> +      n[1].i = prog;
>> +      n[2].i = index;
>> +      n[3].i = binding;
>
> It won't make any real difference, but the 'i' fields should be 'ui' 
> for type consistency.
>
>
>> +   }
>> +   if (ctx->ExecuteFlag) {
>> +      CALL_UniformBlockBinding(ctx->Exec, (prog, index, binding));
>> +   }
>> +}
>> +
>>
>>   /**
>>    * Save an error-generating command into display list.
>> @@ -8877,6 +8897,10 @@ execute_list(struct gl_context *ctx, GLuint list)
>>               CALL_EndConditionalRenderNV(ctx->Exec, ());
>>               break;
>>
>> +         case OPCODE_UNIFORM_BLOCK_BINDING:
>> +            CALL_UniformBlockBinding(ctx->Exec, (n[1].i, n[2].i, n[3].i));
>
> s/i/ui/ here too.

Fixed, thanks!
-------------- 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/20120806/67d8b3be/attachment.pgp>


More information about the mesa-dev mailing list