diff options
author | Chia-I Wu <[email protected]> | 2019-01-10 11:58:07 -0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2019-03-11 10:01:41 -0700 |
commit | 1085df8176cbc18c5ad59bed3906e27c26ab1766 (patch) | |
tree | 39eb0621d6ce36c4d3df0939aef22a2056c786d9 /src/freedreno/vulkan/tu_private.h | |
parent | 992ecdd40ebc2e027b39f98a92bdab953eedd5d5 (diff) |
turnip: preliminary support for tu_image_view_init
Diffstat (limited to 'src/freedreno/vulkan/tu_private.h')
-rw-r--r-- | src/freedreno/vulkan/tu_private.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h index 4f593c9978f..5c4e9e814df 100644 --- a/src/freedreno/vulkan/tu_private.h +++ b/src/freedreno/vulkan/tu_private.h @@ -941,6 +941,8 @@ struct tu_image VkImageTiling tiling; /** VkImageCreateInfo::tiling */ VkImageCreateFlags flags; /** VkImageCreateInfo::flags */ VkExtent3D extent; + uint32_t level_count; + uint32_t layer_count; VkDeviceSize size; uint32_t alignment; @@ -971,14 +973,18 @@ static inline uint32_t tu_get_layerCount(const struct tu_image *image, const VkImageSubresourceRange *range) { - abort(); + return range->layerCount == VK_REMAINING_ARRAY_LAYERS + ? image->layer_count - range->baseArrayLayer + : range->layerCount; } static inline uint32_t tu_get_levelCount(const struct tu_image *image, const VkImageSubresourceRange *range) { - abort(); + return range->levelCount == VK_REMAINING_MIP_LEVELS + ? image->level_count - range->baseMipLevel + : range->levelCount; } struct tu_image_view |