Mesa (master): freedreno: Don't bypass fd_draw_vbo() in clear fallback

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 10 02:53:12 UTC 2020


Module: Mesa
Branch: master
Commit: 74f1c50dc3bec39fc78f54265ae8c71369283071
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=74f1c50dc3bec39fc78f54265ae8c71369283071

Author: Rob Clark <robdclark at chromium.org>
Date:   Tue Sep  8 16:27:54 2020 -0700

freedreno: Don't bypass fd_draw_vbo() in clear fallback

Otherwise we bypass all the resource-usage tacking.

Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6649>

---

 .gitlab-ci/deqp-freedreno-a307-fails.txt          | 11 -----------
 src/gallium/drivers/freedreno/freedreno_blitter.c | 10 ++++++++--
 src/gallium/drivers/freedreno/freedreno_context.c |  2 +-
 src/gallium/drivers/freedreno/freedreno_draw.c    |  6 ++++--
 4 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/.gitlab-ci/deqp-freedreno-a307-fails.txt b/.gitlab-ci/deqp-freedreno-a307-fails.txt
index bb0bbb938a5..0c7c11a74e8 100644
--- a/.gitlab-ci/deqp-freedreno-a307-fails.txt
+++ b/.gitlab-ci/deqp-freedreno-a307-fails.txt
@@ -4,16 +4,6 @@ dEQP-GLES2.functional.clipping.point.wide_point_clip
 dEQP-GLES2.functional.clipping.point.wide_point_clip_viewport_center
 dEQP-GLES2.functional.clipping.point.wide_point_clip_viewport_corner
 dEQP-GLES2.functional.clipping.triangle_vertex.clip_three.clip_neg_x_neg_z_and_pos_x_pos_z_and_neg_x_neg_y_pos_z
-dEQP-GLES2.functional.fbo.render.recreate_depthbuffer.rebind_rbo_rgb565_depth_component16
-dEQP-GLES2.functional.fbo.render.recreate_depthbuffer.rebind_rbo_rgb5_a1_depth_component16
-dEQP-GLES2.functional.fbo.render.recreate_depthbuffer.rebind_rbo_rgba4_depth_component16
-dEQP-GLES2.functional.fbo.render.recreate_depthbuffer.rebind_tex2d_rgba_depth_component16
-dEQP-GLES2.functional.fbo.render.recreate_depthbuffer.rebind_tex2d_rgb_depth_component16
-dEQP-GLES2.functional.fbo.render.recreate_stencilbuffer.rebind_rbo_rgb565_stencil_index8
-dEQP-GLES2.functional.fbo.render.recreate_stencilbuffer.rebind_rbo_rgb5_a1_stencil_index8
-dEQP-GLES2.functional.fbo.render.recreate_stencilbuffer.rebind_rbo_rgba4_stencil_index8
-dEQP-GLES2.functional.fbo.render.recreate_stencilbuffer.rebind_tex2d_rgba_stencil_index8
-dEQP-GLES2.functional.fbo.render.recreate_stencilbuffer.rebind_tex2d_rgb_stencil_index8
 dEQP-GLES2.functional.polygon_offset.fixed16_displacement_with_units
 dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_l8_npot
 dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_rgb888_npot
@@ -124,7 +114,6 @@ dEQP-GLES3.functional.fbo.msaa.4_samples.rgba8
 dEQP-GLES3.functional.fbo.msaa.4_samples.srgb8_alpha8
 dEQP-GLES3.functional.fbo.msaa.4_samples.stencil_index8
 dEQP-GLES3.functional.fbo.render.recreate_depth_stencil.tex2d_rgba8_depth_rbo_depth_component16
-dEQP-GLES3.functional.fbo.render.recreate_depth_stencil.tex2d_rgba8_depth_rbo_depth_component24
 dEQP-GLES3.functional.fbo.render.recreate_depth_stencil.tex2d_rgba8_depth_rbo_depth_component32f
 dEQP-GLES3.functional.fbo.render.recreate_depth_stencil.tex2d_rgba8_depth_stencil_rbo_depth24_stencil8
 dEQP-GLES3.functional.fbo.render.recreate_depth_stencil.tex2d_rgba8_depth_stencil_rbo_depth32f_stencil8
diff --git a/src/gallium/drivers/freedreno/freedreno_blitter.c b/src/gallium/drivers/freedreno/freedreno_blitter.c
index aafb3a3b813..d45ae670c01 100644
--- a/src/gallium/drivers/freedreno/freedreno_blitter.c
+++ b/src/gallium/drivers/freedreno/freedreno_blitter.c
@@ -178,7 +178,10 @@ fd_blitter_clear(struct pipe_context *pctx, unsigned buffers,
 	struct pipe_framebuffer_state *pfb = &ctx->batch->framebuffer;
 	struct blitter_context *blitter = ctx->blitter;
 
-	fd_blitter_pipe_begin(ctx, false, true, FD_STAGE_CLEAR);
+	/* Note: don't use discard=true, if there was something to
+	 * discard, that would have been already handled in fd_clear().
+	 */
+	fd_blitter_pipe_begin(ctx, false, false, FD_STAGE_CLEAR);
 
 	util_blitter_common_clear_setup(blitter, pfb->width, pfb->height,
 			buffers, NULL, NULL);
@@ -228,7 +231,10 @@ fd_blitter_clear(struct pipe_context *pctx, unsigned buffers,
 		.max_index = 1,
 		.instance_count = 1,
 	};
-	ctx->draw_vbo(ctx, &info, 0);
+	pctx->draw_vbo(pctx, &info);
+
+	/* We expect that this should not have triggered a change in pfb: */
+	assert(util_framebuffer_state_equal(pfb, &ctx->framebuffer));
 
 	util_blitter_restore_constant_buffer_state(blitter);
 	util_blitter_restore_vertex_states(blitter);
diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c
index 6268729fcfc..c488f29854d 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -413,7 +413,7 @@ fd_context_init(struct fd_context *ctx, struct pipe_screen *pscreen,
 
 	ctx->primtypes = primtypes;
 	ctx->primtype_mask = 0;
-	for (i = 0; i < PIPE_PRIM_MAX; i++)
+	for (i = 0; i <= PIPE_PRIM_MAX; i++)
 		if (primtypes[i])
 			ctx->primtype_mask |= (1 << i);
 
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c
index a5dae976607..23404197bf1 100644
--- a/src/gallium/drivers/freedreno/freedreno_draw.c
+++ b/src/gallium/drivers/freedreno/freedreno_draw.c
@@ -223,7 +223,8 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
 		return;
 	}
 
-	if (!info->count_from_stream_output && !info->indirect &&
+	if (info->mode != PIPE_PRIM_MAX &&
+	    !info->count_from_stream_output && !info->indirect &&
 	    !info->primitive_restart &&
 	    !u_trim_pipe_prim(info->mode, (unsigned*)&info->count))
 		return;
@@ -287,7 +288,8 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
 	 * so keep the count accurate for non-patch geometry.
 	 */
 	unsigned prims;
-	if (info->mode != PIPE_PRIM_PATCHES)
+	if ((info->mode != PIPE_PRIM_PATCHES) &&
+			(info->mode != PIPE_PRIM_MAX))
 		prims = u_reduced_prims_for_vertices(info->mode, info->count);
 	else
 		prims = 0;



More information about the mesa-commit mailing list