mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 08:40:11 +01:00
etnaviv: blt: Extend to support MRTs
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
This commit is contained in:
parent
1ad37d42be
commit
d3a5306b91
1 changed files with 13 additions and 5 deletions
|
|
@ -212,10 +212,11 @@ emit_blt_inplace(struct etna_cmd_stream *stream, const struct blt_inplace_op *op
|
|||
}
|
||||
|
||||
static void
|
||||
etna_blit_clear_color_blt(struct pipe_context *pctx, struct pipe_surface *dst,
|
||||
etna_blit_clear_color_blt(struct pipe_context *pctx, unsigned idx,
|
||||
const union pipe_color_union *color)
|
||||
{
|
||||
struct etna_context *ctx = etna_context(pctx);
|
||||
struct pipe_surface *dst = ctx->framebuffer_s.cbufs[idx];
|
||||
struct etna_surface *surf = etna_surface(dst);
|
||||
uint64_t new_clear_value = etna_clear_blit_pack_rgba(surf->base.format, color);
|
||||
int msaa_xscale = 1, msaa_yscale = 1;
|
||||
|
|
@ -256,8 +257,13 @@ etna_blit_clear_color_blt(struct pipe_context *pctx, struct pipe_surface *dst,
|
|||
|
||||
/* This made the TS valid */
|
||||
if (surf->level->ts_size) {
|
||||
ctx->framebuffer.TS_COLOR_CLEAR_VALUE = new_clear_value;
|
||||
ctx->framebuffer.TS_COLOR_CLEAR_VALUE_EXT = new_clear_value >> 32;
|
||||
if (idx == 0) {
|
||||
ctx->framebuffer.TS_COLOR_CLEAR_VALUE = new_clear_value;
|
||||
ctx->framebuffer.TS_COLOR_CLEAR_VALUE_EXT = new_clear_value >> 32;
|
||||
} else {
|
||||
ctx->framebuffer.RT_TS_COLOR_CLEAR_VALUE[idx - 1] = new_clear_value;
|
||||
ctx->framebuffer.RT_TS_COLOR_CLEAR_VALUE_EXT[idx - 1] = new_clear_value >> 32;
|
||||
}
|
||||
|
||||
/* update clear color in SW meta area of the buffer if TS is exported */
|
||||
if (unlikely(new_clear_value != surf->level->clear_value &&
|
||||
|
|
@ -370,8 +376,10 @@ etna_clear_blt(struct pipe_context *pctx, unsigned buffers, const struct pipe_sc
|
|||
for (int idx = 0; idx < ctx->framebuffer_s.nr_cbufs; ++idx) {
|
||||
struct etna_surface *surf = etna_surface(ctx->framebuffer_s.cbufs[idx]);
|
||||
|
||||
etna_blit_clear_color_blt(pctx, ctx->framebuffer_s.cbufs[idx],
|
||||
color);
|
||||
if (!surf)
|
||||
continue;
|
||||
|
||||
etna_blit_clear_color_blt(pctx, idx, color);
|
||||
|
||||
if (!etna_resource(surf->prsc)->explicit_flush)
|
||||
etna_context_add_flush_resource(ctx, surf->prsc);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue