summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-11-23 23:35:41 +0000
committerDave Airlie <airlied@redhat.com>2016-11-23 23:49:23 +0000
commitb06568873d8a6dc6566c40fe6eb3bc33eef76098 (patch)
tree94e7b455325ab4ddd1bdaacd767715609b4d020f
parent28c781b574605edd713526581daec1c464d1aff3 (diff)
radv/meta: just local vars for src/dst subresources.
This is just a cleanup before I rework this code to fix mirrored blits. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/amd/vulkan/radv_meta_blit.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/amd/vulkan/radv_meta_blit.c b/src/amd/vulkan/radv_meta_blit.c
index bfbf880dce..803855a48f 100644
--- a/src/amd/vulkan/radv_meta_blit.c
+++ b/src/amd/vulkan/radv_meta_blit.c
@@ -488,6 +488,8 @@ void radv_CmdBlitImage(
radv_meta_save_graphics_reset_vport_scissor(&saved_state, cmd_buffer);
for (unsigned r = 0; r < regionCount; r++) {
+ const VkImageSubresourceLayers *src_res = &pRegions[r].srcSubresource;
+ const VkImageSubresourceLayers *dst_res = &pRegions[r].dstSubresource;
struct radv_image_view src_iview;
radv_image_view_init(&src_iview, cmd_buffer->device,
&(VkImageViewCreateInfo) {
@@ -496,10 +498,10 @@ void radv_CmdBlitImage(
.viewType = radv_meta_get_view_type(src_image),
.format = src_image->vk_format,
.subresourceRange = {
- .aspectMask = pRegions[r].srcSubresource.aspectMask,
- .baseMipLevel = pRegions[r].srcSubresource.mipLevel,
+ .aspectMask = src_res->aspectMask,
+ .baseMipLevel = src_res->mipLevel,
.levelCount = 1,
- .baseArrayLayer = pRegions[r].srcSubresource.baseArrayLayer,
+ .baseArrayLayer = src_res->baseArrayLayer,
.layerCount = 1
},
},
@@ -524,12 +526,12 @@ void radv_CmdBlitImage(
};
- if (pRegions[r].srcSubresource.layerCount > 1)
+ if (src_res->layerCount > 1)
radv_finishme("FINISHME: copy multiple array layers");
struct radv_image_view dest_iview;
unsigned usage;
- if (pRegions[r].dstSubresource.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT)
+ if (dst_res->aspectMask == VK_IMAGE_ASPECT_COLOR_BIT)
usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
else
usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
@@ -547,7 +549,7 @@ void radv_CmdBlitImage(
.z = i,
};
const uint32_t dest_array_slice =
- radv_meta_get_iview_layer(dest_image, &pRegions[r].dstSubresource,
+ radv_meta_get_iview_layer(dest_image, dst_res,
&dest_offset);
radv_image_view_init(&dest_iview, cmd_buffer->device,
@@ -557,8 +559,8 @@ void radv_CmdBlitImage(
.viewType = radv_meta_get_view_type(dest_image),
.format = dest_image->vk_format,
.subresourceRange = {
- .aspectMask = pRegions[r].dstSubresource.aspectMask,
- .baseMipLevel = pRegions[r].dstSubresource.mipLevel,
+ .aspectMask = dst_res->aspectMask,
+ .baseMipLevel = dst_res->mipLevel,
.levelCount = 1,
.baseArrayLayer = dest_array_slice,
.layerCount = 1