From 39df568ca1c62929044bce4967ad0f17eeb35d36 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Tue, 23 Jul 2019 11:28:52 +0200 Subject: [PATCH] v3d: refactor v3d_tf_statistics_record slightly Reviewed-by: Eric Anholt --- src/gallium/drivers/v3d/v3dx_draw.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index ff34b8d049b..c78ccdef867 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -550,8 +550,7 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d, */ static void v3d_tf_statistics_record(struct v3d_context *v3d, - const struct pipe_draw_info *info, - bool prim_tf) + const struct pipe_draw_info *info) { if (!v3d->active_queries) return; @@ -559,10 +558,11 @@ v3d_tf_statistics_record(struct v3d_context *v3d, uint32_t prims = u_prims_for_vertices(info->mode, info->count); v3d->prims_generated += prims; - if (prim_tf) { - /* XXX: Only count if we didn't overflow. */ - v3d->tf_prims_generated += prims; - } + if (v3d->streamout.num_targets <= 0) + return; + + /* XXX: Only count if we didn't overflow. */ + v3d->tf_prims_generated += prims; } static void @@ -757,7 +757,7 @@ v3d_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) prim_tf_enable = (V3D_PRIM_POINTS_TF - V3D_PRIM_POINTS); #endif - v3d_tf_statistics_record(v3d, info, v3d->streamout.num_targets); + v3d_tf_statistics_record(v3d, info); /* Note that the primitive type fields match with OpenGL/gallium * definitions, up to but not including QUADS. -- 2.30.2