diff options
author | Nanley Chery <[email protected]> | 2016-03-04 20:41:05 -0800 |
---|---|---|
committer | Nanley Chery <[email protected]> | 2016-03-04 21:25:23 -0800 |
commit | 4e75f9b219f674ea79e6d521dd8a6b1ccd8b3c10 (patch) | |
tree | 6515760edb85082dbb9e986833e8c4164d7f098b /src/intel/vulkan/anv_private.h | |
parent | c1436e80efee072f1fc3e3b4af0d5e7ad9dd3fb7 (diff) |
anv: Implement VK_REMAINING_{MIP_LEVELS,ARRAY_LAYERS}
v2: Subtract the baseMipLevel and baseArrayLayer (Jason)
Signed-off-by: Nanley Chery <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r-- | src/intel/vulkan/anv_private.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index cb4f9736fdf..f87270466ae 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1641,6 +1641,23 @@ struct anv_image { }; }; +static inline uint32_t +anv_get_layerCount(const struct anv_image *image, + const VkImageSubresourceRange *range) +{ + return range->layerCount == VK_REMAINING_ARRAY_LAYERS ? + image->array_size - range->baseArrayLayer : range->layerCount; +} + +static inline uint32_t +anv_get_levelCount(const struct anv_image *image, + const VkImageSubresourceRange *range) +{ + return range->levelCount == VK_REMAINING_MIP_LEVELS ? + image->levels - range->baseMipLevel : range->levelCount; +} + + struct anv_image_view { const struct anv_image *image; /**< VkImageViewCreateInfo::image */ struct anv_bo *bo; |