asahi: allow rgb9e5 rendering internally

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30981>
This commit is contained in:
Alyssa Rosenzweig
2024-08-17 15:09:12 -04:00
committed by Marge Bot
parent bcddf041eb
commit 4541688a85
2 changed files with 10 additions and 4 deletions

View File

@@ -142,9 +142,7 @@ const struct ail_pixel_format_entry ail_pixel_format[PIPE_FORMAT_COUNT] = {
AIL_FMT(B10G10R10A2_SINT, R10G10B10A2, SINT, _),
AIL_FMT(R11G11B10_FLOAT, R11G11B10, FLOAT, RG11B10F),
/* TODO: This should be renderable but there are copyimage issues */
AIL_FMT(R9G9B9E5_FLOAT, R9G9B9E5, FLOAT, _),
AIL_FMT(R9G9B9E5_FLOAT, R9G9B9E5, FLOAT, RGB9E5),
/* These formats are emulated for texture buffers only */
AIL_FMT(R32G32B32_FLOAT, R32G32B32_EMULATED, FLOAT, _),

View File

@@ -27,6 +27,7 @@
#include "pipe/p_state.h"
#include "util/bitscan.h"
#include "util/format/u_format.h"
#include "util/format/u_formats.h"
#include "util/half_float.h"
#include "util/macros.h"
#include "util/simple_mtx.h"
@@ -429,6 +430,11 @@ agx_compression_allowed(const struct agx_resource *pres)
return false;
}
if (pres->base.format == PIPE_FORMAT_R9G9B9E5_FLOAT) {
rsrc_debug(pres, "No compression: RGB9E5 copies need work\n");
return false;
}
return true;
}
@@ -2496,7 +2502,9 @@ agx_is_format_supported(struct pipe_screen *pscreen, enum pipe_format format,
target != PIPE_BUFFER)
return false;
if ((usage & PIPE_BIND_RENDER_TARGET) && !ent.renderable)
/* XXX: sort out rgb9e5 rendering */
if ((usage & PIPE_BIND_RENDER_TARGET) &&
(!ent.renderable || (tex_format == PIPE_FORMAT_R9G9B9E5_FLOAT)))
return false;
}