[Mesa-dev] [PATCH 3/6] gallium: merge PIPE_SWIZZLE_* and UTIL_FORMAT_SWIZZLE_*
Emil Velikov
emil.l.velikov at gmail.com
Sat Apr 16 23:25:38 UTC 2016
On 16 April 2016 at 23:15, Roland Scheidegger <sroland at vmware.com> wrote:
> Am 16.04.2016 um 14:50 schrieb Marek Olšák:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> Use PIPE_SWIZZLE_* everywhere.
>> Use X/Y/Z/W/0/1 instead of RED, GREEN, BLUE, ALPHA, ZERO, ONE.
>> The new enum is called pipe_swizzle.
>
> Using PIPE_SWIZZLE insteads sounds reasonable.
> Not sure though how I feel about using X/Y/Z/W instead of
> RED/GREEN/BLUE/ALPHA. I think there's situations wher using r/g/b/a is
> nicer compared to x/y/z/w. (If these were just defines could of course
> have definitions for both versions but with a named enum it's probably
> not a good idea two have two named enum...)
>
You can easily have both names as below.
enum foo {
...
PIPE_SWIZZLE_X,
PIPE_SWIZZLE_RED = PIPE_SWIZZLE_X,
PIPE_SWIZZLE_Y,
PIPE_SWIZZLE_GREEN = PIPE_SWIZZLE_Y,
.....
};
-Emil
More information about the mesa-dev
mailing list