panfrost: Specialize blendable_formats for v6
Let's bake the swizzle in. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11785>
This commit is contained in:
parent
262d96d3df
commit
d8eef119fd
|
@ -44,12 +44,22 @@
|
|||
#define MALI_BLEND_AU_R5G5B5A1 (MALI_RGB5_A1_AU << 12)
|
||||
#define MALI_BLEND_PU_R5G5B5A1 (MALI_RGB5_A1_PU << 12)
|
||||
|
||||
#if PAN_ARCH <= 6
|
||||
#define BFMT2(pipe, internal, writeback, srgb) \
|
||||
[PIPE_FORMAT_##pipe] = { \
|
||||
MALI_COLOR_BUFFER_INTERNAL_FORMAT_## internal, \
|
||||
MALI_MFBD_COLOR_FORMAT_## writeback, \
|
||||
MALI_BLEND_AU_ ## internal | (srgb ? (1 << 20) : 0), \
|
||||
MALI_BLEND_AU_ ## internal | (srgb ? (1 << 20) : 0) | \
|
||||
PAN_V6_SWIZZLE(R, G, B, A) \
|
||||
}
|
||||
#else
|
||||
#define BFMT2(pipe, internal, writeback, srgb) \
|
||||
[PIPE_FORMAT_##pipe] = { \
|
||||
MALI_COLOR_BUFFER_INTERNAL_FORMAT_## internal, \
|
||||
MALI_MFBD_COLOR_FORMAT_## writeback, \
|
||||
MALI_BLEND_AU_ ## internal | (srgb ? (1 << 20) : 0) \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define BFMT(pipe, internal_and_writeback) \
|
||||
BFMT2(pipe, internal_and_writeback, internal_and_writeback, 0)
|
||||
|
|
|
@ -75,12 +75,9 @@ unsigned
|
|||
panfrost_format_to_bifrost_blend(const struct panfrost_device *dev,
|
||||
enum pipe_format format)
|
||||
{
|
||||
mali_pixel_format pixfmt = panfrost_blendable_formats_v7[format].bifrost;
|
||||
mali_pixel_format pixfmt = (dev->quirks & HAS_SWIZZLES) ?
|
||||
panfrost_blendable_formats_v7[format].bifrost :
|
||||
panfrost_blendable_formats_v6[format].bifrost;
|
||||
|
||||
if (pixfmt) {
|
||||
return pixfmt | ((dev->quirks & HAS_SWIZZLES) ?
|
||||
panfrost_get_default_swizzle(4) : 0);
|
||||
} else {
|
||||
return dev->formats[format].hw;
|
||||
}
|
||||
return pixfmt ?: dev->formats[format].hw;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue