[Mesa-dev] [PATCH 2/3] r600g: uniform buffer object support

Dave Airlie airlied at gmail.com
Fri Jan 11 14:37:58 PST 2013


On Sat, Jan 12, 2013 at 6:34 AM, Ian Romanick <idr at freedesktop.org> wrote:
> On 01/11/2013 04:38 AM, Dave Airlie wrote:
>>
>> From: Dave Airlie <airlied at redhat.com>
>>
>> This adds 12 more constant buffers for use as UBOs,
>> along with adding relative constant fetching for 2D indices.
>>
>> This with GLSL 1.40 enabled passes all the same tests as softpipe
>> on my evergreen system.
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>>   src/gallium/drivers/r600/r600_pipe.h   |  2 +-
>>   src/gallium/drivers/r600/r600_shader.c | 56
>> +++++++++++++++++++++++++++++-----
>>   2 files changed, 49 insertions(+), 9 deletions(-)
>>
>> diff --git a/src/gallium/drivers/r600/r600_pipe.h
>> b/src/gallium/drivers/r600/r600_pipe.h
>> index 5d22c93..2dcb473 100644
>> --- a/src/gallium/drivers/r600/r600_pipe.h
>> +++ b/src/gallium/drivers/r600/r600_pipe.h
>> @@ -39,7 +39,7 @@
>>
>>   #define R600_TRACE_CS 0
>>
>> -#define R600_MAX_USER_CONST_BUFFERS 1
>> +#define R600_MAX_USER_CONST_BUFFERS 13
>
>
> Two questions...
>
> Is 13 the correct number, and what value does this cause to be exposed for
> GL_MAX_*_UNIFORM_BLOCKS?  I suspect it was 1 before to hold non-block
> uniforms in some cases.  Or something else?

Yup we have one for non-ubo constants, and 12 for UBOs, the state
tracker works out which is which.

>
> Is this value per-stage or total?  You're supposed to expose at least 12
> per-stage and 12*num_stages total.  Since I think we have a min-max test for
> this, I'll guess that it does the right thing...

And yes they are per shader stage.

All pushed now, r600 on all suppported hw is at GL 3.1 now.

Dave.


More information about the mesa-dev mailing list