From: Italo Nicola Date: Wed, 28 Jun 2023 14:23:27 +0000 (+0000) Subject: v3d: implement clear_render_target and clear_depth_stencil X-Git-Tag: upstream/23.3.3~5842 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b094332303fc6b3350ee09e745b3956e16c29b6b;p=platform%2Fupstream%2Fmesa.git v3d: implement clear_render_target and clear_depth_stencil Also added some related piglit failures to broadcom-rpi4-fails.txt. Signed-off-by: Italo Nicola Reviewed-by: Alyssa Rosenzweig Reviewed-by: Iago Toral Quiroga Reviewed-by: Marek Olšák Part-of: --- diff --git a/src/broadcom/ci/broadcom-rpi4-fails.txt b/src/broadcom/ci/broadcom-rpi4-fails.txt index 7c8f5b0..845201f 100644 --- a/src/broadcom/ci/broadcom-rpi4-fails.txt +++ b/src/broadcom/ci/broadcom-rpi4-fails.txt @@ -502,6 +502,10 @@ spec@oes_texture_view@rendering-formats@clear GL_RGB10_A2 as GL_RGBA8I,Fail spec@!opengl 1.0@depth-clear-precision-check@depth16,Fail spec@!opengl 1.0@depth-clear-precision-check@depth24,Fail +# This fails the subtest for GL_ALPHA16 because we don't support a 16-bit unorm format for rendering +# so gallium falls back to using an 8-bit unorm format and we lose some precision in the result. +spec@arb_clear_texture@arb_clear_texture-sized-formats,Fail + # These fail because the shaders use indirect indexing on samplers which we # don't support (the GLSL linker fails to link the shaders because of this). # If loop unrolling kicks-in for these tests it removes the indirect indexing diff --git a/src/gallium/drivers/v3d/v3d_blit.c b/src/gallium/drivers/v3d/v3d_blit.c index b7dc56a..0260bdd 100644 --- a/src/gallium/drivers/v3d/v3d_blit.c +++ b/src/gallium/drivers/v3d/v3d_blit.c @@ -56,10 +56,10 @@ v3d_blitter_save(struct v3d_context *v3d, bool op_blit, bool render_cond) 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_blit) { util_blitter_save_scissor(v3d->blitter, &v3d->scissor); - util_blitter_save_framebuffer(v3d->blitter, &v3d->framebuffer); util_blitter_save_fragment_sampler_states(v3d->blitter, v3d->tex[PIPE_SHADER_FRAGMENT].num_samplers, (void **)v3d->tex[PIPE_SHADER_FRAGMENT].samplers); diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index 0640dab..1744250 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -1684,7 +1684,13 @@ v3d_clear_render_target(struct pipe_context *pctx, struct pipe_surface *ps, unsigned x, unsigned y, unsigned w, unsigned h, bool render_condition_enabled) { - fprintf(stderr, "unimpl: clear RT\n"); + struct v3d_context *v3d = v3d_context(pctx); + + if (render_condition_enabled && !v3d_render_condition_check(v3d)) + return; + + v3d_blitter_save(v3d, false, render_condition_enabled); + util_blitter_clear_render_target(v3d->blitter, ps, color, x, y, w, h); } static void @@ -1693,7 +1699,14 @@ v3d_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *ps, unsigned x, unsigned y, unsigned w, unsigned h, bool render_condition_enabled) { - fprintf(stderr, "unimpl: clear DS\n"); + struct v3d_context *v3d = v3d_context(pctx); + + if (render_condition_enabled && !v3d_render_condition_check(v3d)) + return; + + v3d_blitter_save(v3d, false, render_condition_enabled); + util_blitter_clear_depth_stencil(v3d->blitter, ps, buffers, depth, + stencil, x, y, w, h); } void