From ab8221729db0fbe1a9378cb836823719988b6248 Mon Sep 17 00:00:00 2001 From: ziga-lunarg Date: Sat, 19 Aug 2023 11:49:05 +0200 Subject: [PATCH] layers: Fix error message with push descriptors --- layers/core_checks/cc_descriptor.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/layers/core_checks/cc_descriptor.cpp b/layers/core_checks/cc_descriptor.cpp index 71014703939..570a3eefd9d 100644 --- a/layers/core_checks/cc_descriptor.cpp +++ b/layers/core_checks/cc_descriptor.cpp @@ -968,11 +968,17 @@ bool CoreChecks::ValidateDescriptor(const DescriptorContext &context, const Desc "VUID-VkDescriptorImageInfo-imageLayout-00344", &hit_error); if (hit_error) { auto set = context.descriptor_set.GetSet(); - return LogError( - set, context.vuids.descriptor_buffer_bit_set_08114, - "%s: Descriptor set %s Image layout specified at vkCmdBindDescriptorSets time doesn't match actual image " - "layout at time descriptor is used. See previous error callback for specific details.", - context.caller, FormatHandle(set).c_str()); + std::stringstream msg; + if (!context.descriptor_set.IsPushDescriptor()) { + msg << "Descriptor set " << FormatHandle(set) + << " Image layout specified by vkCmdBindDescriptorSets doesn't match actual image layout at time " + "descriptor is used."; + } else { + msg << "Image layout specified by vkCmdPushDescriptorSetKHR doesn't match actual image layout at time " + "descriptor is used"; + } + return LogError(set, context.vuids.descriptor_buffer_bit_set_08114, + "%s: %s. See previous error callback for specific details.", context.caller, msg.str().c_str()); } if (context.checked_layouts) { context.checked_layouts->emplace(image_view, image_layout);