[Mesa-dev] [PATCH 1/2] radv/meta: just local vars for src/dst subresources.
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Wed Nov 23 23:45:00 UTC 2016
For the series:
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
On Thu, Nov 24, 2016 at 12:40 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This is just a cleanup before I rework this code to fix mirrored
> blits.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/amd/vulkan/radv_meta_blit.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_meta_blit.c b/src/amd/vulkan/radv_meta_blit.c
> index bfbf880..803855a 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
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list