[Mesa-stable] [PATCH 2/2] anv/blorp: Use anv_get_layerCount everywhere

Jason Ekstrand jason at jlekstrand.net
Mon Mar 27 14:44:54 UTC 2017


Cc: "13.0 17.0" <mesa-stable at lists.freedesktop.org>
---
 src/intel/vulkan/anv_blorp.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
index 9b3910f..0689142 100644
--- a/src/intel/vulkan/anv_blorp.c
+++ b/src/intel/vulkan/anv_blorp.c
@@ -232,7 +232,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;
@@ -240,7 +241,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 ==
@@ -312,7 +314,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 =
@@ -466,7 +469,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;
@@ -476,7 +479,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);
@@ -1406,10 +1409,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,
-- 
2.5.0.400.gff86faf



More information about the mesa-stable mailing list