[Mesa-dev] [PATCH 03/13] gallium: Introduce 32-bit bytewise format names
Christoph Bumiller
e0425955 at student.tuwien.ac.at
Thu Jun 6 04:03:00 PDT 2013
On 06.06.2013 10:34, Richard Sandiford wrote:
> Michel Dänzer <michel at daenzer.net> writes:
>> On Die, 2013-06-04 at 10:47 +0100, Richard Sandiford wrote:
>>> (2) it uses PIPE_FORMAT_INT_* names with the lsb first rather than the
>>> mesa-like ones with msb first. (I'm happy to change the names to
>>> something else though.)
>>>
>>> The patch isn't in a submittable state yet. I just thought it was worth
>>> posting because the lsb-first names do make the change look a bit more
>>> obvious/less scary :-)
>> I can see the appeal of that, but I also see some danger in that naming
>> scheme: It'll be easy to miss the difference between the two kinds of
>> formats, e.g. when grepping for B8G8R8A8. That's why I'd prefer making
>> the difference more explicit in the naming scheme. Sticking to LSB
>> first, BGRA8888 might already look a little less scary? :)
> I realise this was probably more a question for Jose, but FWIW:
> I liked the names you originally suggested for their consistency with
> mesa and natural number ordering (as you said). The PIPE_FORMAT_INT_*
I don't like that _INT_, it could be confused with the SINT/UINT
component type postfix, and it's redundant. The distinction provided by
R8G8B8A8 vs RGBA8888 is already sufficient. Neither do I like REV, I
always have to check what order that actually implies (but then I hardly
ever deal with mesa format names).
Why not just defined it as RxGyBzAw meaning "left to right = lowest
address to highest address" and RGBAxyzw meaning "left to right =
least/most (so that it matches the non-REV variant) to most/least
significant bit-tuple in a word ? And you can do RG16[_]BG16 if you have
2 words, or R32_G32_B32_A32 for 4 words, but this ugly speciment is
equivalent to R32G32B32A32 so it won't ever appear to hurt your eyes.
> version seemed OK too from the "lowest always first" perspective.
> I'm just afraid that if we use BGRA8888 to mean the reverse of what
> it means in mesa, these patches are going to be cursed by gallium
> developers for years to come.
>
> BGRA8888_REV would be consistent with the mesa names while being
> lsb-first, and I'd be happy with that too FWIW. It's just that
> _REV kind of implies that the other order is somehow the canonical one.
> Having all int formats end in _REV might seem a bit odd.
>
> Thanks,
> Richard
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list