aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorMike Weiblen <mikew@lunarg.com>2017-02-21 14:32:53 -0700
committerMike Weiblen <mikew@lunarg.com>2017-02-21 14:55:28 -0700
commite36af17afa0496cc5d9696dd578fd94392e984d9 (patch)
treedb2f4a855ef305bb03450c0da6ad68fc29beac90 /layers/core_validation.cpp
parent1d8b70fd077afb5dff9db4a9ec921e337976acf4 (diff)
downloadusermoji-e36af17afa0496cc5d9696dd578fd94392e984d9.tar.xz
layers: Move code to preferred cpp file
PreCallValidateGetImageSubresourceLayout() from core_validation.cpp to buffer_validation.cpp Change-Id: Ic55e049fab28384d30768e8c590f158e603dd343
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index ce2a0a35..455c0c01 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -7878,73 +7878,6 @@ VKAPI_ATTR void VKAPI_CALL CmdResolveImage(VkCommandBuffer commandBuffer, VkImag
}
}
-static bool PreCallValidateGetImageSubresourceLayout(layer_data *device_data, VkImage image,
- const VkImageSubresource *pSubresource) {
- bool skip = false;
- const VkImageAspectFlags sub_aspect = pSubresource->aspectMask;
-
- // VU 00733: The aspectMask member of pSubresource must only have a single bit set
- const int num_bits = sizeof(sub_aspect) * CHAR_BIT;
- std::bitset<num_bits> aspect_mask_bits(sub_aspect);
- if (aspect_mask_bits.count() != 1) {
- skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
- __LINE__, VALIDATION_ERROR_00733, "IMAGE",
- "vkGetImageSubresourceLayout(): VkImageSubresource.aspectMask must have exactly 1 bit set. %s",
- validation_error_map[VALIDATION_ERROR_00733]);
- }
-
- IMAGE_STATE *image_entry = GetImageState(device_data, image);
- if (!image_entry) {
- return skip;
- }
-
- // VU 00732: image must have been created with tiling equal to VK_IMAGE_TILING_LINEAR
- if (image_entry->createInfo.tiling != VK_IMAGE_TILING_LINEAR) {
- skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
- (uint64_t)image, __LINE__, VALIDATION_ERROR_00732, "IMAGE",
- "vkGetImageSubresourceLayout(): Image must have tiling of VK_IMAGE_TILING_LINEAR. %s",
- validation_error_map[VALIDATION_ERROR_00732]);
- }
-
- // VU 00739: mipLevel must be less than the mipLevels specified in VkImageCreateInfo when the image was created
- if (pSubresource->mipLevel >= image_entry->createInfo.mipLevels) {
- skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
- (uint64_t)image, __LINE__, VALIDATION_ERROR_00739, "IMAGE",
- "vkGetImageSubresourceLayout(): pSubresource.mipLevel (%d) must be less than %d. %s",
- pSubresource->mipLevel, image_entry->createInfo.mipLevels, validation_error_map[VALIDATION_ERROR_00739]);
- }
-
- // VU 00740: arrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when the image was created
- if (pSubresource->arrayLayer >= image_entry->createInfo.arrayLayers) {
- skip |=
- log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, (uint64_t)image,
- __LINE__, VALIDATION_ERROR_00740, "IMAGE",
- "vkGetImageSubresourceLayout(): pSubresource.arrayLayer (%d) must be less than %d. %s",
- pSubresource->arrayLayer, image_entry->createInfo.arrayLayers, validation_error_map[VALIDATION_ERROR_00740]);
- }
-
- // VU 00741: subresource's aspect must be compatible with image's format.
- const VkFormat img_format = image_entry->createInfo.format;
- if (vk_format_is_color(img_format)) {
- if (sub_aspect != VK_IMAGE_ASPECT_COLOR_BIT) {
- skip |= log_msg(
- device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, (uint64_t)image,
- __LINE__, VALIDATION_ERROR_00741, "IMAGE",
- "vkGetImageSubresourceLayout(): For color formats, VkImageSubresource.aspectMask must be VK_IMAGE_ASPECT_COLOR. %s",
- validation_error_map[VALIDATION_ERROR_00741]);
- }
- } else if (vk_format_is_depth_or_stencil(img_format)) {
- if ((sub_aspect != VK_IMAGE_ASPECT_DEPTH_BIT) && (sub_aspect != VK_IMAGE_ASPECT_STENCIL_BIT)) {
- skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
- (uint64_t)image, __LINE__, VALIDATION_ERROR_00741, "IMAGE",
- "vkGetImageSubresourceLayout(): For depth/stencil formats, VkImageSubresource.aspectMask must be "
- "either VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT. %s",
- validation_error_map[VALIDATION_ERROR_00741]);
- }
- }
- return skip;
-}
-
VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource,
VkSubresourceLayout *pLayout) {
layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);