iris: consider framebuffer parameter for aux usages
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 10 Dec 2018 03:07:13 +0000 (19:07 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:12 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_context.h
src/gallium/drivers/iris/iris_draw.c
src/gallium/drivers/iris/iris_resolve.c

index 1f8e000bd671e4332cd748b92a2917b6c5c00dc3..4fa48abb4575e18e92e8ea6583357855142c0ed7 100644 (file)
@@ -706,7 +706,8 @@ uint64_t iris_timebase_scale(const struct gen_device_info *devinfo,
 void iris_predraw_resolve_inputs(struct iris_context *ice,
                                  struct iris_batch *batch,
                                  struct iris_shader_state *shs,
-                                 bool *draw_aux_buffer_disabled);
+                                 bool *draw_aux_buffer_disabled,
+                                 bool consider_framebuffer);
 void iris_predraw_resolve_framebuffer(struct iris_context *ice,
                                       struct iris_batch *batch,
                                       bool *draw_aux_buffer_disabled);
index 5ccef66ea915c0bf7a9b3477ffa174896313b0f7..4d2ea3a03e805666182953bb37ef79bf88938a63 100644 (file)
@@ -103,7 +103,7 @@ iris_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
    for (gl_shader_stage stage = 0; stage < MESA_SHADER_COMPUTE; stage++) {
       if (ice->shaders.prog[stage])
          iris_predraw_resolve_inputs(ice,batch, &ice->state.shaders[stage],
-                                     draw_aux_buffer_disabled);
+                                     draw_aux_buffer_disabled, true);
    }
    iris_predraw_resolve_framebuffer(ice, batch, draw_aux_buffer_disabled);
 
index eb8552a3acab6baf704fe864a695a6f0fc9349ba..4c3b1bdfabbe8bb9c2456bded2bc61971edc4f1b 100644 (file)
@@ -83,7 +83,8 @@ static void
 resolve_sampler_views(struct iris_context *ice,
                       struct iris_batch *batch,
                       struct iris_shader_state *shs,
-                      bool *draw_aux_buffer_disabled)
+                      bool *draw_aux_buffer_disabled,
+                      bool consider_framebuffer)
 {
    uint32_t views = shs->bound_sampler_views;
 
@@ -97,7 +98,7 @@ resolve_sampler_views(struct iris_context *ice,
       if (res->base.target == PIPE_BUFFER)
          continue;
 
-      if (batch->name != IRIS_BATCH_COMPUTE) {
+      if (consider_framebuffer) {
          disable_rb_aux_buffer(ice, draw_aux_buffer_disabled,
                                res, isv->view.base_level, isv->view.levels,
                                "for sampling");
@@ -117,7 +118,8 @@ static void
 resolve_image_views(struct iris_context *ice,
                     struct iris_batch *batch,
                     struct iris_shader_state *shs,
-                    bool *draw_aux_buffer_disabled)
+                    bool *draw_aux_buffer_disabled,
+                    bool consider_framebuffer)
 {
    uint32_t views = shs->bound_image_views;
 
@@ -128,7 +130,7 @@ resolve_image_views(struct iris_context *ice,
       if (res->base.target == PIPE_BUFFER)
          continue;
 
-      if (batch->name != IRIS_BATCH_COMPUTE) {
+      if (consider_framebuffer) {
          disable_rb_aux_buffer(ice, draw_aux_buffer_disabled,
                                res, 0, ~0, "as a shader image");
       }
@@ -150,10 +152,11 @@ void
 iris_predraw_resolve_inputs(struct iris_context *ice,
                             struct iris_batch *batch,
                             struct iris_shader_state *shs,
-                            bool *draw_aux_buffer_disabled)
+                            bool *draw_aux_buffer_disabled,
+                            bool consider_framebuffer)
 {
-   resolve_sampler_views(ice, batch, shs, draw_aux_buffer_disabled);
-   resolve_image_views(ice, batch, shs, draw_aux_buffer_disabled);
+   resolve_sampler_views(ice, batch, shs, draw_aux_buffer_disabled, consider_framebuffer);
+   resolve_image_views(ice, batch, shs, draw_aux_buffer_disabled, consider_framebuffer);
 
    // XXX: ASTC hacks
 }