From af2f0c3d9b83bb56f05a136e6b046d60dd186d6d Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 26 Feb 2023 09:57:24 -0800 Subject: [PATCH] freedreno/a6xx: Rework texture_clear fallback C++ is more picky about a goto jumping over variable initialization, even if unused after the goto label (presumably because of destructors that can be called after a variable goes out of scope). Since there is only a single fallback path, get rid of the goto. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_blitter.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c index 55a34b4723e..7632b415bed 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c @@ -871,8 +871,10 @@ fd6_clear_texture(struct pipe_context *pctx, struct pipe_resource *prsc, fprintf(stderr, "\n"); } - if (!can_do_clear(prsc, level, box)) - goto fallback; + if (!can_do_clear(prsc, level, box)) { + util_clear_texture(pctx, prsc, level, box, data); + return; + } union pipe_color_union color; @@ -942,11 +944,6 @@ fd6_clear_texture(struct pipe_context *pctx, struct pipe_resource *prsc, * the ctx->batch may need to turn its queries back on. */ fd_context_dirty(ctx, FD_DIRTY_QUERY); - - return; - -fallback: - util_clear_texture(pctx, prsc, level, box, data); } void