mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 09:00:10 +01:00
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:
parent
048e431542
commit
b9a136cdd1
1 changed files with 3 additions and 0 deletions
|
|
@ -425,12 +425,15 @@ panfrost_new_texture_bifrost(
|
||||||
slices);
|
slices);
|
||||||
|
|
||||||
bool srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB);
|
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) {
|
pan_pack(out, BIFROST_TEXTURE, cfg) {
|
||||||
cfg.dimension = dim;
|
cfg.dimension = dim;
|
||||||
cfg.format = (mali_format << 12) | (srgb << 20);
|
cfg.format = (mali_format << 12) | (srgb << 20);
|
||||||
if (dev->quirks & HAS_SWIZZLES)
|
if (dev->quirks & HAS_SWIZZLES)
|
||||||
cfg.format |= panfrost_get_default_swizzle(desc->nr_channels);
|
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.width = u_minify(width, first_level);
|
||||||
cfg.height = u_minify(height, first_level);
|
cfg.height = u_minify(height, first_level);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue