diff options
author | Jason Ekstrand <[email protected]> | 2017-03-24 16:20:18 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-03-28 14:41:47 -0700 |
commit | 1b8fa8dd794c22aba43b16470e75ecaebf902b11 (patch) | |
tree | 4e31783c5d64fde8efc592255e3acbce0761d6df | |
parent | 93d61e494518a5dd170c2b098b2ed7a26465d049 (diff) |
anv: Make anv_get_layerCount a macro
Reviewed-by: Lionel Landwerlin <[email protected]>
Cc: "13.0 17.0" <[email protected]>
-rw-r--r-- | src/intel/vulkan/anv_private.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 27c887c65cc..74e80e8d537 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1828,13 +1828,13 @@ anv_layout_to_aux_usage(const struct gen_device_info * const devinfo, const struct anv_image *image, const VkImageAspectFlags aspects, const VkImageLayout layout); -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; -} + +/* This is defined as a macro so that it works for both + * VkImageSubresourceRange and VkImageSubresourceLayers + */ +#define anv_get_layerCount(_image, _range) \ + ((_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, |