summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2016-02-27 13:29:04 -0800
committerNanley Chery <[email protected]>2016-03-03 11:24:42 -0800
commitd1e48b994565c1d6c1cfa546ba7ab09145c12601 (patch)
tree834b1283a4ede7b2ac1aa8c9438a4e6b842ee139
parentcfe70367503ffb49a850a17e03f4c7e4138af4f1 (diff)
anv/meta: Remove redundancies in do_buffer_copy()
Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/intel/vulkan/anv_meta_blit.c46
1 files changed, 18 insertions, 28 deletions
diff --git a/src/intel/vulkan/anv_meta_blit.c b/src/intel/vulkan/anv_meta_blit.c
index 9d41add6079..478b1997172 100644
--- a/src/intel/vulkan/anv_meta_blit.c
+++ b/src/intel/vulkan/anv_meta_blit.c
@@ -446,39 +446,29 @@ do_buffer_copy(struct anv_cmd_buffer *cmd_buffer,
anv_image_from_handle(dest_image)->bo = dest;
anv_image_from_handle(dest_image)->offset = dest_offset;
+ VkImageViewCreateInfo iview_info = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
+ .image = 0, /* TEMPLATE */
+ .viewType = VK_IMAGE_VIEW_TYPE_2D,
+ .format = copy_format,
+ .subresourceRange = {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1
+ },
+ };
+
struct anv_image_view src_iview;
+ iview_info.image = src_image;
anv_image_view_init(&src_iview, cmd_buffer->device,
- &(VkImageViewCreateInfo) {
- .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
- .image = src_image,
- .viewType = VK_IMAGE_VIEW_TYPE_2D,
- .format = copy_format,
- .subresourceRange = {
- .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
- .baseMipLevel = 0,
- .levelCount = 1,
- .baseArrayLayer = 0,
- .layerCount = 1
- },
- },
- cmd_buffer, 0, VK_IMAGE_USAGE_SAMPLED_BIT);
+ &iview_info, cmd_buffer, 0, VK_IMAGE_USAGE_SAMPLED_BIT);
struct anv_image_view dest_iview;
+ iview_info.image = dest_image;
anv_image_view_init(&dest_iview, cmd_buffer->device,
- &(VkImageViewCreateInfo) {
- .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
- .image = dest_image,
- .viewType = VK_IMAGE_VIEW_TYPE_2D,
- .format = copy_format,
- .subresourceRange = {
- .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
- .baseMipLevel = 0,
- .levelCount = 1,
- .baseArrayLayer = 0,
- .layerCount = 1,
- },
- },
- cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+ &iview_info, cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
meta_emit_blit(cmd_buffer,
anv_image_from_handle(src_image),