anv: Fill out image_param structs at view creation time
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 24 Feb 2016 19:38:14 +0000 (11:38 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 27 Feb 2016 18:26:14 +0000 (10:26 -0800)
src/intel/vulkan/anv_cmd_buffer.c
src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_private.h

index 827c3ed4142dbf77c01c5a23bc3da63bf82e0a79..418a143b7bcbc23a64eb383e86b784281d639148 100644 (file)
@@ -812,8 +812,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
          struct brw_image_param *image_param =
             &cmd_buffer->state.push_constants[stage]->images[image++];
 
-         anv_image_view_fill_image_param(cmd_buffer->device, desc->image_view,
-                                         image_param);
+         *image_param = desc->image_view->storage_image_param;
          image_param->surface_idx = bias + s;
          break;
       }
@@ -838,8 +837,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
          struct brw_image_param *image_param =
             &cmd_buffer->state.push_constants[stage]->images[image++];
 
-         anv_buffer_view_fill_image_param(cmd_buffer->device, desc->buffer_view,
-                                          image_param);
+         *image_param = desc->buffer_view->storage_image_param;
          image_param->surface_idx = bias + s;
          break;
 
index 4caab5804ae3eec19d46711880e33d11fcb5694d..72f29f1dba8c0ee0e507f98315013ce900cc260d 100644 (file)
@@ -630,6 +630,9 @@ anv_image_view_init(struct anv_image_view *iview,
                                        iview->bo->size - iview->offset, 1);
       }
 
+      anv_image_view_fill_image_param(device, iview,
+                                      &iview->storage_image_param);
+
       if (!device->info.has_llc)
          anv_state_clflush(iview->storage_surface_state);
    } else {
@@ -734,6 +737,8 @@ anv_CreateBufferView(VkDevice _device,
                                     (storage_format == ISL_FORMAT_RAW ? 1 :
                                      format->isl_layout->bs));
 
+      anv_buffer_view_fill_image_param(device, view,
+                                       &view->storage_image_param);
    } else {
       view->storage_surface_state = (struct anv_state){ 0 };
    }
index 05cb77c5509d1c1c3774fdbe41255b7817bc1320..cb4f9736fdf0f62f04ae8ea41dae036cc2c3edea 100644 (file)
@@ -41,6 +41,7 @@
 #endif
 
 #include "brw_device_info.h"
+#include "brw_compiler.h"
 #include "util/macros.h"
 #include "util/list.h"
 
@@ -1659,6 +1660,8 @@ struct anv_image_view {
 
    /** RENDER_SURFACE_STATE when using image as a storage image. */
    struct anv_state storage_surface_state;
+
+   struct brw_image_param storage_image_param;
 };
 
 struct anv_image_create_info {
@@ -1717,6 +1720,8 @@ struct anv_buffer_view {
 
    struct anv_state surface_state;
    struct anv_state storage_surface_state;
+
+   struct brw_image_param storage_image_param;
 };
 
 const struct anv_format *