From: Iago Toral Quiroga Date: Tue, 23 Jul 2019 09:28:52 +0000 (+0200) Subject: v3d: refactor v3d_tf_statistics_record slightly X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=39df568ca1c62929044bce4967ad0f17eeb35d36;p=mesa.git v3d: refactor v3d_tf_statistics_record slightly Reviewed-by: Eric Anholt --- 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.