v3d: refactor v3d_tf_statistics_record slightly
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 23 Jul 2019 09:28:52 +0000 (11:28 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Fri, 26 Jul 2019 06:29:41 +0000 (08:29 +0200)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/drivers/v3d/v3dx_draw.c

index ff34b8d049bb102b3fd337ce5e7ca3573e16f9e1..c78ccdef8673ad6096874cb934d2ff97fc9b9888 100644 (file)
@@ -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.