From 7578eef44671f4e244f0ef08f496d2748ebd6b7b Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Thu, 13 Apr 2017 10:06:48 -0600 Subject: layers: Use UNKNOWN object type instead zero-cast Change-Id: I36c175e78d7a33667f1485ed0e53f1dadab62a31 --- layers/buffer_validation.cpp | 9 ++-- layers/core_validation.cpp | 93 ++++++++++++++++---------------- layers/parameter_validation.cpp | 103 ++++++++++++++++++------------------ layers/parameter_validation_utils.h | 5 +- 4 files changed, 106 insertions(+), 104 deletions(-) diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index 30865e37..e1773975 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -301,8 +301,8 @@ bool VerifyFramebufferAndRenderPassLayouts(layer_data *device_data, GLOBAL_CB_NO continue; } if (initial_layout != VK_IMAGE_LAYOUT_UNDEFINED && initial_layout != node.layout) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, - DRAWSTATE_INVALID_RENDERPASS, "DS", + skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS", "You cannot start a render pass using attachment %u " "where the render pass initial layout is %s and the previous " "known layout of the attachment is %s. The layouts must match, or " @@ -2103,9 +2103,8 @@ bool ValidateLayoutVsAttachmentDescription(const debug_report_data *report_data, if (attachment_description.loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR) { if ((first_layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL) || (first_layout == VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - VkDebugReportObjectTypeEXT(0), __LINE__, VALIDATION_ERROR_02351, "DS", - "Cannot clear attachment %d with invalid first layout %s. %s", attachment, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, + VALIDATION_ERROR_02351, "DS", "Cannot clear attachment %d with invalid first layout %s. %s", attachment, string_VkImageLayout(first_layout), validation_error_map[VALIDATION_ERROR_02351]); } } diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 70888257..15656eec 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -1548,14 +1548,15 @@ static bool validate_interface_between_stages(debug_report_data *report_data, sh auto b_first = b_at_end ? std::make_pair(0u, 0u) : b_it->first; if (b_at_end || ((!a_at_end) && (a_first < b_first))) { - if (log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, - SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC", "%s writes to output location %u.%u which is not consumed by %s", - producer_stage->name, a_first.first, a_first.second, consumer_stage->name)) { + if (log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC", + "%s writes to output location %u.%u which is not consumed by %s", producer_stage->name, a_first.first, + a_first.second, consumer_stage->name)) { pass = false; } a_it++; } else if (a_at_end || a_first > b_first) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_INPUT_NOT_PRODUCED, "SC", "%s consumes input location %u.%u which is not written by %s", consumer_stage->name, b_first.first, b_first.second, producer_stage->name)) { pass = false; @@ -1569,7 +1570,7 @@ static bool validate_interface_between_stages(debug_report_data *report_data, sh if (!types_match(producer, consumer, a_it->second.type_id, b_it->second.type_id, producer_stage->arrayed_output && !a_it->second.is_patch && !a_it->second.is_block_member, consumer_stage->arrayed_input && !b_it->second.is_patch && !b_it->second.is_block_member, true)) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", "Type mismatch on location %u.%u: '%s' vs '%s'", a_first.first, a_first.second, describe_type(producer, a_it->second.type_id).c_str(), describe_type(consumer, b_it->second.type_id).c_str())) { @@ -1707,7 +1708,7 @@ static bool validate_vi_consistency(debug_report_data *report_data, VkPipelineVe auto &binding = bindings[desc->binding]; if (binding) { // TODO: VALIDATION_ERROR_02105 perhaps? - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_INCONSISTENT_VI, "SC", "Duplicate vertex input binding descriptions for binding %d", desc->binding)) { pass = false; @@ -1747,8 +1748,8 @@ static bool validate_vi_against_vs_inputs(debug_report_data *report_data, VkPipe auto a_first = a_at_end ? 0 : it_a->first; auto b_first = b_at_end ? 0 : it_b->first.first; if (!a_at_end && (b_at_end || a_first < b_first)) { - if (!used && log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, - __LINE__, SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC", + if (!used && log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, + 0, __LINE__, SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC", "Vertex attribute at location %d not consumed by vertex shader", a_first)) { pass = false; } @@ -1767,7 +1768,7 @@ static bool validate_vi_against_vs_inputs(debug_report_data *report_data, VkPipe // Type checking if (!(attrib_type & input_type)) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", "Attribute type of `%s` at location %d does not match vertex shader input type of `%s`", string_VkFormat(it_a->second->format), a_first, describe_type(vs, it_b->second.type_id).c_str())) { @@ -1813,14 +1814,14 @@ static bool validate_fs_outputs_against_render_pass(debug_report_data *report_da bool b_at_end = color_attachments.size() == 0 || it_b == color_attachments.end(); if (!a_at_end && (b_at_end || it_a->first.first < it_b->first)) { - if (log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC", "fragment shader writes to output location %d with no matching attachment", it_a->first.first)) { pass = false; } it_a++; } else if (!b_at_end && (a_at_end || it_a->first.first > it_b->first)) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_INPUT_NOT_PRODUCED, "SC", "Attachment %d not written by fragment shader", it_b->first)) { pass = false; } @@ -1831,7 +1832,7 @@ static bool validate_fs_outputs_against_render_pass(debug_report_data *report_da // Type checking if (!(output_type & att_type)) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", "Attachment %d of type `%s` does not match fragment shader output type of `%s`", it_b->first, string_VkFormat(it_b->second), describe_type(fs, it_a->second.type_id).c_str())) { @@ -1990,8 +1991,8 @@ static bool validate_push_constant_block_against_pipeline(debug_report_data *rep found_range = true; if ((range.stageFlags & stage) == 0) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, - SHADER_CHECKER_PUSH_CONSTANT_NOT_ACCESSIBLE_FROM_STAGE, "SC", + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, SHADER_CHECKER_PUSH_CONSTANT_NOT_ACCESSIBLE_FROM_STAGE, "SC", "Push constant range covering variable starting at " "offset %u not accessible from stage %s", offset, string_VkShaderStageFlagBits(stage))) { @@ -2004,7 +2005,7 @@ static bool validate_push_constant_block_against_pipeline(debug_report_data *rep } if (!found_range) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_PUSH_CONSTANT_OUT_OF_RANGE, "SC", "Push constant range covering variable starting at " "offset %u not declared in layout", @@ -2372,7 +2373,7 @@ static bool descriptor_type_match(shader_module const *module, uint32_t type_id, static bool require_feature(debug_report_data *report_data, VkBool32 feature, char const *feature_name) { if (!feature) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_FEATURE_NOT_ENABLED, "SC", "Shader requires VkPhysicalDeviceFeatures::%s but is not " "enabled on the device", @@ -2386,7 +2387,7 @@ static bool require_feature(debug_report_data *report_data, VkBool32 feature, ch static bool require_extension(debug_report_data *report_data, VkBool32 extension, char const *extension_name) { if (!extension) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_FEATURE_NOT_ENABLED, "SC", "Shader requires extension %s but is not " "enabled on the device", @@ -2619,8 +2620,8 @@ static bool validate_pipeline_shader_stage( // Find the entrypoint auto entrypoint = *out_entrypoint = find_entrypoint(module, pStage->pName, pStage->stage); if (entrypoint == module->end()) { - if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, VALIDATION_ERROR_00510, - "SC", "No entrypoint found named `%s` for stage %s. %s.", pStage->pName, + if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, + VALIDATION_ERROR_00510, "SC", "No entrypoint found named `%s` for stage %s. %s.", pStage->pName, string_VkShaderStageFlagBits(pStage->stage), validation_error_map[VALIDATION_ERROR_00510])) { return false; // no point continuing beyond here, any analysis is just going to be garbage. } @@ -2651,7 +2652,7 @@ static bool validate_pipeline_shader_stage( unsigned required_descriptor_count; if (!binding) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_MISSING_DESCRIPTOR, "SC", "Shader uses descriptor slot %u.%u (used as type `%s`) but not declared in pipeline layout", use.first.first, use.first.second, describe_type(module, use.second.type_id).c_str())) { @@ -2668,7 +2669,7 @@ static bool validate_pipeline_shader_stage( pass = false; } } else if (!descriptor_type_match(module, use.second.type_id, binding->descriptorType, required_descriptor_count)) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_DESCRIPTOR_TYPE_MISMATCH, "SC", "Type mismatch on descriptor slot " "%u.%u (used as type `%s`) but " @@ -2678,7 +2679,7 @@ static bool validate_pipeline_shader_stage( pass = false; } } else if (binding->descriptorCount < required_descriptor_count) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_DESCRIPTOR_TYPE_MISMATCH, "SC", "Shader expects at least %u descriptors for binding %u.%u (used as type `%s`) but only %u provided", required_descriptor_count, use.first.first, use.first.second, @@ -2702,13 +2703,13 @@ static bool validate_pipeline_shader_stage( : VK_ATTACHMENT_UNUSED; if (index == VK_ATTACHMENT_UNUSED) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_MISSING_INPUT_ATTACHMENT, "SC", "Shader consumes input attachment index %d but not provided in subpass", use.first)) { pass = false; } } else if (!(get_format_type(rpci->pAttachments[index].format) & get_fundamental_type(module, use.second.type_id))) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_INPUT_ATTACHMENT_TYPE_MISMATCH, "SC", "Subpass input attachment %u format of %s does not match type used in shader `%s`", use.first, string_VkFormat(rpci->pAttachments[index].format), describe_type(module, use.second.type_id).c_str())) { @@ -2865,8 +2866,8 @@ static bool ValidatePipelineDrawtimeState(layer_data const *dev_data, LAST_BOUND ss << "Dynamic viewport(s) "; list_bits(ss, missingViewportMask); ss << " are used by pipeline state object, but were not provided via calls to vkCmdSetViewport()."; - skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, - __LINE__, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS", "%s", ss.str().c_str()); + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, + 0, __LINE__, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS", "%s", ss.str().c_str()); } } @@ -2878,8 +2879,8 @@ static bool ValidatePipelineDrawtimeState(layer_data const *dev_data, LAST_BOUND ss << "Dynamic scissor(s) "; list_bits(ss, missingScissorMask); ss << " are used by pipeline state object, but were not provided via calls to vkCmdSetScissor()."; - skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, - __LINE__, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS", "%s", ss.str().c_str()); + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, + 0, __LINE__, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS", "%s", ss.str().c_str()); } } } @@ -8809,8 +8810,8 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf // Verify that view only has a single mip level if (ivci.subresourceRange.levelCount != 1) { skip_call |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, - VALIDATION_ERROR_00411, "DS", + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, VALIDATION_ERROR_00411, "DS", "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has mip levelCount of %u " "but only a single mip level (levelCount == 1) is allowed when creating a Framebuffer. %s", i, ivci.subresourceRange.levelCount, validation_error_map[VALIDATION_ERROR_00411]); @@ -8821,8 +8822,8 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf if ((ivci.subresourceRange.layerCount < pCreateInfo->layers) || (mip_width < pCreateInfo->width) || (mip_height < pCreateInfo->height)) { skip_call |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, - DRAWSTATE_INVALID_FRAMEBUFFER_CREATE_INFO, "DS", + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, DRAWSTATE_INVALID_FRAMEBUFFER_CREATE_INFO, "DS", "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u mip level %u has dimensions smaller " "than the corresponding " "framebuffer dimensions. Attachment dimensions must be at least as large. Here are the respective " @@ -8839,7 +8840,7 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf ((ivci.components.b != VK_COMPONENT_SWIZZLE_IDENTITY) && (ivci.components.b != VK_COMPONENT_SWIZZLE_B)) || ((ivci.components.a != VK_COMPONENT_SWIZZLE_IDENTITY) && (ivci.components.a != VK_COMPONENT_SWIZZLE_A))) { skip_call |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_00412, "DS", "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has non-identy swizzle. All framebuffer " "attachments must have been created with the identity swizzle. Here are the actual swizzle values:\n" @@ -8873,8 +8874,8 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf } // Verify FB dimensions are within physical device limits if (pCreateInfo->width > dev_data->phys_dev_properties.properties.limits.maxFramebufferWidth) { - skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, - VALIDATION_ERROR_00413, "DS", + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, VALIDATION_ERROR_00413, "DS", "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo width exceeds physical device limits. " "Requested width: %u, device max: %u\n" "%s", @@ -8882,8 +8883,8 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf validation_error_map[VALIDATION_ERROR_00413]); } if (pCreateInfo->height > dev_data->phys_dev_properties.properties.limits.maxFramebufferHeight) { - skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, - VALIDATION_ERROR_00414, "DS", + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, VALIDATION_ERROR_00414, "DS", "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo height exceeds physical device limits. " "Requested height: %u, device max: %u\n" "%s", @@ -8891,8 +8892,8 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf validation_error_map[VALIDATION_ERROR_00414]); } if (pCreateInfo->layers > dev_data->phys_dev_properties.properties.limits.maxFramebufferLayers) { - skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, - VALIDATION_ERROR_00415, "DS", + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, VALIDATION_ERROR_00415, "DS", "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo layers exceeds physical device limits. " "Requested layers: %u, device max: %u\n" "%s", @@ -9226,7 +9227,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateShaderModule(VkDevice device, const VkShade if (!dev_data->device_extensions.nv_glsl_shader_enabled || (pCreateInfo->pCode[0] == spv::MagicNumber)) { skip_call |= log_msg(dev_data->report_data, spv_valid == SPV_WARNING ? VK_DEBUG_REPORT_WARNING_BIT_EXT : VK_DEBUG_REPORT_ERROR_BIT_EXT, - VkDebugReportObjectTypeEXT(0), 0, __LINE__, SHADER_CHECKER_INCONSISTENT_SPIRV, "SC", + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_INCONSISTENT_SPIRV, "SC", "SPIR-V module not valid: %s", diag && diag->error ? diag->error : "(no error text)"); } } @@ -9297,8 +9298,8 @@ static bool ValidateRenderpassAttachmentUsage(layer_data *dev_data, const VkRend if (!skip_call && attachment != VK_ATTACHMENT_UNUSED && pCreateInfo->pAttachments[attachment].samples != VK_SAMPLE_COUNT_1_BIT) { - skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, - __LINE__, VALIDATION_ERROR_00352, "DS", + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_00352, "DS", "CreateRenderPass: Subpass %u requests multisample resolve into attachment %u, " "which must have VK_SAMPLE_COUNT_1_BIT but has %s. %s", i, attachment, string_VkSampleCountFlagBits(pCreateInfo->pAttachments[attachment].samples), @@ -9312,8 +9313,8 @@ static bool ValidateRenderpassAttachmentUsage(layer_data *dev_data, const VkRend sample_count |= (unsigned)pCreateInfo->pAttachments[attachment].samples; if (subpass_performs_resolve && pCreateInfo->pAttachments[attachment].samples == VK_SAMPLE_COUNT_1_BIT) { - skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, - __LINE__, VALIDATION_ERROR_00351, "DS", + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_00351, "DS", "CreateRenderPass: Subpass %u requests multisample resolve from attachment %u " "which has VK_SAMPLE_COUNT_1_BIT. %s", i, attachment, validation_error_map[VALIDATION_ERROR_00351]); @@ -9336,8 +9337,8 @@ static bool ValidateRenderpassAttachmentUsage(layer_data *dev_data, const VkRend } if (sample_count && !IsPowerOfTwo(sample_count)) { - skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, - VALIDATION_ERROR_00337, "DS", + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, VALIDATION_ERROR_00337, "DS", "CreateRenderPass: Subpass %u attempts to render to " "attachments with inconsistent sample counts. %s", i, validation_error_map[VALIDATION_ERROR_00337]); diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index 2c887463..ad074f0c 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -1255,12 +1255,13 @@ static bool validate_queue_family_index(layer_data *device_data, const char *fun bool skip = false; if (index == VK_QUEUE_FAMILY_IGNORED) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, - "%s: %s cannot be VK_QUEUE_FAMILY_IGNORED.", function_name, parameter_name); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, + LayerName, "%s: %s cannot be VK_QUEUE_FAMILY_IGNORED.", function_name, parameter_name); } else { const auto &queue_data = device_data->queueFamilyIndexMap.find(index); if (queue_data == device_data->queueFamilyIndexMap.end()) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, + LayerName, "%s: %s (%d) must be one of the indices specified when the device was created, via " "the VkDeviceQueueCreateInfo structure.", function_name, parameter_name, index); @@ -1280,13 +1281,13 @@ static bool validate_queue_family_indices(layer_data *device_data, const char *f if (indices != nullptr) { for (uint32_t i = 0; i < count; i++) { if (indices[i] == VK_QUEUE_FAMILY_IGNORED) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, LayerName, "%s: %s[%d] cannot be VK_QUEUE_FAMILY_IGNORED.", function_name, parameter_name, i); } else { const auto &queue_data = device_data->queueFamilyIndexMap.find(indices[i]); if (queue_data == device_data->queueFamilyIndexMap.end()) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, - LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, 1, LayerName, "%s: %s[%d] (%d) must be one of the indices specified when the device was " "created, via the VkDeviceQueueCreateInfo structure.", function_name, parameter_name, i, indices[i]); @@ -2610,7 +2611,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI // If imageType is VK_IMAGE_TYPE_1D, both extent.height and extent.depth must be 1 if ((pCreateInfo->imageType == VK_IMAGE_TYPE_1D) && (pCreateInfo->extent.height != 1) && (pCreateInfo->extent.depth != 1)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02129, LayerName, "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_1D, both " "pCreateInfo->extent.height and pCreateInfo->extent.depth must be 1. %s", @@ -2622,7 +2623,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI // extent.height must be equal if ((pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) && (pCreateInfo->extent.width != pCreateInfo->extent.height)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02127, LayerName, "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D and " "pCreateInfo->flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, " @@ -2632,8 +2633,8 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI if (pCreateInfo->extent.depth != 1) { skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, VALIDATION_ERROR_02130, - LayerName, + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, + VALIDATION_ERROR_02130, LayerName, "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D, pCreateInfo->extent.depth must be 1. %s", validation_error_map[VALIDATION_ERROR_02130]); } @@ -2643,7 +2644,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI uint32_t maxDim = std::max(std::max(pCreateInfo->extent.width, pCreateInfo->extent.height), pCreateInfo->extent.depth); if (pCreateInfo->mipLevels > (floor(log2(maxDim)) + 1)) { skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02131, LayerName, "vkCreateImage(): pCreateInfo->mipLevels must be less than or equal to " "floor(log2(max(pCreateInfo->extent.width, pCreateInfo->extent.height, pCreateInfo->extent.depth)))+1. %s", @@ -2654,7 +2655,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI // VK_IMAGE_CREATE_SPARSE_BINDING_BIT if (((pCreateInfo->flags & (VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT)) != 0) && ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) != VK_IMAGE_CREATE_SPARSE_BINDING_BIT)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02160, LayerName, "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or " "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_IMAGE_CREATE_SPARSE_BINDING_BIT. %s", @@ -2665,7 +2666,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI if ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) != 0) { // Linear tiling is unsupported if (VK_IMAGE_TILING_LINEAR == pCreateInfo->tiling) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, LayerName, "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT " "then image tiling of VK_IMAGE_TILING_LINEAR is not supported"); @@ -2673,7 +2674,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI // Sparse 1D image isn't valid if (VK_IMAGE_TYPE_1D == pCreateInfo->imageType) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02352, LayerName, "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 1D image. %s", validation_error_map[VALIDATION_ERROR_02352]); @@ -2682,7 +2683,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI // Sparse 2D image when device doesn't support it if ((VK_FALSE == device_data->physical_device_features.sparseResidencyImage2D) && (VK_IMAGE_TYPE_2D == pCreateInfo->imageType)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02144, LayerName, "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 2D image if corresponding " "feature is not enabled on the device. %s", @@ -2692,7 +2693,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI // Sparse 3D image when device doesn't support it if ((VK_FALSE == device_data->physical_device_features.sparseResidencyImage3D) && (VK_IMAGE_TYPE_3D == pCreateInfo->imageType)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02145, LayerName, "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 3D image if corresponding " "feature is not enabled on the device. %s", @@ -2704,7 +2705,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI if ((VK_FALSE == device_data->physical_device_features.sparseResidency2Samples) && (VK_SAMPLE_COUNT_2_BIT == pCreateInfo->samples)) { skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02146, LayerName, "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 2-sample image if corresponding " "feature is not enabled on the device. %s", @@ -2712,7 +2713,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency4Samples) && (VK_SAMPLE_COUNT_4_BIT == pCreateInfo->samples)) { skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02147, LayerName, "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 4-sample image if corresponding " "feature is not enabled on the device. %s", @@ -2720,7 +2721,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency8Samples) && (VK_SAMPLE_COUNT_8_BIT == pCreateInfo->samples)) { skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02148, LayerName, "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 8-sample image if corresponding " "feature is not enabled on the device. %s", @@ -2728,7 +2729,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency16Samples) && (VK_SAMPLE_COUNT_16_BIT == pCreateInfo->samples)) { skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02149, LayerName, "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 16-sample image if corresponding " "feature is not enabled on the device. %s", @@ -2803,56 +2804,56 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImageView(VkDevice device, const VkImageVie if ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D) || (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_2D)) { if ((pCreateInfo->subresourceRange.layerCount != 1) && (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, - "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_%dD, " - "pCreateInfo->subresourceRange.layerCount must be 1", - ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D) ? 1 : 2)); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, + LayerName, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_%dD, " + "pCreateInfo->subresourceRange.layerCount must be 1", + ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D) ? 1 : 2)); } } else if ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D_ARRAY) || (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_2D_ARRAY)) { if ((pCreateInfo->subresourceRange.layerCount < 1) && (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, - "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_%dD_ARRAY, " - "pCreateInfo->subresourceRange.layerCount must be >= 1", - ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D_ARRAY) ? 1 : 2)); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, + LayerName, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_%dD_ARRAY, " + "pCreateInfo->subresourceRange.layerCount must be >= 1", + ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D_ARRAY) ? 1 : 2)); } } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE) { if ((pCreateInfo->subresourceRange.layerCount != 6) && (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, - "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_CUBE, " - "pCreateInfo->subresourceRange.layerCount must be 6"); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, + LayerName, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_CUBE, " + "pCreateInfo->subresourceRange.layerCount must be 6"); } } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) { if (((pCreateInfo->subresourceRange.layerCount == 0) || ((pCreateInfo->subresourceRange.layerCount % 6) != 0)) && (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, - "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_CUBE_ARRAY, " - "pCreateInfo->subresourceRange.layerCount must be a multiple of 6"); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, + LayerName, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_CUBE_ARRAY, " + "pCreateInfo->subresourceRange.layerCount must be a multiple of 6"); } if (!my_data->physical_device_features.imageCubeArray) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, LayerName, "vkCreateImageView: Device feature imageCubeArray not enabled."); } } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_3D) { if (pCreateInfo->subresourceRange.baseArrayLayer != 0) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, - "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_3D, " - "pCreateInfo->subresourceRange.baseArrayLayer must be 0"); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, + LayerName, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_3D, " + "pCreateInfo->subresourceRange.baseArrayLayer must be 0"); } if ((pCreateInfo->subresourceRange.layerCount != 1) && (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, - "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_3D, " - "pCreateInfo->subresourceRange.layerCount must be 1"); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, + LayerName, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_3D, " + "pCreateInfo->subresourceRange.layerCount must be 1"); } } } @@ -3112,8 +3113,8 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipeli } } else { if (pCreateInfos[i].pViewportState->scissorCount != pCreateInfos[i].pViewportState->viewportCount) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, - VALIDATION_ERROR_01434, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, VALIDATION_ERROR_01434, LayerName, "Graphics Pipeline viewport count (%u) must match scissor count (%u). %s", pCreateInfos[i].pViewportState->viewportCount, pCreateInfos[i].pViewportState->scissorCount, validation_error_map[VALIDATION_ERROR_01434]); @@ -3957,8 +3958,8 @@ static bool PreCreateRenderPass(layer_data *dev_data, const VkRenderPassCreateIn std::stringstream ss; ss << "vkCreateRenderPass: pCreateInfo->pAttachments[" << i << "].format is VK_FORMAT_UNDEFINED. " << validation_error_map[VALIDATION_ERROR_00336]; - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, - VALIDATION_ERROR_00336, "IMAGE", "%s", ss.str().c_str()); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, VALIDATION_ERROR_00336, "IMAGE", "%s", ss.str().c_str()); } } diff --git a/layers/parameter_validation_utils.h b/layers/parameter_validation_utils.h index dd67a72e..e85531d6 100644 --- a/layers/parameter_validation_utils.h +++ b/layers/parameter_validation_utils.h @@ -135,8 +135,9 @@ bool ValidateGreaterThan(debug_report_data *report_data, const char *api_name, c bool skip_call = false; if (value <= lower_bound) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, - "%s: parameter %s must be greater than %d", api_name, parameter_name.get_name().c_str(), lower_bound); + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, LayerName, + "%s: parameter %s must be greater than %d", api_name, parameter_name.get_name().c_str(), lower_bound); } return skip_call; -- cgit v1.2.3