From a014143f876c5ac5c5c7a1cea56f7cacaf3a5cb7 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 27 Oct 2015 19:55:05 +0800 Subject: [PATCH] bug 15000: aspect/aspectMask inconsistencies (WIP) Rename all aspect to aspectMask. https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15000 --- demos/cube.c | 2 +- demos/tri.c | 2 +- include/vulkan.h | 6 +++--- layers/image.cpp | 10 +++++----- layers/param_checker.cpp | 12 ++++++------ 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/demos/cube.c b/demos/cube.c index aff26b0..f837589 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1075,7 +1075,7 @@ static void demo_prepare_texture_image(struct demo *demo, if (required_props & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { const VkImageSubresource subres = { - .aspect = VK_IMAGE_ASPECT_COLOR_BIT, + .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, .mipLevel = 0, .arrayLayer = 0, }; diff --git a/demos/tri.c b/demos/tri.c index 3e92531..891555e 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -829,7 +829,7 @@ static void demo_prepare_texture_image(struct demo *demo, if (required_props & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { const VkImageSubresource subres = { - .aspect = VK_IMAGE_ASPECT_COLOR_BIT, + .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, .mipLevel = 0, .arrayLayer = 0, }; diff --git a/include/vulkan.h b/include/vulkan.h index efedb8c..a819d9b 100644 --- a/include/vulkan.h +++ b/include/vulkan.h @@ -832,6 +832,7 @@ typedef enum { VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, } VkImageAspectFlagBits; +typedef VkFlags VkImageAspectFlags; typedef enum { VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, @@ -894,7 +895,6 @@ typedef enum { typedef VkFlags VkBufferUsageFlags; typedef VkFlags VkBufferViewCreateFlags; typedef VkFlags VkImageViewCreateFlags; -typedef VkFlags VkImageAspectFlags; typedef VkFlags VkShaderModuleCreateFlags; typedef VkFlags VkShaderCreateFlags; @@ -1393,7 +1393,7 @@ typedef struct { } VkMemoryRequirements; typedef struct { - VkImageAspectFlagBits aspect; + VkImageAspectFlags aspectMask; VkExtent3D imageGranularity; VkSparseImageFormatFlags flags; } VkSparseImageFormatProperties; @@ -1427,7 +1427,7 @@ typedef struct { } VkSparseImageOpaqueMemoryBindInfo; typedef struct { - VkImageAspectFlagBits aspect; + VkImageAspectFlags aspectMask; uint32_t mipLevel; uint32_t arrayLayer; } VkImageSubresource; diff --git a/layers/image.cpp b/layers/image.cpp index 5420d4f..c84fa9c 100644 --- a/layers/image.cpp +++ b/layers/image.cpp @@ -911,17 +911,17 @@ VK_LAYER_EXPORT void VKAPI vkGetImageSubresourceLayout( if (imageEntry != device_data->imageMap.end()) { format = imageEntry->second.format; if (vk_format_is_color(format)) { - if (pSubresource->aspect != VK_IMAGE_ASPECT_COLOR_BIT) { + if (pSubresource->aspectMask != VK_IMAGE_ASPECT_COLOR_BIT) { std::stringstream ss; - ss << "vkGetImageSubresourceLayout: For color formats, the aspect field of VkImageSubresource must be VK_IMAGE_ASPECT_COLOR."; + ss << "vkGetImageSubresourceLayout: For color formats, the aspectMask field of VkImageSubresource must be VK_IMAGE_ASPECT_COLOR."; skipCall |= log_msg(device_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_IMAGE, (uint64_t)image, 0, IMAGE_INVALID_IMAGE_ASPECT, "IMAGE", ss.str().c_str()); } } else if (vk_format_is_depth_or_stencil(format)) { - if ((pSubresource->aspect != VK_IMAGE_ASPECT_DEPTH_BIT) && - (pSubresource->aspect != VK_IMAGE_ASPECT_STENCIL_BIT)) { + if ((pSubresource->aspectMask != VK_IMAGE_ASPECT_DEPTH_BIT) && + (pSubresource->aspectMask != VK_IMAGE_ASPECT_STENCIL_BIT)) { std::stringstream ss; - ss << "vkGetImageSubresourceLayout: For depth/stencil formats, the aspect selects either the depth or stencil image aspect."; + ss << "vkGetImageSubresourceLayout: For depth/stencil formats, the aspectMask selects either the depth or stencil image aspectMask."; skipCall |= log_msg(device_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_IMAGE, (uint64_t)image, 0, IMAGE_INVALID_IMAGE_ASPECT, "IMAGE", ss.str().c_str()); } diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp index ad1f2e8..0aff450 100644 --- a/layers/param_checker.cpp +++ b/layers/param_checker.cpp @@ -2492,11 +2492,11 @@ bool PostGetImageSparseMemoryRequirements( if(pSparseMemoryRequirements != nullptr) { - if ((pSparseMemoryRequirements->formatProperties.aspect & + if ((pSparseMemoryRequirements->formatProperties.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", - "vkGetImageSparseMemoryRequirements parameter, VkImageAspect pSparseMemoryRequirements->formatProperties.aspect, is an unrecognized enumerator"); + "vkGetImageSparseMemoryRequirements parameter, VkImageAspect pSparseMemoryRequirements->formatProperties.aspectMask, is an unrecognized enumerator"); return false; } } @@ -2558,11 +2558,11 @@ bool PostGetPhysicalDeviceSparseImageFormatProperties( if(pProperties != nullptr) { - if ((pProperties->aspect & + if ((pProperties->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", - "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspect, is an unrecognized enumerator"); + "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspectMask, is an unrecognized enumerator"); return false; } } @@ -3306,11 +3306,11 @@ bool PreGetImageSubresourceLayout( { if(pSubresource != nullptr) { - if ((pSubresource->aspect & + if ((pSubresource->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", - "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspect, is an unrecognized enumerator"); + "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspectMask, is an unrecognized enumerator"); return false; } } -- 2.7.4