aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_clear.c
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2020-05-06 15:40:30 -0700
committerMarge Bot <[email protected]>2020-06-03 23:12:22 +0000
commit8252bb0ec6d429b09d944826d1ddbead69387f0f (patch)
tree42b41c0c94a42fc2f650ee6093d58f4f0f8e5847 /src/gallium/drivers/iris/iris_clear.c
parent4b00338bdee7f91f242a1152327cd01fe58c56bd (diff)
OPTIONAL: iris: Perform BLORP buffer barriers outside of iris_blorp_exec() hook.
The iris_blorp_exec() hook needs to be executed under a single indivisible sync region, which means that in cases where we need to emit a PIPE_CONTROL for a buffer barrier we won't be able to track the subsequent commands separately from the previous commands, which will prevent us from optimizing out subsequent PIPE_CONTROLs if we encounter the same buffers again. In particular I've encountered this situation in some SynMark test-cases which perform lots of BLORP operations with the same buffer bound as both source and destination (in order to generate mipmaps): In such a scenario if the source requires flushing we'd also end up flushing for the destination redundantly, even though a single PIPE_CONTROL would have been sufficient. This avoids a 4.5% FPS regression in SynMark OglHdrBloom and a 3.5% FPS regression in SynMark OglMultithread. Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3875>
Diffstat (limited to 'src/gallium/drivers/iris/iris_clear.c')
-rw-r--r--src/gallium/drivers/iris/iris_clear.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c
index 6d4f579ebf0..8fb95c8f790 100644
--- a/src/gallium/drivers/iris/iris_clear.c
+++ b/src/gallium/drivers/iris/iris_clear.c
@@ -378,6 +378,7 @@ clear_color(struct iris_context *ice,
iris_resource_prepare_render(ice, batch, res, level,
box->z, box->depth, aux_usage);
+ iris_emit_buffer_barrier_for(batch, res->bo, IRIS_DOMAIN_RENDER_WRITE);
struct blorp_surf surf;
iris_blorp_surf_for_resource(&batch->screen->isl_dev, &surf,
@@ -596,6 +597,7 @@ clear_depth_stencil(struct iris_context *ice,
if (clear_depth && z_res) {
iris_resource_prepare_depth(ice, batch, z_res, level, box->z, box->depth);
+ iris_emit_buffer_barrier_for(batch, z_res->bo, IRIS_DOMAIN_DEPTH_WRITE);
iris_blorp_surf_for_resource(&batch->screen->isl_dev,
&z_surf, &z_res->base, z_res->aux.usage,
level, true);
@@ -605,6 +607,8 @@ clear_depth_stencil(struct iris_context *ice,
if (stencil_mask) {
iris_resource_prepare_access(ice, stencil_res, level, 1, box->z,
box->depth, stencil_res->aux.usage, false);
+ iris_emit_buffer_barrier_for(batch, stencil_res->bo,
+ IRIS_DOMAIN_DEPTH_WRITE);
iris_blorp_surf_for_resource(&batch->screen->isl_dev,
&stencil_surf, &stencil_res->base,
stencil_res->aux.usage, level, true);