[Mesa-dev] [PATCH 13/14] i965/vs: Implement EXT_texture_swizzle support for VS texturing.

Kenneth Graunke kenneth at whitecape.org
Wed Dec 14 15:11:53 PST 2011


On 12/13/2011 01:19 PM, Eric Anholt wrote:
> On Thu,  8 Dec 2011 17:08:04 -0800, Kenneth Graunke <kenneth at whitecape.org> wrote:
>> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
>> +   if (one_mask) {
>> +      swizzled_result.writemask = one_mask;
>> +      emit(MOV(swizzled_result, src_reg(1.0f)));
>> +   }
>>  }
> 
> I think this would be wrong for SWIZZLE_ONE of integer textures.

My tests indicate that it works.  swizzled_result gets the appropriate
register type, so this ends up being something like:

mov(8)   m4<1>.ywUD    1F    { align16 WE_normal 1Q };

and the MOV instruction does the float->int conversion for us.

Is that okay?  If not, what would you prefer?


More information about the mesa-dev mailing list