summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2019-06-20 13:38:56 +0200
committerIago Toral Quiroga <[email protected]>2019-07-02 08:57:20 +0200
commitc7dff0e614c93c1c890851456477723d5fb22495 (patch)
treec8b629a7d6267e6a678c5032277012d9397ca87e /src
parentc8dcc308ccfdd24a3c997d40a4852169ce7b58fb (diff)
v3d: keep track of resources written by transform feedback
The hardware provides a feature to sync reads from previous transform feedback writes in the same job so if we use this mechanism we no longer have to flush the job. In order to identify this scenario we need a mechanism to identify resources that are written by transform feedback. v2: use _mesa_pointer_set_create (Eric) Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/v3d/v3d_context.h2
-rw-r--r--src/gallium/drivers/v3d/v3d_job.c11
-rw-r--r--src/gallium/drivers/v3d/v3dx_emit.c4
3 files changed, 15 insertions, 2 deletions
diff --git a/src/gallium/drivers/v3d/v3d_context.h b/src/gallium/drivers/v3d/v3d_context.h
index 21db9997c90..7c8952ebb74 100644
--- a/src/gallium/drivers/v3d/v3d_context.h
+++ b/src/gallium/drivers/v3d/v3d_context.h
@@ -297,6 +297,7 @@ struct v3d_job {
uint32_t referenced_size;
struct set *write_prscs;
+ struct set *tf_write_prscs;
/* Size of the submit.bo_handles array. */
uint32_t bo_handles_size;
@@ -589,6 +590,7 @@ struct v3d_job *v3d_get_job(struct v3d_context *v3d,
struct v3d_job *v3d_get_job_for_fbo(struct v3d_context *v3d);
void v3d_job_add_bo(struct v3d_job *job, struct v3d_bo *bo);
void v3d_job_add_write_resource(struct v3d_job *job, struct pipe_resource *prsc);
+void v3d_job_add_tf_write_resource(struct v3d_job *job, struct pipe_resource *prsc);
void v3d_job_submit(struct v3d_context *v3d, struct v3d_job *job);
void v3d_flush_jobs_using_bo(struct v3d_context *v3d, struct v3d_bo *bo);
void v3d_flush_jobs_writing_resource(struct v3d_context *v3d,
diff --git a/src/gallium/drivers/v3d/v3d_job.c b/src/gallium/drivers/v3d/v3d_job.c
index 487f514a055..6f3fa709616 100644
--- a/src/gallium/drivers/v3d/v3d_job.c
+++ b/src/gallium/drivers/v3d/v3d_job.c
@@ -158,6 +158,17 @@ v3d_flush_jobs_using_bo(struct v3d_context *v3d, struct v3d_bo *bo)
}
void
+v3d_job_add_tf_write_resource(struct v3d_job *job, struct pipe_resource *prsc)
+{
+ v3d_job_add_write_resource(job, prsc);
+
+ if (!job->tf_write_prscs)
+ job->tf_write_prscs = _mesa_pointer_set_create(job);
+
+ _mesa_set_add(job->tf_write_prscs, prsc);
+}
+
+void
v3d_flush_jobs_writing_resource(struct v3d_context *v3d,
struct pipe_resource *prsc)
{
diff --git a/src/gallium/drivers/v3d/v3dx_emit.c b/src/gallium/drivers/v3d/v3dx_emit.c
index c54e63f7efe..a3d32f4b7d7 100644
--- a/src/gallium/drivers/v3d/v3dx_emit.c
+++ b/src/gallium/drivers/v3d/v3dx_emit.c
@@ -766,8 +766,8 @@ v3dX(emit_state)(struct pipe_context *pctx)
};
#endif /* V3D_VERSION < 40 */
if (target) {
- v3d_job_add_write_resource(v3d->job,
- target->buffer);
+ v3d_job_add_tf_write_resource(v3d->job,
+ target->buffer);
}
/* XXX: buffer_size? */
}