[Mesa-dev] [PATCH 00/10] glUniform* micro-optimizations, part 1

Ian Romanick idr at freedesktop.org
Tue Nov 4 16:15:31 PST 2014


On 11/03/2014 04:36 PM, Brian Paul wrote:
> On 11/03/2014 05:22 PM, Ian Romanick wrote:
>> This is the first, and more minor, batch of micro-optimizations for the
>> glUniform* paths.  Other than patch 8, these probably aren't going to
>> make a lot of difference, even on CPU limited applications.
>>
>> The next batch, which needs a bit more time to finish baking, should
>> have some more substantial improvements.
>>
>>   src/glsl/glsl_types.h           |  18 +--
>>   src/mesa/main/uniform_query.cpp | 260
>> +++++++++++++++-------------------------
>>   src/mesa/main/uniforms.c        |  96 +++++++--------
>>   src/mesa/main/uniforms.h        |   4 +-
>>   4 files changed, 157 insertions(+), 221 deletions(-)
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=AAIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=5QAghgTf_gj0id9SlxNAbec1i9mOp1WieQvnUV_AVJU&s=XN6_VuComU2g5HPG-z2STToQO5WoLmqWCV1gNGMuUGc&e=
>>
>>
> 
> Looks good to me.
> 
> Reviewed-by: Brian Paul <brianp at vmware.com>
> 
> BTW, in _mesa_uniform() we have two instances of:
> 
>    if (uni->type->is_sampler()) {
>       ...
>    }
> 
>    if (uni->type->is_image()) {
>       ...
>    
> 
> I believe the second 'if' could be 'else if'
> 
> Probably no real savings, but it would read better.

One of them goes away (is replace with a switch-statement) in the
remainder of the series, and I'll go ahead a fuse the other.

> -Brian



More information about the mesa-dev mailing list