aboutsummaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
authorJohn Zulauf <jzulauf@lunarg.com>2018-02-20 14:33:18 -0700
committerjzulauf-lunarg <32470354+jzulauf-lunarg@users.noreply.github.com>2018-02-21 07:37:25 -0700
commit31df19c3ec4e7ac94363102bb6b8618c7bb79718 (patch)
tree7dd23fffdf01fc25ef4af3d5c59968f34a19d083 /layers
parent7206d0c00d0f553eb9a5d13cc3d239aebde16735 (diff)
downloadusermoji-31df19c3ec4e7ac94363102bb6b8618c7bb79718.tar.xz
layers: Convert 2 barrier checks to VUID notation
Converted two validation checks for image and buffer barriers to the VALIDATION_ERROR_xxxxxxxx / VUID notation and changed unit tests to also specify desired failure in same form. VALIDATION_ERROR_0a00095c VUID-VkImageMemoryBarrier-newLayout-01198 VALIDATION_ERROR_0180094a VUID-VkBufferMemoryBarrier-size-01189 Change-Id: I20387bfec89872825f7311e443105aecacb84000
Diffstat (limited to 'layers')
-rw-r--r--layers/core_validation.cpp12
-rw-r--r--layers/vk_validation_error_database.txt4
2 files changed, 9 insertions, 7 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 96942990..42e9d3d9 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -7594,8 +7594,9 @@ static bool ValidateBarriers(layer_data *device_data, const char *funcName, GLOB
if (mem_barrier->newLayout == VK_IMAGE_LAYOUT_UNDEFINED || mem_barrier->newLayout == VK_IMAGE_LAYOUT_PREINITIALIZED) {
skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- HandleToUint64(cb_state->commandBuffer), __LINE__, DRAWSTATE_INVALID_BARRIER, "DS",
- "%s: Image Layout cannot be transitioned to UNDEFINED or PREINITIALIZED.", funcName);
+ HandleToUint64(cb_state->commandBuffer), __LINE__, VALIDATION_ERROR_0a00095c, "DS",
+ "%s: Image Layout cannot be transitioned to UNDEFINED or PREINITIALIZED. %s", funcName,
+ validation_error_map[VALIDATION_ERROR_0a00095c]);
}
if (image_data) {
@@ -7652,11 +7653,12 @@ static bool ValidateBarriers(layer_data *device_data, const char *funcName, GLOB
} else if (mem_barrier->size != VK_WHOLE_SIZE && (mem_barrier->offset + mem_barrier->size > buffer_size)) {
skip |=
log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- HandleToUint64(cb_state->commandBuffer), __LINE__, DRAWSTATE_INVALID_BARRIER, "DS",
+ HandleToUint64(cb_state->commandBuffer), __LINE__, VALIDATION_ERROR_0180094a, "DS",
"%s: Buffer Barrier 0x%" PRIx64 " has offset 0x%" PRIx64 " and size 0x%" PRIx64
- " whose sum is greater than total size 0x%" PRIx64 ".",
+ " whose sum is greater than total size 0x%" PRIx64 ". %s",
funcName, HandleToUint64(mem_barrier->buffer), HandleToUint64(mem_barrier->offset),
- HandleToUint64(mem_barrier->size), HandleToUint64(buffer_size));
+ HandleToUint64(mem_barrier->size), HandleToUint64(buffer_size),
+ validation_error_map[VALIDATION_ERROR_0180094a]);
}
}
}
diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt
index 5c1de4ca..c1fb6241 100644
--- a/layers/vk_validation_error_database.txt
+++ b/layers/vk_validation_error_database.txt
@@ -182,7 +182,7 @@ VALIDATION_ERROR_01600d9a~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCop
VALIDATION_ERROR_0160aa01~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-imageSubresource-parameter~^~core~^~The spec valid usage text states 'imageSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageSubresource-parameter)~^~implicit
VALIDATION_ERROR_01800946~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-offset-01187~^~core~^~The spec valid usage text states 'offset must be less than the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-offset-01187)~^~
VALIDATION_ERROR_01800948~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-size-01188~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01188)~^~
-VALIDATION_ERROR_0180094a~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-size-01189~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to than the size of buffer minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01189)~^~
+VALIDATION_ERROR_0180094a~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-size-01189~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to than the size of buffer minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01189)~^~
VALIDATION_ERROR_0180094c~^~Y~^~InvalidBarrierQueueFamily~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01190~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01190)~^~
VALIDATION_ERROR_0180094e~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01191~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01191)~^~
VALIDATION_ERROR_01800950~^~Y~^~InvalidBarrierQueueFamily~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01192~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01192)~^~
@@ -767,7 +767,7 @@ VALIDATION_ERROR_09e2fa01~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo
VALIDATION_ERROR_09e30601~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-usage-parameter~^~core~^~The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-usage-parameter)~^~implicit
VALIDATION_ERROR_09e30603~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-usage-requiredbitmask~^~core~^~The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-usage-requiredbitmask)~^~implicit
VALIDATION_ERROR_0a00095a~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-oldLayout-01197~^~core~^~The spec valid usage text states 'oldLayout must be VK_IMAGE_LAYOUT_UNDEFINED or the current layout of the image subresources affected by the barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01197)~^~
-VALIDATION_ERROR_0a00095c~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-newLayout-01198~^~core~^~The spec valid usage text states 'newLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-newLayout-01198)~^~
+VALIDATION_ERROR_0a00095c~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-newLayout-01198~^~core~^~The spec valid usage text states 'newLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-newLayout-01198)~^~
VALIDATION_ERROR_0a00095e~^~Y~^~InvalidBarrierQueueFamily~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01199~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01199)~^~
VALIDATION_ERROR_0a000960~^~Y~^~InvalidBarrierQueueFamily~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01200~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see Queue Family Properties).' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01200)~^~
VALIDATION_ERROR_0a000962~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01201~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01201)~^~