Skip to content

Commit

Permalink
layers: Remove UNASSIGNED for non-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-lunarg committed Dec 7, 2023
1 parent b5dc5cb commit 489668d
Show file tree
Hide file tree
Showing 50 changed files with 138 additions and 191 deletions.
1 change: 0 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ vvl_sources = [
"layers/drawdispatch/descriptor_validator.h",
"layers/drawdispatch/drawdispatch_vuids.cpp",
"layers/drawdispatch/drawdispatch_vuids.h",
"layers/error_message/validation_error_enums.h",
"layers/external/vma/vk_mem_alloc.h",
"layers/external/vma/vma.cpp",
"layers/external/vma/vma.h",
Expand Down
1 change: 0 additions & 1 deletion layers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ target_sources(vvl PRIVATE
core_checks/cc_ycbcr.cpp
drawdispatch/descriptor_validator.cpp
drawdispatch/drawdispatch_vuids.cpp
error_message/validation_error_enums.h
external/vma/vma.h
external/vma/vma.cpp
${API_TYPE}/generated/best_practices.cpp
Expand Down
1 change: 1 addition & 0 deletions layers/best_practices/best_practices_error_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"UNASSIGNED-BestPractices-vkCreateRenderPass-SubpassResolve-NonOptimalFormat";

[[maybe_unused]] static const char *kVUID_BestPractices_Swapchain_InvalidCount = "UNASSIGNED-BestPractices-SwapchainInvalidCount";
[[maybe_unused]] static const char *kVUID_BestPractices_Swapchain_PriorCount = "UNASSIGNED-BestPractices-SwapchainPriorCount";
[[maybe_unused]] static const char *kVUID_BestPractices_DepthBiasNoAttachment = "UNASSIGNED-BestPractices-DepthBiasNoAttachment";
[[maybe_unused]] static const char *kVUID_BestPractices_SpirvDeprecated_WorkgroupSize =
"UNASSIGNED-BestPractices-SpirvDeprecated_WorkgroupSize";
Expand Down
2 changes: 1 addition & 1 deletion layers/best_practices/bp_wsi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bool BestPractices::PreCallValidateGetSwapchainImagesKHR(VkDevice device, VkSwap
if (swapchain_state && pSwapchainImages) {
// Compare the preliminary value of *pSwapchainImageCount with the value this time:
if (swapchain_state->vkGetSwapchainImagesKHRState == UNCALLED) {
skip |= LogWarning(kVUID_Core_Swapchain_PriorCount, device, error_obj.location,
skip |= LogWarning(kVUID_BestPractices_Swapchain_PriorCount, device, error_obj.location,
"called with non-NULL pSwapchainImageCount; but no prior positive value has "
"been seen for pSwapchainImages.");
}
Expand Down
32 changes: 16 additions & 16 deletions layers/containers/qfo_transfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ struct QFOImageTransferBarrier : public QFOTransferBarrierBase<VkImage> {
// TODO: codegen a comprehensive complie time type -> string (and or other traits) template family
static const char *BarrierName() { return "VkImageMemoryBarrier"; }
static const char *HandleName() { return "VkImage"; }
// UNASSIGNED-VkImageMemoryBarrier-image-00001 QFO transfer image barrier must not duplicate QFO recorded in command buffer
static const char *ErrMsgDuplicateQFOInCB() { return "UNASSIGNED-VkImageMemoryBarrier-image-00001"; }
// UNASSIGNED-VkImageMemoryBarrier-image-00002 QFO transfer image barrier must not duplicate QFO submitted in batch
static const char *ErrMsgDuplicateQFOInSubmit() { return "UNASSIGNED-VkImageMemoryBarrier-image-00002"; }
// UNASSIGNED-VkImageMemoryBarrier-image-00003 QFO transfer image barrier must not duplicate QFO submitted previously
static const char *ErrMsgDuplicateQFOSubmitted() { return "UNASSIGNED-VkImageMemoryBarrier-image-00003"; }
// UNASSIGNED-VkImageMemoryBarrier-image-00004 QFO acquire image barrier must have matching QFO release submitted previously
static const char *ErrMsgMissingQFOReleaseInSubmit() { return "UNASSIGNED-VkImageMemoryBarrier-image-00004"; }
// QFO transfer image barrier must not duplicate QFO recorded in command buffer
static const char *DuplicateQFOInCB() { return "WARNING-VkImageMemoryBarrier-image-00001"; }
// QFO transfer image barrier must not duplicate QFO submitted in batch
static const char *DuplicateQFOInSubmit() { return "WARNING-VkImageMemoryBarrier-image-00002"; }
// QFO transfer image barrier must not duplicate QFO submitted previously
static const char *DuplicateQFOSubmitted() { return "WARNING-VkImageMemoryBarrier-image-00003"; }
// QFO acquire image barrier must have matching QFO release submitted previously
static const char *MissingQFOReleaseInSubmit() { return "UNASSIGNED-VkImageMemoryBarrier-image-00004"; }
};

// Buffer barrier specific implementation
Expand All @@ -113,14 +113,14 @@ struct QFOBufferTransferBarrier : public QFOTransferBarrierBase<VkBuffer> {
}
static const char *BarrierName() { return "VkBufferMemoryBarrier"; }
static const char *HandleName() { return "VkBuffer"; }
// UNASSIGNED-VkImageMemoryBarrier-buffer-00001 QFO transfer buffer barrier must not duplicate QFO recorded in command buffer
static const char *ErrMsgDuplicateQFOInCB() { return "UNASSIGNED-VkBufferMemoryBarrier-buffer-00001"; }
// UNASSIGNED-VkBufferMemoryBarrier-buffer-00002 QFO transfer buffer barrier must not duplicate QFO submitted in batch
static const char *ErrMsgDuplicateQFOInSubmit() { return "UNASSIGNED-VkBufferMemoryBarrier-buffer-00002"; }
// UNASSIGNED-VkBufferMemoryBarrier-buffer-00003 QFO transfer buffer barrier must not duplicate QFO submitted previously
static const char *ErrMsgDuplicateQFOSubmitted() { return "UNASSIGNED-VkBufferMemoryBarrier-buffer-00003"; }
// UNASSIGNED-VkBufferMemoryBarrier-buffer-00004 QFO acquire buffer barrier must have matching QFO release submitted previously
static const char *ErrMsgMissingQFOReleaseInSubmit() { return "UNASSIGNED-VkBufferMemoryBarrier-buffer-00004"; }
// QFO transfer buffer barrier must not duplicate QFO recorded in command buffer
static const char *DuplicateQFOInCB() { return "WARNING-VkBufferMemoryBarrier-buffer-00001"; }
// QFO transfer buffer barrier must not duplicate QFO submitted in batch
static const char *DuplicateQFOInSubmit() { return "WARNING-VkBufferMemoryBarrier-buffer-00002"; }
// QFO transfer buffer barrier must not duplicate QFO submitted previously
static const char *DuplicateQFOSubmitted() { return "WARNING-VkBufferMemoryBarrier-buffer-00003"; }
// QFO acquire buffer barrier must have matching QFO release submitted previously
static const char *MissingQFOReleaseInSubmit() { return "UNASSIGNED-VkBufferMemoryBarrier-buffer-00004"; }
};

template <typename TransferBarrier>
Expand Down
2 changes: 1 addition & 1 deletion layers/core_checks/cc_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ bool CoreChecks::PreCallValidateCreateBufferView(VkDevice device, const VkBuffer
if (vkuFormatIsDepthOrStencil(pCreateInfo->format)) {
// Should never hopefully get here, but there are known driver advertising the wrong feature flags
// see https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/4849
skip |= LogError(kVUID_Core_invalidDepthStencilFormat, device, create_info_loc.dot(Field::format),
skip |= LogError("UNASSIGNED-VkBufferViewCreateInfo-depthStencil-format", device, create_info_loc.dot(Field::format),
"is a depth/stencil format (%s) but depth/stencil formats do not have a "
"defined sizes for alignment, replace with a color format.",
string_VkFormat(pCreateInfo->format));
Expand Down
1 change: 1 addition & 0 deletions layers/core_checks/cc_cmd_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,7 @@ bool CoreChecks::PreCallValidateCmdExecuteCommands(VkCommandBuffer commandBuffer
for (auto index = iter->range.begin; index < iter->range.end; index++) {
const LogObjectList objlist(commandBuffer, pCommandBuffers[i]);
const auto subresource = image_state->subresource_encoder.Decode(index);
// VU being worked on https://gitlab.khronos.org/vulkan/vulkan/-/issues/2456
skip |= LogError("UNASSIGNED-vkCmdExecuteCommands-commandBuffer-00001", objlist, cb_loc,
"was executed using %s (subresource: aspectMask 0x%x array layer %" PRIu32
", mip level %" PRIu32 ") which expects layout %s--instead, image %s layout is %s.",
Expand Down
6 changes: 3 additions & 3 deletions layers/core_checks/cc_descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <valarray>

#include "error_message/validation_error_enums.h"
#include "core_validation.h"
#include "state_tracker/descriptor_sets.h"
#include "cc_buffer_address.h"
Expand Down Expand Up @@ -1022,8 +1021,9 @@ bool CoreChecks::ValidateImageUpdate(VkImageView image_view, VkImageLayout image
}

// Validate that memory is bound to image
// VU being worked on https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/5598
skip |= ValidateMemoryIsBoundToImage(LogObjectList(image), *image_node, image_info_loc.dot(Field::image),
kVUID_Core_Bound_Resource_FreedMemoryAccess);
"UNASSIGNED-VkDescriptorImageInfo-BoundResourceFreedMemoryAccess");

const LogObjectList objlist(iv_state->Handle(), image_node->Handle());
// KHR_maintenance1 allows rendering into 2D or 2DArray views which slice a 3D image,
Expand Down Expand Up @@ -3119,7 +3119,7 @@ void CoreChecks::PostCallRecordAllocateDescriptorSets(VkDevice device, const VkD
const VkDescriptorType type = layout->GetTypeFromIndex(j);
if (!pool_state->IsAvailableType(type)) {
// This check would be caught by validation if VK_KHR_maintenance1 was not enabled
LogWarning("UNASSIGNED-CoreValidation-AllocateDescriptorSets-WrongType", pool_state->Handle(),
LogWarning("WARNING-CoreValidation-AllocateDescriptorSets-WrongType", pool_state->Handle(),
record_obj.location.dot(Field::pAllocateInfo).dot(Field::pSetLayouts, i),
"binding %" PRIu32
" was created with %s but the "
Expand Down
8 changes: 4 additions & 4 deletions layers/core_checks/cc_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ void CoreChecks::CreateDevice(const VkDeviceCreateInfo *pCreateInfo) {
read_file.close();
} else {
Location loc(Func::vkCreateDevice);
LogInfo("UNASSIGNED-cache-file-error", device, loc,
LogInfo("WARNING-cache-file-error", device, loc,
"Cannot open shader validation cache at %s for reading (it may not exist yet)", validation_cache_path.c_str());
}

Expand All @@ -488,15 +488,15 @@ void CoreChecks::PreCallRecordDestroyDevice(VkDevice device, const VkAllocationC

validation_cache_data = (char *)malloc(sizeof(char) * validation_cache_size);
if (!validation_cache_data) {
LogInfo("UNASSIGNED-cache-memory-error", device, loc, "Validation Cache Memory Error");
LogInfo("WARNING-cache-memory-error", device, loc, "Validation Cache Memory Error");
return;
}

VkResult result =
CoreLayerGetValidationCacheDataEXT(device, core_validation_cache, &validation_cache_size, validation_cache_data);

if (result != VK_SUCCESS) {
LogInfo("UNASSIGNED-cache-retrieval-error", device, loc, "Validation Cache Retrieval Error");
LogInfo("WARNING-cache-retrieval-error", device, loc, "Validation Cache Retrieval Error");
free(validation_cache_data);
return;
}
Expand All @@ -507,7 +507,7 @@ void CoreChecks::PreCallRecordDestroyDevice(VkDevice device, const VkAllocationC
write_file.write(static_cast<char *>(validation_cache_data), validation_cache_size);
write_file.close();
} else {
LogInfo("UNASSIGNED-cache-write-error", device, loc, "Cannot open shader validation cache at %s for writing",
LogInfo("WARNING-cache-write-error", device, loc, "Cannot open shader validation cache at %s for writing",
validation_cache_path.c_str());
}
}
Expand Down
3 changes: 2 additions & 1 deletion layers/core_checks/cc_device_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1436,8 +1436,9 @@ bool CoreChecks::ValidateBindImageMemory(uint32_t bindInfoCount, const VkBindIma
}
if (image_state->create_from_swapchain != swapchain_info->swapchain) {
const LogObjectList objlist(bind_info.image, image_state->create_from_swapchain, swapchain_info->swapchain);
// VU being worked on https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/5078
skip |= LogError(
kVUID_Core_BindImageMemory_Swapchain, objlist, loc.dot(Field::image),
"UNASSIGNED-CoreValidation-BindImageMemory-Swapchain", objlist, loc.dot(Field::image),
"(%s) is created by %s, but the image is bound by %s. The image should be created and bound by the same "
"swapchain",
FormatHandle(bind_info.image).c_str(), FormatHandle(image_state->create_from_swapchain).c_str(),
Expand Down
2 changes: 1 addition & 1 deletion layers/core_checks/cc_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate
total_size = (total_size + ig_mask) & ~ig_mask;

if (total_size > format_limits.maxResourceSize) {
skip |= LogWarning(kVUID_Core_Image_InvalidFormatLimitsViolation, device, error_obj.location,
skip |= LogWarning("WARNING-Image-InvalidFormatLimitsViolation", device, error_obj.location,
"resource size exceeds allowable maximum Image resource size = %" PRIu64
", maximum resource size = %" PRIu64 " for format %s.",
total_size, format_limits.maxResourceSize, string_VkFormat(pCreateInfo->format));
Expand Down
7 changes: 4 additions & 3 deletions layers/core_checks/cc_image_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool CoreChecks::VerifyImageLayoutSubresource(const vvl::CommandBuffer &cb_state
if (image_state.createInfo.tiling != VK_IMAGE_TILING_LINEAR) {
// LAYOUT_GENERAL is allowed, but may not be performance optimal, flag as perf warning.
const LogObjectList objlist(cb_state.commandBuffer(), image_state.Handle());
skip |= LogPerformanceWarning(kVUID_Core_DrawState_InvalidImageLayout, objlist, loc,
skip |= LogPerformanceWarning("WARNING-ImageLayout-General", objlist, loc,
"For optimal performance %s layout should be %s instead of GENERAL.",
FormatHandle(image_state).c_str(), string_VkImageLayout(optimal_layout));
}
Expand Down Expand Up @@ -266,7 +266,7 @@ bool CoreChecks::ValidateCmdBufImageLayouts(const Location &loc, const vvl::Comm
for (auto index : sparse_container::range_view<decltype(intersected_range)>(intersected_range)) {
const auto subresource = image_state->subresource_encoder.Decode(index);
const LogObjectList objlist(cb_state.commandBuffer(), image_state->Handle());
skip |= LogError(kVUID_Core_DrawState_InvalidImageLayout, objlist, loc,
skip |= LogError("UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout", objlist, loc,
"command buffer %s expects %s (subresource: aspectMask 0x%x array layer %" PRIu32
", mip level %" PRIu32 ") to be in layout %s--instead, current layout is %s.",
FormatHandle(cb_state).c_str(), FormatHandle(*image_state).c_str(), subresource.aspectMask,
Expand Down Expand Up @@ -504,7 +504,8 @@ bool CoreChecks::VerifyFramebufferAndRenderPassLayouts(const vvl::CommandBuffer

if (render_pass_info->attachmentCount != framebuffer_info.attachmentCount) {
const LogObjectList objlist(pRenderPassBegin->renderPass, framebuffer_state.framebuffer());
skip |= LogError(kVUID_Core_DrawState_InvalidRenderpass, objlist, rp_begin_loc,
// VU bieng worked on at https://gitlab.khronos.org/vulkan/vulkan/-/issues/2267
skip |= LogError("UNASSIGNED-CoreValidation-DrawState-InvalidRenderpass", objlist, rp_begin_loc,
"You cannot start a render pass using a framebuffer with a different number of attachments (%" PRIu32
" vs %" PRIu32 ").",
render_pass_info->attachmentCount, framebuffer_info.attachmentCount);
Expand Down
3 changes: 2 additions & 1 deletion layers/core_checks/cc_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ bool CoreChecks::ValidateCommandBufferState(const vvl::CommandBuffer &cb_state,
// Validate ONE_TIME_SUBMIT_BIT CB is not being submitted more than once
if (const uint64_t submissions = cb_state.submitCount + current_submit_count;
(cb_state.beginInfo.flags & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) && (submissions > 1)) {
skip |= LogError(kVUID_Core_DrawState_CommandBufferSingleSubmitViolation, cb_state.commandBuffer(), loc,
// VU being worked on https://gitlab.khronos.org/vulkan/vulkan/-/issues/2456
skip |= LogError("UNASSIGNED-DrawState-CommandBufferSingleSubmitViolation", cb_state.commandBuffer(), loc,
"%s recorded with VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT has been submitted %" PRIu64 " times.",
FormatHandle(cb_state).c_str(), submissions);
}
Expand Down
4 changes: 2 additions & 2 deletions layers/core_checks/cc_ray_tracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ bool CoreChecks::PreCallValidateCmdBuildAccelerationStructureNV(VkCommandBuffer
}
}
if (dst_as_state != nullptr && !dst_as_state->update_scratch_memory_requirements_checked) {
skip |= LogWarning(kVUID_Core_CmdBuildAccelNV_NoUpdateMemReqQuery, dst, error_obj.location,
skip |= LogWarning("WARNING-vkCmdBuildAccelerationStructureNV-update-requirements", dst, error_obj.location,
"Updating %s but vkGetAccelerationStructureMemoryRequirementsNV() "
"has not been called for update scratch memory.",
FormatHandle(dst_as_state->acceleration_structure()).c_str());
Expand All @@ -988,7 +988,7 @@ bool CoreChecks::PreCallValidateCmdBuildAccelerationStructureNV(VkCommandBuffer
}
} else {
if (dst_as_state != nullptr && !dst_as_state->build_scratch_memory_requirements_checked) {
skip |= LogWarning(kVUID_Core_CmdBuildAccelNV_NoScratchMemReqQuery, dst, error_obj.location,
skip |= LogWarning("WARNING-vkCmdBuildAccelerationStructureNV-scratch-requirements", dst, error_obj.location,
"Assigning scratch buffer to %s but "
"vkGetAccelerationStructureMemoryRequirementsNV() has not been called for scratch memory.",
FormatHandle(dst_as_state->acceleration_structure()).c_str());
Expand Down
Loading

0 comments on commit 489668d

Please sign in to comment.