[Mesa-dev] [PATCH] i965: Fix border color handling for deprecated SNORM formats.

Eric Anholt eric at anholt.net
Mon Jan 7 11:18:18 PST 2013


Ian Romanick <idr at freedesktop.org> writes:

> On 12/20/2012 04:07 PM, Eric Anholt wrote:
>> We don't have native hardware support for these, so they get promoted to
>> RGBA, in which case we don't have hardware dealing with the channel
>> swizzling for us.
>>
>> Fixes piglit EXT_texture_snorm/texwrap formats bordercolor (-swizzled).
>> ---
>>   src/mesa/drivers/dri/i965/brw_wm_sampler_state.c |   31 ++++++++++++++++++++--
>>   1 file changed, 29 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
>> index 0d1f249..006aa68 100644
>> --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
>> +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
>> @@ -89,7 +89,8 @@ upload_default_color(struct brw_context *brw, struct gl_sampler_object *sampler,

>> +   case GL_LUMINANCE_ALPHA:
>> +      color[0] = sampler->BorderColor.f[0];
>> +      color[1] = sampler->BorderColor.f[0];
>> +      color[2] = sampler->BorderColor.f[0];
>> +      color[3] = sampler->BorderColor.f[3];
>> +      break;
>> +   default:
>>         color[0] = sampler->BorderColor.f[0];
>>         color[1] = sampler->BorderColor.f[1];
>>         color[2] = sampler->BorderColor.f[2];
>>         color[3] = sampler->BorderColor.f[3];
>
> Is this the correct handing for RED / RG?  If it's not, it's a 
> pre-existing issue.  I haven't reviewed that part of the spec recently...

Behavior is already correct for the non-deprecated formats because they
don't get promoted to a different non-deprecated format.

-------------- 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/20130107/1dbcd1b8/attachment.pgp>


More information about the mesa-dev mailing list