Mesa (master): v3d: add a helper to check if transform feedback is enabled

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 21 06:10:44 UTC 2019


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

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Wed Jun 19 10:23:43 2019 +0200

v3d: add a helper to check if transform feedback is enabled

v2: We should be safe assuming that bind_vs != NULL (Eric)

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/gallium/drivers/v3d/v3d_context.h | 7 +++++++
 src/gallium/drivers/v3d/v3dx_emit.c   | 3 +--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/v3d/v3d_context.h b/src/gallium/drivers/v3d/v3d_context.h
index 3ab227afb6c..21db9997c90 100644
--- a/src/gallium/drivers/v3d/v3d_context.h
+++ b/src/gallium/drivers/v3d/v3d_context.h
@@ -569,6 +569,13 @@ v3d_ioctl(int fd, unsigned long request, void *arg)
                 return drmIoctl(fd, request, arg);
 }
 
+static inline bool
+v3d_transform_feedback_enabled(struct v3d_context *v3d)
+{
+        return v3d->prog.bind_vs->num_tf_specs != 0 &&
+               v3d->active_queries;
+}
+
 void v3d_set_shader_uniform_dirty_flags(struct v3d_compiled_shader *shader);
 struct v3d_cl_reloc v3d_write_uniforms(struct v3d_context *v3d,
                                        struct v3d_compiled_shader *shader,
diff --git a/src/gallium/drivers/v3d/v3dx_emit.c b/src/gallium/drivers/v3d/v3dx_emit.c
index 2063f5e1162..c54e63f7efe 100644
--- a/src/gallium/drivers/v3d/v3dx_emit.c
+++ b/src/gallium/drivers/v3d/v3dx_emit.c
@@ -701,8 +701,7 @@ v3dX(emit_state)(struct pipe_context *pctx)
                                               v3d->prog.bind_vs->tf_specs);
 
 #if V3D_VERSION >= 40
-                        bool tf_enabled = (v3d->prog.bind_vs->num_tf_specs != 0 &&
-                                           v3d->active_queries);
+                        bool tf_enabled = v3d_transform_feedback_enabled(v3d);
                         job->tf_enabled |= tf_enabled;
 
                         cl_emit(&job->bcl, TRANSFORM_FEEDBACK_SPECS, tfe) {




More information about the mesa-commit mailing list