From: Jason Ekstrand Date: Wed, 24 Feb 2016 19:38:14 +0000 (-0800) Subject: anv: Fill out image_param structs at view creation time X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7363024cbda0c513ad76d22580ce363f30ae1eda;p=mesa.git anv: Fill out image_param structs at view creation time --- diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 827c3ed4142..418a143b7bc 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -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; diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 4caab5804ae..72f29f1dba8 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -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 }; } diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 05cb77c5509..cb4f9736fdf 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -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 *