summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/v3d/v3d_context.h
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2019-08-12 08:36:37 +0200
committerIago Toral Quiroga <itoral@igalia.com>2019-08-13 08:25:15 +0200
commitb594796f1b86952268372622ba844210fa54f6e5 (patch)
tree791637d183fe229a1f3246567cd373b012a01976 /src/gallium/drivers/v3d/v3d_context.h
parentf1cf1153e800f3854279d2459f3191441634beff (diff)
v3d: do not automatically flush current job for SSBOs and shader images
If the current job has a sequence of draw calls involving SSBOs and/or shader images, we would flush the job in between each draw call. With this change, we won't flush the current job and we rely on the application inserting correct barriers by issuing glMemoryBarrier() when needed. v2 (Eric): - When mapping a buffer for writing, we always need to flush. Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/gallium/drivers/v3d/v3d_context.h')
-rw-r--r--src/gallium/drivers/v3d/v3d_context.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gallium/drivers/v3d/v3d_context.h b/src/gallium/drivers/v3d/v3d_context.h
index b2c917df240..133a3fcf095 100644
--- a/src/gallium/drivers/v3d/v3d_context.h
+++ b/src/gallium/drivers/v3d/v3d_context.h
@@ -117,6 +117,23 @@ enum v3d_sampler_state_variant {
V3D_SAMPLER_STATE_VARIANT_COUNT,
};
+enum v3d_flush_cond {
+ /* Flush job unless we are flushing for transform feedback, where we
+ * handle flushing in the driver via the 'Wait for TF' packet.
+ */
+ V3D_FLUSH_DEFAULT,
+ /* Always flush the job, even for cases where we would normally not
+ * do it, such as transform feedback.
+ */
+ V3D_FLUSH_ALWAYS,
+ /* Flush job if it is not the current FBO job. This is intended to
+ * skip automatic flushes of the current job for resources that we
+ * expect to be externally synchronized by the application using
+ * glMemoryBarrier(), such as SSBOs and shader images.
+ */
+ V3D_FLUSH_NOT_CURRENT_JOB,
+};
+
struct v3d_sampler_view {
struct pipe_sampler_view base;
uint32_t p0;
@@ -615,9 +632,10 @@ 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,
struct pipe_resource *prsc,
- bool always_flush);
+ enum v3d_flush_cond flush_cond);
void v3d_flush_jobs_reading_resource(struct v3d_context *v3d,
- struct pipe_resource *prsc);
+ struct pipe_resource *prsc,
+ enum v3d_flush_cond flush_cond);
void v3d_update_compiled_shaders(struct v3d_context *v3d, uint8_t prim_mode);
void v3d_update_compiled_cs(struct v3d_context *v3d);