unsigned color_mask : 4;
} __attribute__((packed));
-/* Used with channel swizzling */
-enum mali_channel {
- MALI_CHANNEL_RED = 0,
- MALI_CHANNEL_GREEN = 1,
- MALI_CHANNEL_BLUE = 2,
- MALI_CHANNEL_ALPHA = 3,
- MALI_CHANNEL_ZERO = 4,
- MALI_CHANNEL_ONE = 5,
- MALI_CHANNEL_RESERVED_0 = 6,
- MALI_CHANNEL_RESERVED_1 = 7,
-};
-
/* Compressed per-pixel formats. Each of these formats expands to one to four
* floating-point or integer numbers, as defined by the OpenGL specification.
* There are various places in OpenGL where the user can specify a compressed
pandecode_access_mask_from_channel_swizzle(unsigned swizzle)
{
unsigned mask = 0;
- assert(MALI_CHANNEL_RED == 0);
+ assert(MALI_CHANNEL_R == 0);
for (unsigned c = 0; c < 4; ++c) {
enum mali_channel chan = (swizzle >> (3*c)) & 0x7;
- if (chan <= MALI_CHANNEL_ALPHA)
+ if (chan <= MALI_CHANNEL_A)
mask |= (1 << chan);
}
* useless printing for the defaults */
unsigned default_swizzles[4] = {
- MALI_CHANNEL_RED | (MALI_CHANNEL_ZERO << 3) | (MALI_CHANNEL_ZERO << 6) | (MALI_CHANNEL_ONE << 9),
- MALI_CHANNEL_RED | (MALI_CHANNEL_GREEN << 3) | (MALI_CHANNEL_ZERO << 6) | (MALI_CHANNEL_ONE << 9),
- MALI_CHANNEL_RED | (MALI_CHANNEL_GREEN << 3) | (MALI_CHANNEL_BLUE << 6) | (MALI_CHANNEL_ONE << 9),
- MALI_CHANNEL_RED | (MALI_CHANNEL_GREEN << 3) | (MALI_CHANNEL_BLUE << 6) | (MALI_CHANNEL_ALPHA << 9)
+ MALI_CHANNEL_R | (MALI_CHANNEL_0 << 3) | (MALI_CHANNEL_0 << 6) | (MALI_CHANNEL_1 << 9),
+ MALI_CHANNEL_R | (MALI_CHANNEL_G << 3) | (MALI_CHANNEL_0 << 6) | (MALI_CHANNEL_1 << 9),
+ MALI_CHANNEL_R | (MALI_CHANNEL_G << 3) | (MALI_CHANNEL_B << 6) | (MALI_CHANNEL_1 << 9),
+ MALI_CHANNEL_R | (MALI_CHANNEL_G << 3) | (MALI_CHANNEL_B << 6) | (MALI_CHANNEL_A << 9)
};
return (swizzle == default_swizzles[nr_comp - 1]);
for (unsigned c = 0; c < 4; ++c) {
enum mali_channel chan = (swizzle >> (3 * c)) & 0x7;
- if (chan >= MALI_CHANNEL_RESERVED_0) {
+ if (chan > MALI_CHANNEL_1) {
pandecode_log("XXX: invalid swizzle channel %d\n", chan);
continue;
}
<panxml>
+ <enum name="Channel">
+ <value name="R" value="0"/>
+ <value name="G" value="1"/>
+ <value name="B" value="2"/>
+ <value name="A" value="3"/>
+ <value name="0" value="4"/>
+ <value name="1" value="5"/>
+ </enum>
+
<enum name="Job Type">
<value name="Not started" value="0"/>
<value name="Null" value="1"/>
struct mali_attr_meta varying_meta = {
.index = 0,
.unknown1 = 2,
- .format = (MALI_CHANNEL_RED << 0) | (MALI_CHANNEL_GREEN << 3) | (MALI_RGBA32F << 12)
+ .format = (MALI_CHANNEL_R << 0) | (MALI_CHANNEL_G << 3) | (MALI_RGBA32F << 12)
};
struct mali_stencil_packed stencil;
0, 0,
image->nr_samples,
0,
- (MALI_CHANNEL_RED << 0) | (MALI_CHANNEL_GREEN << 3) | (MALI_CHANNEL_BLUE << 6) | (MALI_CHANNEL_ALPHA << 9),
+ (MALI_CHANNEL_R << 0) | (MALI_CHANNEL_G << 3) | (MALI_CHANNEL_B << 6) | (MALI_CHANNEL_A << 9),
image->bo->gpu + image->first_layer *
panfrost_get_layer_stride(image->slices,
image->dim == MALI_TEXTURE_DIMENSION_3D,
}
#define MALI_SWIZZLE_R001 \
- (MALI_CHANNEL_RED << 0) | \
- (MALI_CHANNEL_ZERO << 3) | \
- (MALI_CHANNEL_ZERO << 6) | \
- (MALI_CHANNEL_ONE << 9)
+ (MALI_CHANNEL_R << 0) | \
+ (MALI_CHANNEL_0 << 3) | \
+ (MALI_CHANNEL_0 << 6) | \
+ (MALI_CHANNEL_1 << 9)
#define MALI_SWIZZLE_A001 \
- (MALI_CHANNEL_ALPHA << 0) | \
- (MALI_CHANNEL_ZERO << 3) | \
- (MALI_CHANNEL_ZERO << 6) | \
- (MALI_CHANNEL_ONE << 9)
+ (MALI_CHANNEL_A << 0) | \
+ (MALI_CHANNEL_0 << 3) | \
+ (MALI_CHANNEL_0 << 6) | \
+ (MALI_CHANNEL_1 << 9)
void
{
switch (components) {
case 1:
- return (MALI_CHANNEL_RED << 0) | (MALI_CHANNEL_ZERO << 3) |
- (MALI_CHANNEL_ZERO << 6) | (MALI_CHANNEL_ONE << 9);
+ return (MALI_CHANNEL_R << 0) | (MALI_CHANNEL_0 << 3) |
+ (MALI_CHANNEL_0 << 6) | (MALI_CHANNEL_1 << 9);
case 2:
- return (MALI_CHANNEL_RED << 0) | (MALI_CHANNEL_GREEN << 3) |
- (MALI_CHANNEL_ZERO << 6) | (MALI_CHANNEL_ONE << 9);
+ return (MALI_CHANNEL_R << 0) | (MALI_CHANNEL_G << 3) |
+ (MALI_CHANNEL_0 << 6) | (MALI_CHANNEL_1 << 9);
case 3:
- return (MALI_CHANNEL_RED << 0) | (MALI_CHANNEL_GREEN << 3) |
- (MALI_CHANNEL_BLUE << 6) | (MALI_CHANNEL_ONE << 9);
+ return (MALI_CHANNEL_R << 0) | (MALI_CHANNEL_G << 3) |
+ (MALI_CHANNEL_B << 6) | (MALI_CHANNEL_1 << 9);
case 4:
- return (MALI_CHANNEL_RED << 0) | (MALI_CHANNEL_GREEN << 3) |
- (MALI_CHANNEL_BLUE << 6) | (MALI_CHANNEL_ALPHA << 9);
+ return (MALI_CHANNEL_R << 0) | (MALI_CHANNEL_G << 3) |
+ (MALI_CHANNEL_B << 6) | (MALI_CHANNEL_A << 9);
default:
unreachable("Invalid number of components");
}