[Mesa-dev] [PATCH 2/3] nv50: add more RGB10A2 formats

Ilia Mirkin imirkin at alum.mit.edu
Fri Jan 17 00:08:42 PST 2014


On Fri, Jan 17, 2014 at 2:48 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Wed, Jan 15, 2014 at 6:37 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>> On Wed, Dec 25, 2013 at 11:53 AM, Christoph Bumiller
>> <e0425955 at student.tuwien.ac.at> wrote:
>>> ---
>>>  src/gallium/drivers/nouveau/nv50/nv50_formats.c | 7 +++++++
>>>  1 file changed, 7 insertions(+)
>>>
>>> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_formats.c b/src/gallium/drivers/nouveau/nv50/nv50_formats.c
>>> index 0a7e812..b301890 100644
>>> --- a/src/gallium/drivers/nouveau/nv50/nv50_formats.c
>>> +++ b/src/gallium/drivers/nouveau/nv50/nv50_formats.c
>>> @@ -202,6 +202,8 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
>>>         TBV, 1),
>>>     C4A(R10G10B10A2_SNORM, NONE, C0, C1, C2, C3, SNORM, 10_10_10_2, TV, 0),
>>>     C4A(B10G10R10A2_SNORM, NONE, C2, C1, C0, C3, SNORM, 10_10_10_2, TV, 1),
>>> +   C4A(R10G10B10A2_UINT, RGB10_A2_UINT, C0, C1, C2, C3, UINT, 10_10_10_2, TRV, 0),
>>> +   C4A(B10G10R10A2_UINT, RGB10_A2_UINT, C2, C1, C0, C3, UINT, 10_10_10_2, TV, 0),
>>>
>>>     F3B(R11G11B10_FLOAT, R11G11B10_FLOAT, C0, C1, C2, xx, FLOAT, 11_11_10, IB),
>>>
>>> @@ -394,6 +396,11 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
>>>     F1A(R16_SSCALED, NONE, C0, xx, xx, xx, SSCALED, 16, V),
>>>     F1A(R16_USCALED, NONE, C0, xx, xx, xx, USCALED, 16, V),
>>>
>>> +   C4A(R10G10B10A2_USCALED, NONE, C0, C1, C2, C3, USCALED, 10_10_10_2, V, 0),
>>> +   C4A(R10G10B10A2_SSCALED, NONE, C0, C1, C2, C3, SSCALED, 10_10_10_2, V, 0),
>>> +   C4A(B10G10R10A2_USCALED, NONE, C0, C1, C2, C3, USCALED, 10_10_10_2, V, 1),
>>> +   C4A(B10G10R10A2_SSCALED, NONE, C0, C1, C2, C3, SSCALED, 10_10_10_2, V, 1),
>>> +
>>>     C4A(R8G8B8A8_SSCALED, NONE, C0, C1, C2, C3, SSCALED, 8_8_8_8, V, 0),
>>>     C4A(R8G8B8A8_USCALED, NONE, C0, C1, C2, C3, USCALED, 8_8_8_8, V, 0),
>>>     F3A(R8G8B8_UNORM, NONE, C0, C1, C2, xx, UNORM, 8_8_8, V),
>>
>> FWIW I ran piglit on this (with your other patches that cause the
>> RGB10A2 extensions to actually be turned on), and I saw this failure:
>>
>> $ bin/draw-vertices-2101010 -auto
>> Int vertices - 2/10/10/10
>> Unsigned Int vertices - 2/10/10/10
>> Int Color - 2/10/10/10
>> Probe color at (45,5)
>>   Expected: 1.000000 0.000000 0.000000 0.333000
>>   Observed: 1.000000 0.000000 0.000000 0.000000
>> Unsigned Int Color - 2/10/10/10
>> Int BGRA Color - 2/10/10/10
>> Probe color at (85,5)
>>   Expected: 0.000000 0.000000 1.000000 0.333000
>>   Observed: 0.000000 0.000000 1.000000 0.000000
>> Unsigned Int BGRA Color - 2/10/10/10
>> Int 2/10/10/10 - test ABI
>> Unsigned 2/10/10/10 - test ABI
>
> BTW, I tried to look into this...
>
> (a) Shouldn't the second C4A in the first hunk have a 1 for the BGRA
> bit? And similarly, shouldn't the components be flipped for the BGRA
> formats in the second hunk? Doing this made the
> GL_ARB_texture_rgb10_a2ui tests pass (well, mostly -- projective mode,
> whatever that is, still doesn't work, but that wasn't tested before)

Erm, nevermind. I must have been testing it on llvmpipe somehow... my
bad. Everything still fails with those changes too :) But it does work
on llvmpipe for the texwrap bordercolor/swizzled tests. But again,
that might be because we don't handle bordercolor correctly or
something.

>
> (b) I think that the draw-vertices test might be broken, but not in
> any way that matters:
>   - its i32to2 function is wrong. but it's fine for 0 which is what's
> being passed in
>   - 0 for a signed (2's complement) A2 component should become
> 0.66666, not 0.33333. I think. It's the third of 4 values -- -2, -1,
> 0, 1. But that's not what we're seeing anyways.
>
> (c) When I ran on the blob earlier, it had identical failures, and so
> does llvmpipe.
>
>>
>> There were also ARB_texture_rgb10_a2ui failures with texwrap
>> bordercolor's, but there are lots of other such failures with integer
>> formats, so I assume that's all part of the same thing. For reference:
>>
>> $ bin/texwrap GL_ARB_texture_rgb10_a2ui bordercolor -fbo -auto
>> Testing GL_ARB_texture_rgb10_a2ui.
>> Testing the border color only.
>> Testing GL_RGB10_A2UI, border color only
>> Fail with NEAREST and CLAMP_TO_BORDER at (95,36) @ 0,0
>>   Expected: 25 229 127 170
>>   Observed: 0 0 0 0
>> Fail with NEAREST and MIRROR_CLAMP_TO_BORDER_EXT at (273,36) @ 0,0
>>   Expected: 25 229 127 170
>>   Observed: 0 0 0 0
>>
>> $ bin/texwrap GL_ARB_texture_rgb10_a2ui bordercolor swizzled -fbo -auto
>> Testing GL_ARB_texture_rgb10_a2ui.
>> Testing the border color only.
>> Using texture swizzling.
>> Testing GL_RGB10_A2UI, swizzled, border color only
>> Fail with NEAREST and CLAMP_TO_BORDER at (95,36) @ 0,0
>>   Expected: 127 25 229 170
>>   Observed: 0 0 0 0
>> Fail with NEAREST and MIRROR_CLAMP_TO_BORDER_EXT at (273,36) @ 0,0
>>   Expected: 127 25 229 170
>>   Observed: 0 0 0 0


More information about the mesa-dev mailing list