Skip to content

Commit

Permalink
layers: Update to 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
arno-lunarg authored and spencer-lunarg committed Dec 5, 2024
1 parent bd0a02c commit 3bcff29
Show file tree
Hide file tree
Showing 112 changed files with 28,339 additions and 23,760 deletions.
2 changes: 1 addition & 1 deletion layers/VkLayer_khronos_validation.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "@JSON_LAYER_NAME@",
"type": "GLOBAL",
"library_path": "@JSON_LIBRARY_PATH@",
"api_version": "1.3.302",
"api_version": "1.4.303",
"implementation_version": "1",
"description": "Khronos Validation Layer",
"introduction": "The main, comprehensive Khronos validation layer.\n\nVulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in how Vulkan is used can result in a crash. \n\nThe Khronos Validation Layer can be enabled to assist development by enabling developers to verify their applications correctly use the Vulkan API.",
Expand Down
3 changes: 2 additions & 1 deletion layers/best_practices/best_practices_validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,10 @@ 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,
const RecordObject& record_obj) override;
void PostCallRecordCmdPushConstants2KHR(VkCommandBuffer commandBuffer, const VkPushConstantsInfoKHR* pPushConstantsInfo,
const RecordObject& record_obj) override;

void PreCallRecordCmdEndRenderPass(VkCommandBuffer commandBuffer, const RecordObject& record_obj) override;
void PreCallRecordCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo,
const RecordObject& record_obj) override;
Expand Down
3 changes: 2 additions & 1 deletion layers/best_practices/bp_instance_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ bool BestPractices::ValidateDeprecatedExtensions(const Location& loc, vvl::Exten
const char* vuid = "BestPractices-deprecated-extension";
if ((dep_info.target.version == vvl::Version::_VK_VERSION_1_1 && (version >= VK_API_VERSION_1_1)) ||
(dep_info.target.version == vvl::Version::_VK_VERSION_1_2 && (version >= VK_API_VERSION_1_2)) ||
(dep_info.target.version == vvl::Version::_VK_VERSION_1_3 && (version >= VK_API_VERSION_1_3))) {
(dep_info.target.version == vvl::Version::_VK_VERSION_1_3 && (version >= VK_API_VERSION_1_3)) ||
(dep_info.target.version == vvl::Version::_VK_VERSION_1_4 && (version >= VK_API_VERSION_1_4))) {
skip |=
LogWarning(vuid, instance, loc, "Attempting to enable deprecated extension %s, but this extension has been %s %s.",
String(extension), reason_to_string(dep_info.reason), String(dep_info.target).c_str());
Expand Down
7 changes: 6 additions & 1 deletion layers/best_practices/bp_render_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,15 @@ void BestPractices::PostCallRecordCmdPushConstants(VkCommandBuffer commandBuffer
StateTracker::PostCallRecordCmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues, record_obj);
}

void BestPractices::PostCallRecordCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfoKHR* pPushConstantsInfo,
const RecordObject& record_obj) {
StateTracker::PostCallRecordCmdPushConstants2(commandBuffer, pPushConstantsInfo, record_obj);
}

void BestPractices::PostCallRecordCmdPushConstants2KHR(VkCommandBuffer commandBuffer,
const VkPushConstantsInfoKHR* pPushConstantsInfo,
const RecordObject& record_obj) {
StateTracker::PostCallRecordCmdPushConstants2KHR(commandBuffer, pPushConstantsInfo, record_obj);
PostCallRecordCmdPushConstants2(commandBuffer, pPushConstantsInfo, record_obj);
}

void BestPractices::PostRecordCmdBeginRenderPass(bp_state::CommandBuffer& cb_state, const VkRenderPassBeginInfo* pRenderPassBegin) {
Expand Down
37 changes: 37 additions & 0 deletions layers/chassis/dispatch_object_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,24 @@ void DispatchObject::UpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescr
free(unwrapped_buffer);
}

void DispatchObject::CmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer,
VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout,
uint32_t set, const void *pData) {
if (!wrap_handles)
return device_dispatch_table.CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set,
pData);
uint64_t template_handle = CastToUint64(descriptorUpdateTemplate);
void *unwrapped_buffer = nullptr;
{
ReadLockGuard lock(dispatch_lock);
descriptorUpdateTemplate = Unwrap(descriptorUpdateTemplate);
layout = Unwrap(layout);
unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(this, template_handle, pData);
}
device_dispatch_table.CmdPushDescriptorSetWithTemplate(commandBuffer, descriptorUpdateTemplate, layout, set, unwrapped_buffer);
free(unwrapped_buffer);
}

void DispatchObject::CmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
VkPipelineLayout layout, uint32_t set, const void *pData) {
Expand All @@ -925,6 +943,25 @@ void DispatchObject::CmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer command
free(unwrapped_buffer);
}

void DispatchObject::CmdPushDescriptorSetWithTemplate2(
VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfoKHR *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 =
Unwrap(pPushDescriptorSetWithTemplateInfo->descriptorUpdateTemplate);
const_cast<VkPushDescriptorSetWithTemplateInfoKHR *>(pPushDescriptorSetWithTemplateInfo)->layout =
Unwrap(pPushDescriptorSetWithTemplateInfo->layout);
unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(this, template_handle, pPushDescriptorSetWithTemplateInfo->pData);
const_cast<VkPushDescriptorSetWithTemplateInfoKHR *>(pPushDescriptorSetWithTemplateInfo)->pData = unwrapped_buffer;
}
device_dispatch_table.CmdPushDescriptorSetWithTemplate2(commandBuffer, pPushDescriptorSetWithTemplateInfo);
free(unwrapped_buffer);
}

void DispatchObject::CmdPushDescriptorSetWithTemplate2KHR(
VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfoKHR *pPushDescriptorSetWithTemplateInfo) {
if (!wrap_handles)
Expand Down
18 changes: 9 additions & 9 deletions layers/core_checks/cc_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool CoreChecks::ValidateBufferUsageFlags(const LogObjectList &objlist, vvl::Buf

if (!correct_usage) {
skip |= LogError(vuid, objlist, buffer_loc, "(%s) was created with %s but requires %s.",
FormatHandle(buffer_state.Handle()).c_str(), string_VkBufferUsageFlags2KHR(buffer_state.usage).c_str(),
FormatHandle(buffer_state.Handle()).c_str(), string_VkBufferUsageFlags2(buffer_state.usage).c_str(),
string_VkBufferUsageFlags(desired).c_str());
}
return skip;
Expand Down Expand Up @@ -111,7 +111,7 @@ bool CoreChecks::ValidateBufferViewBuffer(const vvl::Buffer &buffer_state, const
"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"
"(supported bufferFeatures: %s)",
string_VkBufferUsageFlags2KHR(usage).c_str(), string_VkFormat(format),
string_VkBufferUsageFlags2(usage).c_str(), string_VkFormat(format),
string_VkFormatFeatureFlags2(format_properties.bufferFeatures).c_str());
}
if ((usage & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) &&
Expand All @@ -120,7 +120,7 @@ bool CoreChecks::ValidateBufferViewBuffer(const vvl::Buffer &buffer_state, const
"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"
"(supported bufferFeatures: %s)",
string_VkBufferUsageFlags2KHR(usage).c_str(), string_VkFormat(format),
string_VkBufferUsageFlags2(usage).c_str(), string_VkFormat(format),
string_VkFormatFeatureFlags2(format_properties.bufferFeatures).c_str());
}
return skip;
Expand Down Expand Up @@ -233,7 +233,7 @@ bool CoreChecks::ValidateCreateBufferDescriptorBuffer(const VkBufferCreateInfo &

if (!(usage & (VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT | VK_BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT))) {
skip |= LogError("VUID-VkBufferCreateInfo-usage-08103", device, create_info_loc.dot(Field::usage), "is (%s).",
string_VkBufferUsageFlags2KHR(usage).c_str());
string_VkBufferUsageFlags2(usage).c_str());
}
}

Expand Down Expand Up @@ -435,13 +435,13 @@ bool CoreChecks::PreCallValidateCreateBufferView(VkDevice device, const VkBuffer
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) {
skip |= LogError("VUID-VkBufferViewCreateInfo-pNext-08780", objlist,
create_info_loc.pNext(Struct::VkBufferUsageFlags2CreateInfoKHR, Field::usage), "is %s.",
string_VkBufferUsageFlags2KHR(usage).c_str());
create_info_loc.pNext(Struct::VkBufferUsageFlags2CreateInfo, Field::usage), "is %s.",
string_VkBufferUsageFlags2(usage).c_str());
} else if ((usage & buffer_state.usage) != usage) {
skip |= LogError("VUID-VkBufferViewCreateInfo-pNext-08781", objlist,
create_info_loc.pNext(Struct::VkBufferUsageFlags2CreateInfoKHR, Field::usage),
"(%s) is not a subset of the buffer's usage (%s).", string_VkBufferUsageFlags2KHR(usage).c_str(),
string_VkBufferUsageFlags2KHR(buffer_state.usage).c_str());
create_info_loc.pNext(Struct::VkBufferUsageFlags2CreateInfo, Field::usage),
"(%s) is not a subset of the buffer's usage (%s).", string_VkBufferUsageFlags2(usage).c_str(),
string_VkBufferUsageFlags2(buffer_state.usage).c_str());
}
}

Expand Down
Loading

0 comments on commit 3bcff29

Please sign in to comment.