[Mesa-dev] [PATCH 2/5] i965: Use native integer uniforms when the new VS backend is in use.

Kenneth Graunke kenneth at whitecape.org
Fri Aug 19 23:52:04 PDT 2011


On 08/19/2011 11:43 PM, Kenneth Graunke wrote:
> On 08/19/2011 05:56 PM, Eric Anholt wrote:
>> ---
>>  src/mesa/drivers/dri/i965/brw_context.c        |    6 +++++
>>  src/mesa/drivers/dri/i965/brw_context.h        |    2 -
>>  src/mesa/drivers/dri/i965/brw_curbe.c          |    3 +-
>>  src/mesa/drivers/dri/i965/brw_vec4_emit.cpp    |    1 -
>>  src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |   29 ++++-------------------
>>  src/mesa/drivers/dri/i965/gen6_vs_state.c      |    3 +-
>>  6 files changed, 13 insertions(+), 31 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
>> index 8c73408..67d3c54 100644
>> --- a/src/mesa/drivers/dri/i965/brw_context.c
>> +++ b/src/mesa/drivers/dri/i965/brw_context.c
>> @@ -250,6 +250,12 @@ GLboolean brwCreateContext( int api,
>>  
>>     brw->new_vs_backend = (getenv("INTEL_NEW_VS") != NULL);
>>  
>> +   /* If we're using the new shader backend, we require integer uniforms
>> +    * stored as actual integers.
>> +    */
>> +   if (brw->new_vs_backend)
>> +      ctx->Const.NativeIntegers = true;
>> +
>>     return GL_TRUE;
>>  }
> 
> This hunk above looks good.  But the rest of the changes
> below---removing convert_param---sure look like they're going to break
> non-float uniforms when using the old VS.  Presumably you didn't mean to
> include that...

Nevermind!  I just tested it and it doesn't break anything.  For the old
VS, all uniforms are loaded as floats, and everything is treated as
floats...so conversion is unnecessary.  For the new VS, this patch makes
everything be loaded properly, so conversion is unnecessary.

So, you're right, and we do get to scrap all this. :)  Excellent.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list