freedreno: implement clear_render_target and clear_depth_stencil

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23735>
This commit is contained in:
Italo Nicola
2023-06-28 14:23:02 +00:00
committed by Marge Bot
parent b0bbd9c0d3
commit 9a88064162
3 changed files with 52 additions and 5 deletions
@@ -279,6 +279,35 @@ fd_blitter_clear(struct pipe_context *pctx, unsigned buffers,
fd_blitter_pipe_end(ctx);
}
/* Partially generic clear_render_target implementation using u_blitter */
void
fd_blitter_clear_render_target(struct pipe_context *pctx, struct pipe_surface *ps,
const union pipe_color_union *color, unsigned x,
unsigned y, unsigned w, unsigned h,
bool render_condition_enabled)
{
struct fd_context *ctx = fd_context(pctx);
fd_blitter_pipe_begin(ctx, render_condition_enabled);
util_blitter_clear_render_target(ctx->blitter, ps, color, x, y, w, h);
fd_blitter_pipe_end(ctx);
}
/* Partially generic clear_depth_stencil implementation using u_blitter */
void
fd_blitter_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *ps,
unsigned buffers, double depth, unsigned stencil,
unsigned x, unsigned y, unsigned w, unsigned h,
bool render_condition_enabled)
{
struct fd_context *ctx = fd_context(pctx);
fd_blitter_pipe_begin(ctx, render_condition_enabled);
util_blitter_clear_depth_stencil(ctx->blitter, ps, buffers, depth,
stencil, x, y, w, h);
fd_blitter_pipe_end(ctx);
}
/**
* Optimal hardware path for blitting pixels.
* Scaling, format conversion, up- and downsampling (resolve) are allowed.
@@ -41,6 +41,16 @@ void fd_blitter_clear(struct pipe_context *pctx, unsigned buffers,
const union pipe_color_union *color, double depth,
unsigned stencil) assert_dt;
void fd_blitter_clear_render_target(struct pipe_context *pctx, struct pipe_surface *ps,
const union pipe_color_union *color, unsigned x,
unsigned y, unsigned w, unsigned h,
bool render_condition_enabled) assert_dt;
void fd_blitter_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *ps,
unsigned buffers, double depth, unsigned stencil,
unsigned x, unsigned y, unsigned w, unsigned h,
bool render_condition_enabled) assert_dt;
void fd_resource_copy_region(struct pipe_context *pctx,
struct pipe_resource *dst, unsigned dst_level,
unsigned dstx, unsigned dsty, unsigned dstz,
+13 -5
View File
@@ -540,19 +540,27 @@ static void
fd_clear_render_target(struct pipe_context *pctx, struct pipe_surface *ps,
const union pipe_color_union *color, unsigned x,
unsigned y, unsigned w, unsigned h,
bool render_condition_enabled)
bool render_condition_enabled) in_dt
{
DBG("TODO: x=%u, y=%u, w=%u, h=%u", x, y, w, h);
if (render_condition_enabled && !fd_render_condition_check(pctx))
return;
fd_blitter_clear_render_target(pctx, ps, color, x, y, w, h,
render_condition_enabled);
}
static void
fd_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *ps,
unsigned buffers, double depth, unsigned stencil,
unsigned x, unsigned y, unsigned w, unsigned h,
bool render_condition_enabled)
bool render_condition_enabled) in_dt
{
DBG("TODO: buffers=%u, depth=%f, stencil=%u, x=%u, y=%u, w=%u, h=%u",
buffers, depth, stencil, x, y, w, h);
if (render_condition_enabled && !fd_render_condition_check(pctx))
return;
fd_blitter_clear_depth_stencil(pctx, ps, buffers,
depth, stencil, x, y, w, h,
render_condition_enabled);
}
static void