[Mesa-stable] [Mesa-dev] [PATCH 15/53] st/nine: Add ATI1 and ATI2 support

Axel Davy axel.davy at ens.fr
Thu Jan 8 11:24:57 PST 2015



On 07/01/2015 23:18, Axel Davy wrote :
> On 07/01/2015 18:42, Ilia Mirkin wrote :
>> On Wed, Jan 7, 2015 at 11:36 AM, Axel Davy <axel.davy at ens.fr> wrote:
>>> Adds ATI1 and ATI2 support to nine.
>>>
>>> They map to PIPE_FORMAT_RGTC1_UNORM and PIPE_FORMAT_RGTC2_UNORM,
>>> but need special handling.
>>>
>>> Reviewed-by: David Heidelberg <david at ixit.cz>
>>> Signed-off-by: Axel Davy <axel.davy at ens.fr>
>>> Signed-off-by: Xavier Bouchoux <xavierb at gmail.com>
>>>
>>> Cc: "10.4" <mesa-stable at lists.freedesktop.org>
>>> ---
>>>   src/gallium/state_trackers/nine/adapter9.c       |  3 +++
>>>   src/gallium/state_trackers/nine/basetexture9.c   |  9 ++++++---
>>>   src/gallium/state_trackers/nine/cubetexture9.c   |  4 ++++
>>>   src/gallium/state_trackers/nine/nine_pipe.h      |  2 ++
>>>   src/gallium/state_trackers/nine/surface9.c       | 19 
>>> +++++++++++++++----
>>>   src/gallium/state_trackers/nine/volumetexture9.c |  4 ++++
>>>   6 files changed, 34 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/src/gallium/state_trackers/nine/adapter9.c 
>>> b/src/gallium/state_trackers/nine/adapter9.c
>>> index 871a9a3..481f863 100644
>>> --- a/src/gallium/state_trackers/nine/adapter9.c
>>> +++ b/src/gallium/state_trackers/nine/adapter9.c
>>> @@ -302,6 +302,9 @@ NineAdapter9_CheckDeviceFormat( struct 
>>> NineAdapter9 *This,
>>>           return D3DERR_NOTAVAILABLE;
>>>       }
>>>
>>> +    /* we support ATI1 and ATI2 hack only for 2D textures */
>>> +    if (RType != D3DRTYPE_TEXTURE && (CheckFormat == D3DFMT_ATI1 || 
>>> CheckFormat == D3DFMT_ATI2))
>>> +        return D3DERR_NOTAVAILABLE;
>>>       /* if (Usage & D3DUSAGE_NONSECURE) { don't know the 
>>> implications of this } */
>>>       /* if (Usage & D3DUSAGE_SOFTWAREPROCESSING) { we can always 
>>> support this } */
>>>
>>> diff --git a/src/gallium/state_trackers/nine/basetexture9.c 
>>> b/src/gallium/state_trackers/nine/basetexture9.c
>>> index ffccafd..ea9af94 100644
>>> --- a/src/gallium/state_trackers/nine/basetexture9.c
>>> +++ b/src/gallium/state_trackers/nine/basetexture9.c
>>> @@ -486,9 +486,12 @@ NineBaseTexture9_UpdateSamplerView( struct 
>>> NineBaseTexture9 *This,
>>>           swizzle[1] = PIPE_SWIZZLE_ZERO;
>>>           swizzle[2] = PIPE_SWIZZLE_ZERO;
>>>           swizzle[3] = PIPE_SWIZZLE_ONE;
>>> -    } else if (resource->format != PIPE_FORMAT_A8_UNORM) {
>>> -        /* A8 is the only exception that should have 0.0 as default 
>>> values
>>> -         * for RGB. It is already what gallium does. All the other 
>>> ones
>>> +    } else if (resource->format != PIPE_FORMAT_A8_UNORM &&
>>> +               resource->format != PIPE_FORMAT_RGTC1_UNORM) {
>>> +        /* exceptions:
>>> +         * A8 should have 0.0 as default values for RGB.
>>> +         * ATI1/RGTC1 should be r 0 0 1 (tested on windows).
>> But RGTC2 is rg11??
> I'll double check
Yes, ATI1 is r001 and ATI2 rg11

Axel


More information about the mesa-stable mailing list