panfrost: Implement BGRA textures

Stopgap before the full format rework.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7206>
This commit is contained in:
Alyssa Rosenzweig
2020-10-21 15:23:16 -04:00
committed by Marge Bot
parent 048e431542
commit b9a136cdd1

View File

@@ -425,12 +425,15 @@ panfrost_new_texture_bifrost(
slices);
bool srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB);
bool swap_rb = desc->swizzle[0] == 2 && desc->swizzle[2] == 0;
pan_pack(out, BIFROST_TEXTURE, cfg) {
cfg.dimension = dim;
cfg.format = (mali_format << 12) | (srgb << 20);
if (dev->quirks & HAS_SWIZZLES)
cfg.format |= panfrost_get_default_swizzle(desc->nr_channels);
else if (swap_rb)
cfg.format |= MALI_RGB_COMPONENT_ORDER_BGRA;
cfg.width = u_minify(width, first_level);
cfg.height = u_minify(height, first_level);