From: Francisco Jerez Date: Tue, 26 Jan 2016 22:45:46 +0000 (-0800) Subject: anv/image: clflush the right state map in anv_fill_image_surface_state(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fc7a7b31c5c7d5030b4cffc7fff011962969db47;p=mesa.git anv/image: clflush the right state map in anv_fill_image_surface_state(). It was clflushing the nonrt_surface_state structure regardless of which state structure was actually being initialized. --- diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c index 3e344c3aa71..d53363c627d 100644 --- a/src/vulkan/anv_image.c +++ b/src/vulkan/anv_image.c @@ -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 diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index 16ca0f5ce48..a1a55ddca6b 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -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);