anv/image: clflush the right state map in anv_fill_image_surface_state().
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 26 Jan 2016 22:45:46 +0000 (14:45 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 26 Jan 2016 23:14:50 +0000 (15:14 -0800)
It was clflushing the nonrt_surface_state structure regardless of
which state structure was actually being initialized.

src/vulkan/anv_image.c
src/vulkan/anv_private.h

index 3e344c3..d53363c 100644 (file)
@@ -402,7 +402,7 @@ anv_validate_CreateImageView(VkDevice _device,
 }
 
 void
-anv_fill_image_surface_state(struct anv_device *device, void *state_map,
+anv_fill_image_surface_state(struct anv_device *device, struct anv_state state,
                              struct anv_image_view *iview,
                              const VkImageViewCreateInfo *pCreateInfo,
                              VkImageUsageFlagBits usage)
@@ -410,18 +410,18 @@ anv_fill_image_surface_state(struct anv_device *device, void *state_map,
    switch (device->info.gen) {
    case 7:
       if (device->info.is_haswell)
-         gen75_fill_image_surface_state(device, state_map, iview,
+         gen75_fill_image_surface_state(device, state.map, iview,
                                         pCreateInfo, usage);
       else
-         gen7_fill_image_surface_state(device, state_map, iview,
+         gen7_fill_image_surface_state(device, state.map, iview,
                                        pCreateInfo, usage);
       break;
    case 8:
-      gen8_fill_image_surface_state(device, state_map, iview,
+      gen8_fill_image_surface_state(device, state.map, iview,
                                     pCreateInfo, usage);
       break;
    case 9:
-      gen9_fill_image_surface_state(device, state_map, iview,
+      gen9_fill_image_surface_state(device, state.map, iview,
                                     pCreateInfo, usage);
       break;
    default:
@@ -429,7 +429,7 @@ anv_fill_image_surface_state(struct anv_device *device, void *state_map,
    }
 
    if (!device->info.has_llc)
-      anv_state_clflush(iview->nonrt_surface_state);
+      anv_state_clflush(state);
 }
 
 static struct anv_state
@@ -505,7 +505,7 @@ anv_image_view_init(struct anv_image_view *iview,
    if (image->needs_nonrt_surface_state) {
       iview->nonrt_surface_state = alloc_surface_state(device, cmd_buffer);
 
-      anv_fill_image_surface_state(device, iview->nonrt_surface_state.map,
+      anv_fill_image_surface_state(device, iview->nonrt_surface_state,
                                    iview, pCreateInfo,
                                    VK_IMAGE_USAGE_SAMPLED_BIT);
    } else {
@@ -515,7 +515,7 @@ anv_image_view_init(struct anv_image_view *iview,
    if (image->needs_color_rt_surface_state) {
       iview->color_rt_surface_state = alloc_surface_state(device, cmd_buffer);
 
-      anv_fill_image_surface_state(device, iview->color_rt_surface_state.map,
+      anv_fill_image_surface_state(device, iview->color_rt_surface_state,
                                    iview, pCreateInfo,
                                    VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
    } else {
@@ -526,7 +526,7 @@ anv_image_view_init(struct anv_image_view *iview,
       iview->storage_surface_state = alloc_surface_state(device, cmd_buffer);
 
       if (has_matching_storage_typed_format(device, iview->format))
-         anv_fill_image_surface_state(device, iview->storage_surface_state.map,
+         anv_fill_image_surface_state(device, iview->storage_surface_state,
                                       iview, pCreateInfo,
                                       VK_IMAGE_USAGE_STORAGE_BIT);
       else
index 16ca0f5..a1a55dd 100644 (file)
@@ -1602,7 +1602,7 @@ void anv_image_view_init(struct anv_image_view *view,
                          struct anv_cmd_buffer *cmd_buffer);
 
 void
-anv_fill_image_surface_state(struct anv_device *device, void *state_map,
+anv_fill_image_surface_state(struct anv_device *device, struct anv_state state,
                              struct anv_image_view *iview,
                              const VkImageViewCreateInfo *pCreateInfo,
                              VkImageUsageFlagBits usage);