From a9652fe58853c16f5a70327bb3f788a90893f72b Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 31 Oct 2022 16:58:28 -0700 Subject: [PATCH] iris: Drop disable_rb_aux_buffer handling for image views The goal here is to support OpenGL 4.6 section 9.3, "Feedback Loops Between Textures and the Framebuffer" (from GL_ARB_texture_barrier) where you can bind an image as both a framebuffer attachment and a texture, and simultaneously sample-from and render-to it. I'm not aware of any spec language that requires us to handle simultaneously accessing something as a framebuffer attachment and an image load/store resource. GL_ARB_shader_image_load_store tends to make flushing and synchronization something the app has to handle explicitly rather than something the driver needs to do implicitly. Reviewed-by: Nanley Chery Part-of: --- src/gallium/drivers/iris/iris_resolve.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index 789d197..454d493 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -37,10 +37,9 @@ #include "compiler/nir/nir.h" /** - * Disable auxiliary buffers if a renderbuffer is also bound as a texture - * or shader image. This causes a self-dependency, where both rendering - * and sampling may concurrently read or write the CCS buffer, causing - * incorrect pixels. + * Disable auxiliary buffers if a renderbuffer is also bound as a texture. + * This causes a self-dependency, where both rendering and sampling may + * concurrently read or write the CCS buffer, causing incorrect pixels. */ static bool disable_rb_aux_buffer(struct iris_context *ice, @@ -121,9 +120,7 @@ static void resolve_image_views(struct iris_context *ice, struct iris_batch *batch, struct iris_shader_state *shs, - const struct shader_info *info, - bool *draw_aux_buffer_disabled, - bool consider_framebuffer) + const struct shader_info *info) { if (info == NULL) return; @@ -138,12 +135,6 @@ resolve_image_views(struct iris_context *ice, struct iris_resource *res = (void *) pview->resource; if (res->base.b.target != PIPE_BUFFER) { - if (consider_framebuffer) { - disable_rb_aux_buffer(ice, draw_aux_buffer_disabled, - res, pview->u.tex.level, 1, - "as a shader image"); - } - unsigned num_layers = pview->u.tex.last_layer - pview->u.tex.first_layer + 1; @@ -182,8 +173,7 @@ iris_predraw_resolve_inputs(struct iris_context *ice, if (ice->state.stage_dirty & stage_dirty) { resolve_sampler_views(ice, batch, shs, info, draw_aux_buffer_disabled, consider_framebuffer); - resolve_image_views(ice, batch, shs, info, draw_aux_buffer_disabled, - consider_framebuffer); + resolve_image_views(ice, batch, shs, info); } } -- 2.7.4