diff options
author | Jason Ekstrand <[email protected]> | 2017-03-24 16:20:35 -0700 |
---|---|---|
committer | Andres Gomez <[email protected]> | 2017-03-30 16:32:39 +0300 |
commit | 0a9e06e5b911f19bca3a826f6d4d7cf038e2f823 (patch) | |
tree | 484605fae7717456da76d29eb1a9332679560bec /src/intel | |
parent | 6cabd40211413bbf780fa61949da7dde47608792 (diff) |
anv/blorp: Use anv_get_layerCount everywhere
Reviewed-by: Lionel Landwerlin <[email protected]>
Cc: "13.0 17.0" <[email protected]>
(cherry picked from commit 9319ef96fd5c2489754eae1b058e4087d7259341)
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/anv_blorp.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index dde0d96feab..42fce6f5323 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -227,7 +227,8 @@ void anv_CmdCopyImage( layer_count = pRegions[r].extent.depth; } else { dst_base_layer = pRegions[r].dstSubresource.baseArrayLayer; - layer_count = pRegions[r].dstSubresource.layerCount; + layer_count = + anv_get_layerCount(dst_image, &pRegions[r].dstSubresource); } unsigned src_base_layer; @@ -235,7 +236,8 @@ void anv_CmdCopyImage( src_base_layer = pRegions[r].srcOffset.z; } else { src_base_layer = pRegions[r].srcSubresource.baseArrayLayer; - assert(pRegions[r].srcSubresource.layerCount == layer_count); + assert(layer_count == + anv_get_layerCount(src_image, &pRegions[r].srcSubresource)); } assert(pRegions[r].srcSubresource.aspectMask == @@ -307,7 +309,8 @@ copy_buffer_to_image(struct anv_cmd_buffer *cmd_buffer, anv_sanitize_image_extent(anv_image->type, pRegions[r].imageExtent); if (anv_image->type != VK_IMAGE_TYPE_3D) { image.offset.z = pRegions[r].imageSubresource.baseArrayLayer; - extent.depth = pRegions[r].imageSubresource.layerCount; + extent.depth = + anv_get_layerCount(anv_image, &pRegions[r].imageSubresource); } const enum isl_format buffer_format = @@ -461,7 +464,7 @@ void anv_CmdBlitImage( dst_end = pRegions[r].dstOffsets[1].z; } else { dst_start = dst_res->baseArrayLayer; - dst_end = dst_start + dst_res->layerCount; + dst_end = dst_start + anv_get_layerCount(dst_image, dst_res); } unsigned src_start, src_end; @@ -471,7 +474,7 @@ void anv_CmdBlitImage( src_end = pRegions[r].srcOffsets[1].z; } else { src_start = src_res->baseArrayLayer; - src_end = src_start + src_res->layerCount; + src_end = src_start + anv_get_layerCount(src_image, src_res); } bool flip_z = flip_coords(&src_start, &src_end, &dst_start, &dst_end); @@ -1379,10 +1382,11 @@ void anv_CmdResolveImage( for (uint32_t r = 0; r < regionCount; r++) { assert(pRegions[r].srcSubresource.aspectMask == pRegions[r].dstSubresource.aspectMask); - assert(pRegions[r].srcSubresource.layerCount == - pRegions[r].dstSubresource.layerCount); + assert(anv_get_layerCount(src_image, &pRegions[r].srcSubresource) == + anv_get_layerCount(dst_image, &pRegions[r].dstSubresource)); - const uint32_t layer_count = pRegions[r].dstSubresource.layerCount; + const uint32_t layer_count = + anv_get_layerCount(dst_image, &pRegions[r].dstSubresource); for (uint32_t layer = 0; layer < layer_count; layer++) { resolve_image(&batch, |