mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
v3d: add new clear blitter op
A specific clear_surface blitter operation is required, because in this case we need to save framebuffer information, but not in standard clear, as we are currently doing. This fixes a leak in depthstencil surface, which happens because we were storing saving it as part for the framebuffer information, but the blitter clear wasn't restoring it because it wasn't required (only it is required in clearing a surface). Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30240>
This commit is contained in:
parent
7158950a6f
commit
4215d50384
3 changed files with 10 additions and 5 deletions
|
|
@ -57,7 +57,9 @@ v3d_blitter_save(struct v3d_context *v3d, enum v3d_blitter_op op)
|
|||
util_blitter_save_sample_mask(v3d->blitter, v3d->sample_mask, 0);
|
||||
util_blitter_save_so_targets(v3d->blitter, v3d->streamout.num_targets,
|
||||
v3d->streamout.targets);
|
||||
util_blitter_save_framebuffer(v3d->blitter, &v3d->framebuffer);
|
||||
|
||||
if (op & V3D_SAVE_FRAMEBUFFER)
|
||||
util_blitter_save_framebuffer(v3d->blitter, &v3d->framebuffer);
|
||||
|
||||
if (op & V3D_SAVE_TEXTURES) {
|
||||
util_blitter_save_scissor(v3d->blitter, &v3d->scissor);
|
||||
|
|
|
|||
|
|
@ -154,12 +154,15 @@ enum v3d_flush_cond {
|
|||
/* bitmask */
|
||||
enum v3d_blitter_op {
|
||||
V3D_SAVE_TEXTURES = (1u << 1),
|
||||
V3D_DISABLE_RENDER_COND = (1u << 2),
|
||||
V3D_SAVE_FRAMEBUFFER = (1u << 2),
|
||||
V3D_DISABLE_RENDER_COND = (1u << 3),
|
||||
|
||||
V3D_BLIT = V3D_SAVE_TEXTURES,
|
||||
V3D_BLIT = V3D_SAVE_FRAMEBUFFER | V3D_SAVE_TEXTURES,
|
||||
V3D_BLIT_COND = V3D_BLIT | V3D_DISABLE_RENDER_COND,
|
||||
V3D_CLEAR = 0,
|
||||
V3D_CLEAR_COND = V3D_CLEAR | V3D_DISABLE_RENDER_COND,
|
||||
V3D_CLEAR_SURFACE = V3D_SAVE_FRAMEBUFFER,
|
||||
V3D_CLEAR_SURFACE_COND = V3D_CLEAR_SURFACE | V3D_DISABLE_RENDER_COND
|
||||
};
|
||||
|
||||
struct v3d_sampler_view {
|
||||
|
|
|
|||
|
|
@ -1793,7 +1793,7 @@ v3d_clear_render_target(struct pipe_context *pctx, struct pipe_surface *ps,
|
|||
return;
|
||||
|
||||
v3d_blitter_save(v3d, render_condition_enabled ?
|
||||
V3D_CLEAR_COND : V3D_CLEAR);
|
||||
V3D_CLEAR_SURFACE_COND : V3D_CLEAR_SURFACE);
|
||||
util_blitter_clear_render_target(v3d->blitter, ps, color, x, y, w, h);
|
||||
}
|
||||
|
||||
|
|
@ -1809,7 +1809,7 @@ v3d_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *ps,
|
|||
return;
|
||||
|
||||
v3d_blitter_save(v3d, render_condition_enabled ?
|
||||
V3D_CLEAR_COND : V3D_CLEAR);
|
||||
V3D_CLEAR_SURFACE_COND : V3D_CLEAR_SURFACE);
|
||||
util_blitter_clear_depth_stencil(v3d->blitter, ps, buffers, depth,
|
||||
stencil, x, y, w, h);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue