Skip to content

Commit

Permalink
layers: Update alias post 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-lunarg committed Dec 8, 2024
1 parent e7bd009 commit 5348c37
Show file tree
Hide file tree
Showing 177 changed files with 2,472 additions and 2,532 deletions.
2 changes: 1 addition & 1 deletion docs/gpu_validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ array elements, those elements are not required to have been written.
The instrumentation code needs to know which elements of a descriptor array have been written, so that it can tell if one is used
that has not been written.

Note that currently, `VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT` validation is not working and all accesses are reported as valid.
Note that currently, `VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK` validation is not working and all accesses are reported as valid.

### Buffer device address validation
The vkGetBufferDeviceAddressEXT routine can be used to get a GPU address that a shader can use to directly address a particular buffer.
Expand Down
52 changes: 26 additions & 26 deletions docs/synchronization.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions layers/best_practices/best_practices_validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class BestPractices : public ValidationStateTracker {

bool CheckPipelineStageFlags(const LogObjectList& objlist, const Location& loc, VkPipelineStageFlags flags) const;
bool CheckPipelineStageFlags(const LogObjectList& objlist, const Location& loc, VkPipelineStageFlags2KHR flags) const;
bool CheckDependencyInfo(const LogObjectList& objlist, const Location& dep_loc, const VkDependencyInfoKHR& dep_info) const;
bool CheckDependencyInfo(const LogObjectList& objlist, const Location& dep_loc, const VkDependencyInfo& dep_info) const;
bool PreCallValidateQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence,
const ErrorObject& error_obj) const override;
bool PreCallValidateQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2KHR* pSubmits, VkFence fence,
Expand Down Expand Up @@ -414,7 +414,7 @@ class BestPractices : public ValidationStateTracker {
void PostCallRecordCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags,
uint32_t offset, uint32_t size, const void* pValues,
const RecordObject& record_obj) override;
void PostCallRecordCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfoKHR* pPushConstantsInfo,
void PostCallRecordCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo* pPushConstantsInfo,
const RecordObject& record_obj) override;
void PostCallRecordCmdPushConstants2KHR(VkCommandBuffer commandBuffer, const VkPushConstantsInfoKHR* pPushConstantsInfo,
const RecordObject& record_obj) override;
Expand Down
4 changes: 2 additions & 2 deletions layers/best_practices/bp_drawdispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ bool BestPractices::ValidateIndexBufferArm(const bp_state::CommandBuffer& cmd_st
for (const uint8_t* scan_ptr = scan_begin; scan_ptr < scan_end; scan_ptr += scan_stride) {
uint32_t scan_index;
uint32_t primitive_restart_value;
if (ib_type == VK_INDEX_TYPE_UINT8_KHR) {
if (ib_type == VK_INDEX_TYPE_UINT8) {
scan_index = *reinterpret_cast<const uint8_t*>(scan_ptr);
primitive_restart_value = 0xFF;
} else if (ib_type == VK_INDEX_TYPE_UINT16) {
Expand Down Expand Up @@ -309,7 +309,7 @@ bool BestPractices::ValidateIndexBufferArm(const bp_state::CommandBuffer& cmd_st
// Knowing the size from the last scan allows us to record index usage with bitsets
for (const uint8_t* scan_ptr = scan_begin; scan_ptr < scan_end; scan_ptr += scan_stride) {
uint32_t scan_index;
if (ib_type == VK_INDEX_TYPE_UINT8_KHR) {
if (ib_type == VK_INDEX_TYPE_UINT8) {
scan_index = *reinterpret_cast<const uint8_t*>(scan_ptr);
} else if (ib_type == VK_INDEX_TYPE_UINT16) {
scan_index = *reinterpret_cast<const uint16_t*>(scan_ptr);
Expand Down
4 changes: 2 additions & 2 deletions layers/best_practices/bp_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ bool BestPractices::ValidateCreateGraphicsPipeline(const VkGraphicsPipelineCreat

const auto* graphics_lib_info = vku::FindStructInPNextChain<VkGraphicsPipelineLibraryCreateInfoEXT>(create_info.pNext);
if (create_info.renderPass == VK_NULL_HANDLE &&
!vku::FindStructInPNextChain<VkPipelineRenderingCreateInfoKHR>(create_info.pNext) &&
!vku::FindStructInPNextChain<VkPipelineRenderingCreateInfo>(create_info.pNext) &&
(!graphics_lib_info ||
(graphics_lib_info->flags & (VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT |
VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT)) != 0)) {
skip |= LogWarning(
"BestPractices-Pipeline-NoRendering", device, create_info_loc,
"renderPass is VK_NULL_HANDLE and pNext chain does not contain an instance of VkPipelineRenderingCreateInfoKHR.");
"renderPass is VK_NULL_HANDLE and pNext chain does not contain an instance of VkPipelineRenderingCreateInfo.");
}

if (VendorCheckEnabled(kBPVendorArm)) {
Expand Down
6 changes: 3 additions & 3 deletions layers/best_practices/bp_render_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ void BestPractices::RecordCmdBeginRenderPass(bp_state::CommandBuffer& cb_state,
}

// If renderpass doesn't load attachment, no need to validate image in queue
if ((!vkuFormatIsStencilOnly(attachment.format) && attachment.loadOp == VK_ATTACHMENT_LOAD_OP_NONE_KHR) ||
(vkuFormatHasStencil(attachment.format) && attachment.stencilLoadOp == VK_ATTACHMENT_LOAD_OP_NONE_KHR)) {
if ((!vkuFormatIsStencilOnly(attachment.format) && attachment.loadOp == VK_ATTACHMENT_LOAD_OP_NONE) ||
(vkuFormatHasStencil(attachment.format) && attachment.stencilLoadOp == VK_ATTACHMENT_LOAD_OP_NONE)) {
continue;
}

Expand Down Expand Up @@ -640,7 +640,7 @@ void BestPractices::PostCallRecordCmdPushConstants(VkCommandBuffer commandBuffer
StateTracker::PostCallRecordCmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues, record_obj);
}

void BestPractices::PostCallRecordCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfoKHR* pPushConstantsInfo,
void BestPractices::PostCallRecordCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo* pPushConstantsInfo,
const RecordObject& record_obj) {
StateTracker::PostCallRecordCmdPushConstants2(commandBuffer, pPushConstantsInfo, record_obj);
}
Expand Down
14 changes: 7 additions & 7 deletions layers/best_practices/bp_synchronization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ bool BestPractices::CheckPipelineStageFlags(const LogObjectList& objlist, const
VkPipelineStageFlags2KHR flags) const {
bool skip = false;

if (flags & VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR) {
skip |= LogWarning("BestPractices-pipeline-stage-flags2-graphics", objlist, loc,
"using VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR");
} else if (flags & VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR) {
skip |= LogWarning("BestPractices-pipeline-stage-flags2-compute", objlist, loc,
"using VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR");
if (flags & VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT) {
skip |=
LogWarning("BestPractices-pipeline-stage-flags2-graphics", objlist, loc, "using VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT");
} else if (flags & VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT) {
skip |=
LogWarning("BestPractices-pipeline-stage-flags2-compute", objlist, loc, "using VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT");
}

return skip;
}

bool BestPractices::CheckDependencyInfo(const LogObjectList& objlist, const Location& dep_loc,
const VkDependencyInfoKHR& dep_info) const {
const VkDependencyInfo& dep_info) const {
bool skip = false;
auto stage_masks = sync_utils::GetGlobalStageMasks(dep_info);

Expand Down
2 changes: 1 addition & 1 deletion layers/chassis/chassis_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ static const VkPhysicalDeviceToolPropertiesEXT khronos_layer_tool_props = {
nullptr,
"Khronos Validation Layer",
STRINGIFY(VK_HEADER_VERSION),
VK_TOOL_PURPOSE_VALIDATION_BIT_EXT | VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT | VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT |
VK_TOOL_PURPOSE_VALIDATION_BIT | VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT | VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT |
VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT,
"Khronos Validation Layer",
OBJECT_LAYER_NAME};
Expand Down
20 changes: 10 additions & 10 deletions layers/chassis/dispatch_object_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ void DispatchObject::ExportMetalObjectsEXT(VkDevice device, VkExportMetalObjects
// The VK_EXT_pipeline_creation_feedback extension returns data from the driver -- we've created a copy of the pnext chain, so
// copy the returned data to the caller before freeing the copy's data.
void CopyCreatePipelineFeedbackData(const void *src_chain, const void *dst_chain) {
auto src_feedback_struct = vku::FindStructInPNextChain<VkPipelineCreationFeedbackCreateInfoEXT>(src_chain);
auto dst_feedback_struct = const_cast<VkPipelineCreationFeedbackCreateInfoEXT *>(
vku::FindStructInPNextChain<VkPipelineCreationFeedbackCreateInfoEXT>(dst_chain));
auto src_feedback_struct = vku::FindStructInPNextChain<VkPipelineCreationFeedbackCreateInfo>(src_chain);
auto dst_feedback_struct = const_cast<VkPipelineCreationFeedbackCreateInfo *>(
vku::FindStructInPNextChain<VkPipelineCreationFeedbackCreateInfo>(dst_chain));
if (!src_feedback_struct || !dst_feedback_struct) return;
ASSERT_AND_RETURN(dst_feedback_struct->pPipelineCreationFeedback && src_feedback_struct->pPipelineCreationFeedback);

Expand Down Expand Up @@ -724,7 +724,7 @@ VkResult DispatchObject::CreateDescriptorUpdateTemplate(VkDevice device, const V
if (pCreateInfo->templateType == VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET) {
local_pCreateInfo->descriptorSetLayout = Unwrap(pCreateInfo->descriptorSetLayout);
}
if (pCreateInfo->templateType == VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR) {
if (pCreateInfo->templateType == VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS) {
local_pCreateInfo->pipelineLayout = Unwrap(pCreateInfo->pipelineLayout);
}
}
Expand Down Expand Up @@ -757,7 +757,7 @@ VkResult DispatchObject::CreateDescriptorUpdateTemplateKHR(VkDevice device, cons
if (pCreateInfo->templateType == VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET) {
local_pCreateInfo->descriptorSetLayout = Unwrap(pCreateInfo->descriptorSetLayout);
}
if (pCreateInfo->templateType == VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR) {
if (pCreateInfo->templateType == VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS) {
local_pCreateInfo->pipelineLayout = Unwrap(pCreateInfo->pipelineLayout);
}
}
Expand Down Expand Up @@ -862,7 +862,7 @@ void *BuildUnwrappedUpdateTemplateBuffer(DispatchObject *layer_data, uint64_t de
VkBufferView wrapped_entry = layer_data->Unwrap(*buffer_view_handle);
template_entries.emplace_back(offset, kVulkanObjectTypeBufferView, CastToUint64(wrapped_entry), 0);
} break;
case VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT: {
case VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK: {
size_t numBytes = create_info.pDescriptorUpdateEntries[i].descriptorCount;
allocation_size = std::max(allocation_size, offset + numBytes);
// nothing to unwrap, just plain data
Expand Down Expand Up @@ -1004,19 +1004,19 @@ void DispatchObject::CmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer command
}

void DispatchObject::CmdPushDescriptorSetWithTemplate2(
VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfoKHR *pPushDescriptorSetWithTemplateInfo) {
VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo) {
if (!wrap_handles)
return device_dispatch_table.CmdPushDescriptorSetWithTemplate2KHR(commandBuffer, pPushDescriptorSetWithTemplateInfo);
uint64_t template_handle = CastToUint64(pPushDescriptorSetWithTemplateInfo->descriptorUpdateTemplate);
void *unwrapped_buffer = nullptr;
{
ReadLockGuard lock(dispatch_lock);
const_cast<VkPushDescriptorSetWithTemplateInfoKHR *>(pPushDescriptorSetWithTemplateInfo)->descriptorUpdateTemplate =
const_cast<VkPushDescriptorSetWithTemplateInfo *>(pPushDescriptorSetWithTemplateInfo)->descriptorUpdateTemplate =
Unwrap(pPushDescriptorSetWithTemplateInfo->descriptorUpdateTemplate);
const_cast<VkPushDescriptorSetWithTemplateInfoKHR *>(pPushDescriptorSetWithTemplateInfo)->layout =
const_cast<VkPushDescriptorSetWithTemplateInfo *>(pPushDescriptorSetWithTemplateInfo)->layout =
Unwrap(pPushDescriptorSetWithTemplateInfo->layout);
unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(this, template_handle, pPushDescriptorSetWithTemplateInfo->pData);
const_cast<VkPushDescriptorSetWithTemplateInfoKHR *>(pPushDescriptorSetWithTemplateInfo)->pData = unwrapped_buffer;
const_cast<VkPushDescriptorSetWithTemplateInfo *>(pPushDescriptorSetWithTemplateInfo)->pData = unwrapped_buffer;
}
device_dispatch_table.CmdPushDescriptorSetWithTemplate2(commandBuffer, pPushDescriptorSetWithTemplateInfo);
free(unwrapped_buffer);
Expand Down
10 changes: 5 additions & 5 deletions layers/core_checks/cc_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ bool CoreChecks::ValidateBufferViewBuffer(const vvl::Buffer &buffer_state, const
const VkFormatProperties3KHR format_properties = GetPDFormatProperties(format);
const VkBufferUsageFlags2KHR usage = buffer_state.usage;
if ((usage & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) &&
!(format_properties.bufferFeatures & VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR)) {
!(format_properties.bufferFeatures & VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT)) {
skip |= LogError("VUID-VkBufferViewCreateInfo-format-08778", buffer_state.Handle(), loc.dot(Field::buffer),
"was created with usage (%s) containing VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT.\n"
"Format (%s) doesn't support VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT.\n"
Expand All @@ -115,7 +115,7 @@ bool CoreChecks::ValidateBufferViewBuffer(const vvl::Buffer &buffer_state, const
string_VkFormatFeatureFlags2(format_properties.bufferFeatures).c_str());
}
if ((usage & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) &&
!(format_properties.bufferFeatures & VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR)) {
!(format_properties.bufferFeatures & VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT)) {
skip |= LogError("VUID-VkBufferViewCreateInfo-format-08779", buffer_state.Handle(), loc.dot(Field::buffer),
"was created with usage (%s) containing VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT.\n"
"Format (%s) doesn't support VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT.\n"
Expand Down Expand Up @@ -276,7 +276,7 @@ bool CoreChecks::PreCallValidateCreateBuffer(VkDevice device, const VkBufferCrea
}
}

const auto *usage_flags2 = vku::FindStructInPNextChain<VkBufferUsageFlags2CreateInfoKHR>(pCreateInfo->pNext);
const auto *usage_flags2 = vku::FindStructInPNextChain<VkBufferUsageFlags2CreateInfo>(pCreateInfo->pNext);
const VkBufferUsageFlags2KHR usage = usage_flags2 ? usage_flags2->usage : pCreateInfo->usage;

const bool has_decode_usage = usage & (VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR | VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR);
Expand Down Expand Up @@ -431,9 +431,9 @@ bool CoreChecks::PreCallValidateCreateBufferView(VkDevice device, const VkBuffer
}
}

if (auto buffer_usage_flags2 = vku::FindStructInPNextChain<VkBufferUsageFlags2CreateInfoKHR>(pCreateInfo->pNext)) {
if (auto buffer_usage_flags2 = vku::FindStructInPNextChain<VkBufferUsageFlags2CreateInfo>(pCreateInfo->pNext)) {
const VkBufferUsageFlags2KHR usage = buffer_usage_flags2->usage;
if ((usage & ~(VK_BUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR | VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT_KHR)) != 0) {
if ((usage & ~(VK_BUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT)) != 0) {
skip |= LogError("VUID-VkBufferViewCreateInfo-pNext-08780", objlist,
create_info_loc.pNext(Struct::VkBufferUsageFlags2CreateInfo, Field::usage), "is %s.",
string_VkBufferUsageFlags2(usage).c_str());
Expand Down
Loading

0 comments on commit 5348c37

Please sign in to comment.