aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-04-24 09:11:35 -0600
committerMark Lobodzinski <mark@lunarg.com>2017-04-24 11:56:09 -0600
commit5d01dd52cf1e5075f7a90220e31acfcf97cce102 (patch)
tree860dce9c1dca4ddbbbf1ca9f3b9f1d13a4be8a79 /layers/core_validation.cpp
parent72b210d1669a19c1f5c906f99842f2374466d6e4 (diff)
downloadusermoji-5d01dd52cf1e5075f7a90220e31acfcf97cce102.tar.xz
layers: Banish 'skip_call' once and forever
Except for swapchain.cpp, which is undergoing a merge into CV. Change-Id: I8b18518ef662a9a11a808ef3dce1b8f60d858fb3
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp1931
1 files changed, 946 insertions, 985 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 09ecd869..9fd6e04c 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -500,7 +500,7 @@ void SetBufferMemoryValid(layer_data *dev_data, BUFFER_STATE *buffer_state, bool
// Find Mem Obj Info and add CB reference to list container
static bool update_cmd_buf_and_mem_references(layer_data *dev_data, const VkCommandBuffer cb, const VkDeviceMemory mem,
const char *apiName) {
- bool skip_call = false;
+ bool skip = false;
// Skip validation if this image was created through WSI
if (mem != MEMTRACKER_SWAP_CHAIN_IMAGE_KEY) {
@@ -516,7 +516,7 @@ static bool update_cmd_buf_and_mem_references(layer_data *dev_data, const VkComm
}
}
}
- return skip_call;
+ return skip;
}
// Create binding link between given sampler and command buffer node
@@ -711,7 +711,7 @@ static void SetMemBinding(layer_data *dev_data, VkDeviceMemory mem, uint64_t han
// TODO: We may need to refactor or pass in multiple valid usage statements to handle multiple valid usage conditions.
static bool ValidateSetMemBinding(layer_data *dev_data, VkDeviceMemory mem, uint64_t handle, VulkanObjectType type,
const char *apiName) {
- bool skip_call = false;
+ bool skip = false;
// It's an error to bind an object to NULL memory
if (mem != VK_NULL_HANDLE) {
BINDABLE *mem_binding = GetObjectMemBinding(dev_data, handle, type);
@@ -725,12 +725,11 @@ static bool ValidateSetMemBinding(layer_data *dev_data, VkDeviceMemory mem, uint
} else {
assert(strcmp(apiName, "vkBindImageMemory()") == 0);
}
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
- reinterpret_cast<uint64_t &>(mem), __LINE__, error_code, "MEM",
- "In %s, attempting to bind memory (0x%" PRIxLEAST64 ") to object (0x%" PRIxLEAST64
- ") which was created with sparse memory flags (VK_%s_CREATE_SPARSE_*_BIT). %s",
- apiName, reinterpret_cast<uint64_t &>(mem), handle, handle_type, validation_error_map[error_code]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
+ reinterpret_cast<uint64_t &>(mem), __LINE__, error_code, "MEM",
+ "In %s, attempting to bind memory (0x%" PRIxLEAST64 ") to object (0x%" PRIxLEAST64
+ ") which was created with sparse memory flags (VK_%s_CREATE_SPARSE_*_BIT). %s",
+ apiName, reinterpret_cast<uint64_t &>(mem), handle, handle_type, validation_error_map[error_code]);
}
DEVICE_MEM_INFO *mem_info = GetMemObjInfo(dev_data, mem);
if (mem_info) {
@@ -742,25 +741,23 @@ static bool ValidateSetMemBinding(layer_data *dev_data, VkDeviceMemory mem, uint
} else {
assert(strcmp(apiName, "vkBindImageMemory()") == 0);
}
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
- reinterpret_cast<uint64_t &>(mem), __LINE__, error_code, "MEM",
- "In %s, attempting to bind memory (0x%" PRIxLEAST64 ") to object (0x%" PRIxLEAST64
- ") which has already been bound to mem object 0x%" PRIxLEAST64 ". %s",
- apiName, reinterpret_cast<uint64_t &>(mem), handle, reinterpret_cast<uint64_t &>(prev_binding->mem),
- validation_error_map[error_code]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
+ reinterpret_cast<uint64_t &>(mem), __LINE__, error_code, "MEM",
+ "In %s, attempting to bind memory (0x%" PRIxLEAST64 ") to object (0x%" PRIxLEAST64
+ ") which has already been bound to mem object 0x%" PRIxLEAST64 ". %s",
+ apiName, reinterpret_cast<uint64_t &>(mem), handle, reinterpret_cast<uint64_t &>(prev_binding->mem),
+ validation_error_map[error_code]);
} else if (mem_binding->binding.mem == MEMORY_UNBOUND) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
- reinterpret_cast<uint64_t &>(mem), __LINE__, MEMTRACK_REBIND_OBJECT, "MEM",
- "In %s, attempting to bind memory (0x%" PRIxLEAST64 ") to object (0x%" PRIxLEAST64
- ") which was previous bound to memory that has since been freed. Memory bindings are immutable in "
- "Vulkan so this attempt to bind to new memory is not allowed.",
- apiName, reinterpret_cast<uint64_t &>(mem), handle);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
+ reinterpret_cast<uint64_t &>(mem), __LINE__, MEMTRACK_REBIND_OBJECT, "MEM",
+ "In %s, attempting to bind memory (0x%" PRIxLEAST64 ") to object (0x%" PRIxLEAST64
+ ") which was previous bound to memory that has since been freed. Memory bindings are immutable in "
+ "Vulkan so this attempt to bind to new memory is not allowed.",
+ apiName, reinterpret_cast<uint64_t &>(mem), handle);
}
}
}
- return skip_call;
+ return skip;
}
// For NULL mem case, clear any previous binding Else...
@@ -771,7 +768,7 @@ static bool ValidateSetMemBinding(layer_data *dev_data, VkDeviceMemory mem, uint
// Return VK_TRUE if addition is successful, VK_FALSE otherwise
static bool SetSparseMemBinding(layer_data *dev_data, MEM_BINDING binding, uint64_t handle, VulkanObjectType type,
const char *apiName) {
- bool skip_call = VK_FALSE;
+ bool skip = VK_FALSE;
// Handle NULL case separately, just clear previous binding & decrement reference
if (binding.mem == VK_NULL_HANDLE) {
// TODO : This should cause the range of the resource to be unbound according to spec
@@ -786,7 +783,7 @@ static bool SetSparseMemBinding(layer_data *dev_data, MEM_BINDING binding, uint6
mem_binding->sparse_bindings.insert(binding);
}
}
- return skip_call;
+ return skip;
}
// Return a string representation of CMD_TYPE enum
@@ -2780,7 +2777,7 @@ static void list_bits(std::ostream &s, uint32_t bits) {
// Validate draw-time state related to the PSO
static bool ValidatePipelineDrawtimeState(layer_data const *dev_data, LAST_BOUND_STATE const &state, const GLOBAL_CB_NODE *pCB,
PIPELINE_STATE const *pPipeline) {
- bool skip_call = false;
+ bool skip = false;
// Verify vertex binding
if (pPipeline->vertexBindingDescriptions.size() > 0) {
@@ -2788,7 +2785,7 @@ static bool ValidatePipelineDrawtimeState(layer_data const *dev_data, LAST_BOUND
auto vertex_binding = pPipeline->vertexBindingDescriptions[i].binding;
if ((pCB->currentDrawData.buffers.size() < (vertex_binding + 1)) ||
(pCB->currentDrawData.buffers[vertex_binding] == VK_NULL_HANDLE)) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS",
"The Pipeline State Object (0x%" PRIxLEAST64
@@ -2800,12 +2797,12 @@ static bool ValidatePipelineDrawtimeState(layer_data const *dev_data, LAST_BOUND
}
} else {
if (!pCB->currentDrawData.buffers.empty() && !pCB->vertex_buffer_used) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast<uint64_t>(pCB->commandBuffer),
- __LINE__, DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS",
- "Vertex buffers are bound to command buffer (0x%p"
- ") but no vertex buffers are attached to this Pipeline State Object (0x%" PRIxLEAST64 ").",
- pCB->commandBuffer, (uint64_t)state.pipeline_state->pipeline);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast<uint64_t>(pCB->commandBuffer),
+ __LINE__, DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS",
+ "Vertex buffers are bound to command buffer (0x%p"
+ ") but no vertex buffers are attached to this Pipeline State Object (0x%" PRIxLEAST64 ").",
+ pCB->commandBuffer, (uint64_t)state.pipeline_state->pipeline);
}
}
// If Viewport or scissors are dynamic, verify that dynamic count matches PSO count.
@@ -2824,8 +2821,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, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT,
- 0, __LINE__, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS", "%s", ss.str().c_str());
+ skip |= 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());
}
}
@@ -2837,8 +2834,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, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT,
- 0, __LINE__, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS", "%s", ss.str().c_str());
+ skip |= 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());
}
}
}
@@ -2867,19 +2864,18 @@ static bool ValidatePipelineDrawtimeState(layer_data const *dev_data, LAST_BOUND
}
if (subpass_num_samples && static_cast<unsigned>(pso_num_samples) != subpass_num_samples) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<const uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_NUM_SAMPLES_MISMATCH, "DS",
- "Num samples mismatch! At draw-time in Pipeline (0x%" PRIxLEAST64
- ") with %u samples while current RenderPass (0x%" PRIxLEAST64 ") w/ %u samples!",
- reinterpret_cast<const uint64_t &>(pPipeline->pipeline), pso_num_samples,
- reinterpret_cast<const uint64_t &>(pCB->activeRenderPass->renderPass), subpass_num_samples);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<const uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_NUM_SAMPLES_MISMATCH,
+ "DS", "Num samples mismatch! At draw-time in Pipeline (0x%" PRIxLEAST64
+ ") with %u samples while current RenderPass (0x%" PRIxLEAST64 ") w/ %u samples!",
+ reinterpret_cast<const uint64_t &>(pPipeline->pipeline), pso_num_samples,
+ reinterpret_cast<const uint64_t &>(pCB->activeRenderPass->renderPass), subpass_num_samples);
}
} else {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<const uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_NUM_SAMPLES_MISMATCH,
- "DS", "No active render pass found at draw-time in Pipeline (0x%" PRIxLEAST64 ")!",
- reinterpret_cast<const uint64_t &>(pPipeline->pipeline));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<const uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_NUM_SAMPLES_MISMATCH, "DS",
+ "No active render pass found at draw-time in Pipeline (0x%" PRIxLEAST64 ")!",
+ reinterpret_cast<const uint64_t &>(pPipeline->pipeline));
}
}
// Verify that PSO creation renderPass is compatible with active renderPass
@@ -2889,28 +2885,26 @@ static bool ValidatePipelineDrawtimeState(layer_data const *dev_data, LAST_BOUND
!verify_renderpass_compatibility(dev_data, pCB->activeRenderPass->createInfo.ptr(), pPipeline->render_pass_ci.ptr(),
err_string)) {
// renderPass that PSO was created with must be compatible with active renderPass that PSO is being used with
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<const uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_RENDERPASS_INCOMPATIBLE, "DS",
- "At Draw time the active render pass (0x%" PRIxLEAST64
- ") is incompatible w/ gfx pipeline "
- "(0x%" PRIxLEAST64 ") that was created w/ render pass (0x%" PRIxLEAST64 ") due to: %s",
- reinterpret_cast<uint64_t &>(pCB->activeRenderPass->renderPass),
- reinterpret_cast<uint64_t const &>(pPipeline->pipeline),
- reinterpret_cast<const uint64_t &>(pPipeline->graphicsPipelineCI.renderPass), err_string.c_str());
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<const uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_RENDERPASS_INCOMPATIBLE,
+ "DS", "At Draw time the active render pass (0x%" PRIxLEAST64
+ ") is incompatible w/ gfx pipeline "
+ "(0x%" PRIxLEAST64 ") that was created w/ render pass (0x%" PRIxLEAST64 ") due to: %s",
+ reinterpret_cast<uint64_t &>(pCB->activeRenderPass->renderPass),
+ reinterpret_cast<uint64_t const &>(pPipeline->pipeline),
+ reinterpret_cast<const uint64_t &>(pPipeline->graphicsPipelineCI.renderPass), err_string.c_str());
}
if (pPipeline->graphicsPipelineCI.subpass != pCB->activeSubpass) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t const &>(pPipeline->pipeline), __LINE__, DRAWSTATE_RENDERPASS_INCOMPATIBLE, "DS",
- "Pipeline was built for subpass %u but used in subpass %u", pPipeline->graphicsPipelineCI.subpass,
- pCB->activeSubpass);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t const &>(pPipeline->pipeline), __LINE__, DRAWSTATE_RENDERPASS_INCOMPATIBLE,
+ "DS", "Pipeline was built for subpass %u but used in subpass %u", pPipeline->graphicsPipelineCI.subpass,
+ pCB->activeSubpass);
}
}
// TODO : Add more checks here
- return skip_call;
+ return skip;
}
// Validate overall state at the time of a draw call
@@ -3022,34 +3016,34 @@ static void UpdateDrawState(layer_data *dev_data, GLOBAL_CB_NODE *cb_state, cons
// Validate HW line width capabilities prior to setting requested line width.
static bool verifyLineWidth(layer_data *dev_data, DRAW_STATE_ERROR dsError, VulkanObjectType object_type, const uint64_t &target,
float lineWidth) {
- bool skip_call = false;
+ bool skip = false;
// First check to see if the physical device supports wide lines.
if ((VK_FALSE == dev_data->enabled_features.wideLines) && (1.0f != lineWidth)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object_type], target,
- __LINE__, dsError, "DS",
- "Attempt to set lineWidth to %f but physical device wideLines feature "
- "not supported/enabled so lineWidth must be 1.0f!",
- lineWidth);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object_type], target, __LINE__,
+ dsError, "DS",
+ "Attempt to set lineWidth to %f but physical device wideLines feature "
+ "not supported/enabled so lineWidth must be 1.0f!",
+ lineWidth);
} else {
// Otherwise, make sure the width falls in the valid range.
if ((dev_data->phys_dev_properties.properties.limits.lineWidthRange[0] > lineWidth) ||
(dev_data->phys_dev_properties.properties.limits.lineWidthRange[1] < lineWidth)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object_type], target,
- __LINE__, dsError, "DS",
- "Attempt to set lineWidth to %f but physical device limits line width "
- "to between [%f, %f]!",
- lineWidth, dev_data->phys_dev_properties.properties.limits.lineWidthRange[0],
- dev_data->phys_dev_properties.properties.limits.lineWidthRange[1]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object_type], target,
+ __LINE__, dsError, "DS",
+ "Attempt to set lineWidth to %f but physical device limits line width "
+ "to between [%f, %f]!",
+ lineWidth, dev_data->phys_dev_properties.properties.limits.lineWidthRange[0],
+ dev_data->phys_dev_properties.properties.limits.lineWidthRange[1]);
}
}
- return skip_call;
+ return skip;
}
// Verify that create state for a pipeline is valid
static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE_STATE *> pPipelines, int pipelineIndex) {
- bool skip_call = false;
+ bool skip = false;
PIPELINE_STATE *pPipeline = pPipelines[pipelineIndex];
@@ -3061,13 +3055,12 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
if (!((pPipeline->graphicsPipelineCI.basePipelineHandle != VK_NULL_HANDLE) ^
(pPipeline->graphicsPipelineCI.basePipelineIndex != -1))) {
// This check is a superset of VALIDATION_ERROR_00526 and VALIDATION_ERROR_00528
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
- "Invalid Pipeline CreateInfo: exactly one of base pipeline index and handle must be specified");
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE,
+ "DS", "Invalid Pipeline CreateInfo: exactly one of base pipeline index and handle must be specified");
} else if (pPipeline->graphicsPipelineCI.basePipelineIndex != -1) {
if (pPipeline->graphicsPipelineCI.basePipelineIndex >= pipelineIndex) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_00518, "DS",
"Invalid Pipeline CreateInfo: base pipeline must occur earlier in array than derivative pipeline. %s",
@@ -3080,10 +3073,9 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
}
if (pBasePipeline && !(pBasePipeline->graphicsPipelineCI.flags & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT)) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
- "Invalid Pipeline CreateInfo: base pipeline does not allow derivatives.");
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE,
+ "DS", "Invalid Pipeline CreateInfo: base pipeline does not allow derivatives.");
}
}
@@ -3092,7 +3084,7 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
auto const render_pass_info = GetRenderPassState(dev_data, pPipeline->graphicsPipelineCI.renderPass)->createInfo.ptr();
const VkSubpassDescription *subpass_desc = &render_pass_info->pSubpasses[pPipeline->graphicsPipelineCI.subpass];
if (color_blend_state->attachmentCount != subpass_desc->colorAttachmentCount) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
reinterpret_cast<const uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02109, "DS",
"vkCreateGraphicsPipelines(): Render pass (0x%" PRIxLEAST64
@@ -3110,7 +3102,7 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
// only attachment state, so memcmp is best suited for the comparison
if (memcmp(static_cast<const void *>(pAttachments), static_cast<const void *>(&pAttachments[i]),
sizeof(pAttachments[0]))) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_01532, "DS",
"Invalid Pipeline CreateInfo: If independent blend feature not "
@@ -3122,7 +3114,7 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
}
}
if (!dev_data->enabled_features.logicOp && (pPipeline->graphicsPipelineCI.pColorBlendState->logicOpEnable != VK_FALSE)) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_01533, "DS",
"Invalid Pipeline CreateInfo: If logic operations feature not enabled, logicOpEnable must be VK_FALSE. %s",
@@ -3135,22 +3127,22 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
// emit errors for renderpass being invalid.
auto renderPass = GetRenderPassState(dev_data, pPipeline->graphicsPipelineCI.renderPass);
if (renderPass && pPipeline->graphicsPipelineCI.subpass >= renderPass->createInfo.subpassCount) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02122, "DS",
- "Invalid Pipeline CreateInfo State: Subpass index %u "
- "is out of range for this renderpass (0..%u). %s",
- pPipeline->graphicsPipelineCI.subpass, renderPass->createInfo.subpassCount - 1,
- validation_error_map[VALIDATION_ERROR_02122]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02122, "DS",
+ "Invalid Pipeline CreateInfo State: Subpass index %u "
+ "is out of range for this renderpass (0..%u). %s",
+ pPipeline->graphicsPipelineCI.subpass, renderPass->createInfo.subpassCount - 1,
+ validation_error_map[VALIDATION_ERROR_02122]);
}
if (!GetDisables(dev_data)->shader_validation && !validate_and_capture_pipeline_shader_state(dev_data, pPipeline)) {
- skip_call = true;
+ skip = true;
}
// Each shader's stage must be unique
if (pPipeline->duplicate_shaders) {
for (uint32_t stage = VK_SHADER_STAGE_VERTEX_BIT; stage & VK_SHADER_STAGE_ALL_GRAPHICS; stage <<= 1) {
if (pPipeline->duplicate_shaders & stage) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE,
"DS", "Invalid Pipeline CreateInfo State: Multiple shaders provided for stage %s",
@@ -3160,7 +3152,7 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
}
// VS is required
if (!(pPipeline->active_shaders & VK_SHADER_STAGE_VERTEX_BIT)) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_00532, "DS",
"Invalid Pipeline CreateInfo State: Vertex Shader required. %s", validation_error_map[VALIDATION_ERROR_00532]);
@@ -3168,46 +3160,46 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
// Either both or neither TC/TE shaders should be defined
if ((pPipeline->active_shaders & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) &&
!(pPipeline->active_shaders & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_00534, "DS",
- "Invalid Pipeline CreateInfo State: TE and TC shaders must be included or excluded as a pair. %s",
- validation_error_map[VALIDATION_ERROR_00534]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_00534, "DS",
+ "Invalid Pipeline CreateInfo State: TE and TC shaders must be included or excluded as a pair. %s",
+ validation_error_map[VALIDATION_ERROR_00534]);
}
if (!(pPipeline->active_shaders & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) &&
(pPipeline->active_shaders & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_00535, "DS",
- "Invalid Pipeline CreateInfo State: TE and TC shaders must be included or excluded as a pair. %s",
- validation_error_map[VALIDATION_ERROR_00535]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_00535, "DS",
+ "Invalid Pipeline CreateInfo State: TE and TC shaders must be included or excluded as a pair. %s",
+ validation_error_map[VALIDATION_ERROR_00535]);
}
// Compute shaders should be specified independent of Gfx shaders
if (pPipeline->active_shaders & VK_SHADER_STAGE_COMPUTE_BIT) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_00533, "DS",
- "Invalid Pipeline CreateInfo State: Do not specify Compute Shader for Gfx Pipeline. %s",
- validation_error_map[VALIDATION_ERROR_00533]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_00533, "DS",
+ "Invalid Pipeline CreateInfo State: Do not specify Compute Shader for Gfx Pipeline. %s",
+ validation_error_map[VALIDATION_ERROR_00533]);
}
// VK_PRIMITIVE_TOPOLOGY_PATCH_LIST primitive topology is only valid for tessellation pipelines.
// Mismatching primitive topology and tessellation fails graphics pipeline creation.
if (pPipeline->active_shaders & (VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) &&
(!pPipeline->graphicsPipelineCI.pInputAssemblyState ||
pPipeline->graphicsPipelineCI.pInputAssemblyState->topology != VK_PRIMITIVE_TOPOLOGY_PATCH_LIST)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02099, "DS",
- "Invalid Pipeline CreateInfo State: "
- "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST must be set as IA "
- "topology for tessellation pipelines. %s",
- validation_error_map[VALIDATION_ERROR_02099]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02099, "DS",
+ "Invalid Pipeline CreateInfo State: "
+ "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST must be set as IA "
+ "topology for tessellation pipelines. %s",
+ validation_error_map[VALIDATION_ERROR_02099]);
}
if (pPipeline->graphicsPipelineCI.pInputAssemblyState &&
pPipeline->graphicsPipelineCI.pInputAssemblyState->topology == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST) {
if (~pPipeline->active_shaders & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02100, "DS",
- "Invalid Pipeline CreateInfo State: "
- "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST primitive "
- "topology is only valid for tessellation pipelines. %s",
- validation_error_map[VALIDATION_ERROR_02100]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02100, "DS",
+ "Invalid Pipeline CreateInfo State: "
+ "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST primitive "
+ "topology is only valid for tessellation pipelines. %s",
+ validation_error_map[VALIDATION_ERROR_02100]);
}
}
@@ -3215,44 +3207,43 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
((pPipeline->graphicsPipelineCI.pTessellationState->patchControlPoints == 0) ||
(pPipeline->graphicsPipelineCI.pTessellationState->patchControlPoints >
dev_data->phys_dev_properties.properties.limits.maxTessellationPatchSize))) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_01426, "DS",
- "Invalid Pipeline CreateInfo State: "
- "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST primitive "
- "topology used with patchControlPoints value %u."
- " patchControlPoints should be >0 and <=%u. %s",
- pPipeline->graphicsPipelineCI.pTessellationState->patchControlPoints,
- dev_data->phys_dev_properties.properties.limits.maxTessellationPatchSize,
- validation_error_map[VALIDATION_ERROR_01426]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_01426, "DS",
+ "Invalid Pipeline CreateInfo State: "
+ "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST primitive "
+ "topology used with patchControlPoints value %u."
+ " patchControlPoints should be >0 and <=%u. %s",
+ pPipeline->graphicsPipelineCI.pTessellationState->patchControlPoints,
+ dev_data->phys_dev_properties.properties.limits.maxTessellationPatchSize,
+ validation_error_map[VALIDATION_ERROR_01426]);
}
// If a rasterization state is provided...
if (pPipeline->graphicsPipelineCI.pRasterizationState) {
// Make sure that the line width conforms to the HW.
if (!isDynamic(pPipeline, VK_DYNAMIC_STATE_LINE_WIDTH)) {
- skip_call |=
- verifyLineWidth(dev_data, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE,
- kVulkanObjectTypePipeline, reinterpret_cast<uint64_t const &>(pPipeline->pipeline),
- pPipeline->graphicsPipelineCI.pRasterizationState->lineWidth);
+ skip |= verifyLineWidth(dev_data, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, kVulkanObjectTypePipeline,
+ reinterpret_cast<uint64_t const &>(pPipeline->pipeline),
+ pPipeline->graphicsPipelineCI.pRasterizationState->lineWidth);
}
if ((pPipeline->graphicsPipelineCI.pRasterizationState->depthClampEnable == VK_TRUE) &&
(!dev_data->enabled_features.depthClamp)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_01455, "DS",
- "vkCreateGraphicsPipelines(): the depthClamp device feature is disabled: the depthClampEnable "
- "member of the VkPipelineRasterizationStateCreateInfo structure must be set to VK_FALSE. %s",
- validation_error_map[VALIDATION_ERROR_01455]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_01455, "DS",
+ "vkCreateGraphicsPipelines(): the depthClamp device feature is disabled: the depthClampEnable "
+ "member of the VkPipelineRasterizationStateCreateInfo structure must be set to VK_FALSE. %s",
+ validation_error_map[VALIDATION_ERROR_01455]);
}
if (!isDynamic(pPipeline, VK_DYNAMIC_STATE_DEPTH_BIAS) &&
(pPipeline->graphicsPipelineCI.pRasterizationState->depthBiasClamp != 0.0) &&
(!dev_data->enabled_features.depthBiasClamp)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_FEATURE, "DS",
- "vkCreateGraphicsPipelines(): the depthBiasClamp device feature is disabled: the depthBiasClamp "
- "member of the VkPipelineRasterizationStateCreateInfo structure must be set to 0.0 unless the "
- "VK_DYNAMIC_STATE_DEPTH_BIAS dynamic state is enabled");
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_FEATURE, "DS",
+ "vkCreateGraphicsPipelines(): the depthBiasClamp device feature is disabled: the depthBiasClamp "
+ "member of the VkPipelineRasterizationStateCreateInfo structure must be set to 0.0 unless the "
+ "VK_DYNAMIC_STATE_DEPTH_BIAS dynamic state is enabled");
}
// If rasterization is enabled...
@@ -3261,27 +3252,26 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
if ((pPipeline->graphicsPipelineCI.pMultisampleState->alphaToOneEnable == VK_TRUE) &&
(!dev_data->enabled_features.alphaToOne)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_01464, "DS",
- "vkCreateGraphicsPipelines(): the alphaToOne device feature is disabled: the alphaToOneEnable "
- "member of the VkPipelineMultisampleStateCreateInfo structure must be set to VK_FALSE. %s",
- validation_error_map[VALIDATION_ERROR_01464]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_01464, "DS",
+ "vkCreateGraphicsPipelines(): the alphaToOne device feature is disabled: the alphaToOneEnable "
+ "member of the VkPipelineMultisampleStateCreateInfo structure must be set to VK_FALSE. %s",
+ validation_error_map[VALIDATION_ERROR_01464]);
}
// If subpass uses a depth/stencil attachment, pDepthStencilState must be a pointer to a valid structure
if (subpass_desc && subpass_desc->pDepthStencilAttachment &&
subpass_desc->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
if (!pPipeline->graphicsPipelineCI.pDepthStencilState) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02115, "DS",
- "Invalid Pipeline CreateInfo State: pDepthStencilState is NULL when rasterization is "
- "enabled and subpass uses a depth/stencil attachment. %s",
- validation_error_map[VALIDATION_ERROR_02115]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02115, "DS",
+ "Invalid Pipeline CreateInfo State: pDepthStencilState is NULL when rasterization is "
+ "enabled and subpass uses a depth/stencil attachment. %s",
+ validation_error_map[VALIDATION_ERROR_02115]);
} else if ((pPipeline->graphicsPipelineCI.pDepthStencilState->depthBoundsTestEnable == VK_TRUE) &&
(!dev_data->enabled_features.depthBounds)) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_FEATURE, "DS",
"vkCreateGraphicsPipelines(): the depthBounds device feature is disabled: the depthBoundsTestEnable "
@@ -3298,18 +3288,17 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
}
}
if (color_attachment_count > 0 && pPipeline->graphicsPipelineCI.pColorBlendState == nullptr) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02116, "DS",
- "Invalid Pipeline CreateInfo State: pColorBlendState is NULL when rasterization is "
- "enabled and subpass uses color attachments. %s",
- validation_error_map[VALIDATION_ERROR_02116]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02116, "DS",
+ "Invalid Pipeline CreateInfo State: pColorBlendState is NULL when rasterization is "
+ "enabled and subpass uses color attachments. %s",
+ validation_error_map[VALIDATION_ERROR_02116]);
}
}
}
}
- return skip_call;
+ return skip;
}
// Free the Pipeline nodes
@@ -3338,24 +3327,23 @@ DESCRIPTOR_POOL_STATE *GetDescriptorPoolState(const layer_data *dev_data, const
// Return true if validation error occurs and callback returns true (to skip upcoming API call down the chain)
static bool validateIdleDescriptorSet(const layer_data *dev_data, VkDescriptorSet set, std::string func_str) {
if (dev_data->instance_data->disabled.idle_descriptor_set) return false;
- bool skip_call = false;
+ bool skip = false;
auto set_node = dev_data->setMap.find(set);
if (set_node == dev_data->setMap.end()) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
- (uint64_t)(set), __LINE__, DRAWSTATE_DOUBLE_DESTROY, "DS",
- "Cannot call %s() on descriptor set 0x%" PRIxLEAST64 " that has not been allocated.", func_str.c_str(),
- (uint64_t)(set));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
+ (uint64_t)(set), __LINE__, DRAWSTATE_DOUBLE_DESTROY, "DS",
+ "Cannot call %s() on descriptor set 0x%" PRIxLEAST64 " that has not been allocated.", func_str.c_str(),
+ (uint64_t)(set));
} else {
// TODO : This covers various error cases so should pass error enum into this function and use passed in enum here
if (set_node->second->in_use.load()) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
- (uint64_t)(set), __LINE__, VALIDATION_ERROR_00919, "DS",
- "Cannot call %s() on descriptor set 0x%" PRIxLEAST64 " that is in use by a command buffer. %s",
- func_str.c_str(), (uint64_t)(set), validation_error_map[VALIDATION_ERROR_00919]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
+ (uint64_t)(set), __LINE__, VALIDATION_ERROR_00919, "DS",
+ "Cannot call %s() on descriptor set 0x%" PRIxLEAST64 " that is in use by a command buffer. %s",
+ func_str.c_str(), (uint64_t)(set), validation_error_map[VALIDATION_ERROR_00919]);
}
}
- return skip_call;
+ return skip;
}
// Remove set from setMap and delete the set
@@ -3416,18 +3404,18 @@ static void deleteCommandBuffers(layer_data *dev_data) {
// If a renderpass is active, verify that the given command type is appropriate for current subpass state
bool ValidateCmdSubpassState(const layer_data *dev_data, const GLOBAL_CB_NODE *pCB, const CMD_TYPE cmd_type) {
if (!pCB->activeRenderPass) return false;
- bool skip_call = false;
+ bool skip = false;
if (pCB->activeSubpassContents == VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS &&
(cmd_type != CMD_EXECUTECOMMANDS && cmd_type != CMD_NEXTSUBPASS && cmd_type != CMD_ENDRENDERPASS)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_COMMAND_BUFFER, "DS",
- "Commands cannot be called in a subpass using secondary command buffers.");
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_COMMAND_BUFFER, "DS",
+ "Commands cannot be called in a subpass using secondary command buffers.");
} else if (pCB->activeSubpassContents == VK_SUBPASS_CONTENTS_INLINE && cmd_type == CMD_EXECUTECOMMANDS) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_COMMAND_BUFFER, "DS",
- "vkCmdExecuteCommands() cannot be called in a subpass using inline commands.");
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_COMMAND_BUFFER, "DS",
+ "vkCmdExecuteCommands() cannot be called in a subpass using inline commands.");
}
- return skip_call;
+ return skip;
}
bool ValidateCmdQueueFlags(layer_data *dev_data, GLOBAL_CB_NODE *cb_node, const char *caller_name, VkQueueFlags required_flags,
@@ -3851,46 +3839,46 @@ static void checkDeviceRegisterExtensions(const VkDeviceCreateInfo *pCreateInfo,
// Verify that queue family has been properly requested
static bool ValidateRequestedQueueFamilyProperties(instance_layer_data *instance_data, VkPhysicalDevice gpu,
const VkDeviceCreateInfo *create_info) {
- bool skip_call = false;
+ bool skip = false;
auto physical_device_state = GetPhysicalDeviceState(instance_data, gpu);
// First check is app has actually requested queueFamilyProperties
if (!physical_device_state) {
- skip_call |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_MUST_QUERY_COUNT, "DL",
- "Invalid call to vkCreateDevice() w/o first calling vkEnumeratePhysicalDevices().");
+ skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
+ 0, __LINE__, DEVLIMITS_MUST_QUERY_COUNT, "DL",
+ "Invalid call to vkCreateDevice() w/o first calling vkEnumeratePhysicalDevices().");
} else if (QUERY_DETAILS != physical_device_state->vkGetPhysicalDeviceQueueFamilyPropertiesState) {
// TODO: This is not called out as an invalid use in the spec so make more informative recommendation.
- skip_call |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST,
- "DL", "Call to vkCreateDevice() w/o first calling vkGetPhysicalDeviceQueueFamilyProperties().");
+ skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, "DL",
+ "Call to vkCreateDevice() w/o first calling vkGetPhysicalDeviceQueueFamilyProperties().");
} else {
// Check that the requested queue properties are valid
for (uint32_t i = 0; i < create_info->queueCreateInfoCount; i++) {
uint32_t requestedIndex = create_info->pQueueCreateInfos[i].queueFamilyIndex;
if (requestedIndex >= physical_device_state->queue_family_properties.size()) {
- skip_call |= log_msg(
+ skip |= log_msg(
instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0,
__LINE__, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, "DL",
"Invalid queue create request in vkCreateDevice(). Invalid queueFamilyIndex %u requested.", requestedIndex);
} else if (create_info->pQueueCreateInfos[i].queueCount >
physical_device_state->queue_family_properties[requestedIndex].queueCount) {
- skip_call |= log_msg(
- instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0,
- __LINE__, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, "DL",
- "Invalid queue create request in vkCreateDevice(). QueueFamilyIndex %u only has %u queues, but "
- "requested queueCount is %u.",
- requestedIndex, physical_device_state->queue_family_properties[requestedIndex].queueCount,
- create_info->pQueueCreateInfos[i].queueCount);
+ skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__,
+ DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, "DL",
+ "Invalid queue create request in vkCreateDevice(). QueueFamilyIndex %u only has %u queues, but "
+ "requested queueCount is %u.",
+ requestedIndex, physical_device_state->queue_family_properties[requestedIndex].queueCount,
+ create_info->pQueueCreateInfos[i].queueCount);
}
}
}
- return skip_call;
+ return skip;
}
// Verify that features have been queried and that they are available
static bool ValidateRequestedFeatures(instance_layer_data *dev_data, VkPhysicalDevice phys,
const VkPhysicalDeviceFeatures *requested_features) {
- bool skip_call = false;
+ bool skip = false;
auto phys_device_state = GetPhysicalDeviceState(dev_data, phys);
const VkBool32 *actual = reinterpret_cast<VkBool32 *>(&phys_device_state->features);
@@ -3903,38 +3891,37 @@ static bool ValidateRequestedFeatures(instance_layer_data *dev_data, VkPhysicalD
for (uint32_t i = 0; i < total_bools; i++) {
if (requested[i] > actual[i]) {
// TODO: Add index to struct member name helper to be able to include a feature name
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0,
- __LINE__, DEVLIMITS_INVALID_FEATURE_REQUESTED, "DL",
- "While calling vkCreateDevice(), requesting feature #%u in VkPhysicalDeviceFeatures struct, "
- "which is not available on this device.",
- i);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
+ 0, __LINE__, DEVLIMITS_INVALID_FEATURE_REQUESTED, "DL",
+ "While calling vkCreateDevice(), requesting feature #%u in VkPhysicalDeviceFeatures struct, "
+ "which is not available on this device.",
+ i);
errors++;
}
}
if (errors && (UNCALLED == phys_device_state->vkGetPhysicalDeviceFeaturesState)) {
// If user didn't request features, notify them that they should
// TODO: Verify this against the spec. I believe this is an invalid use of the API and should return an error
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
- 0, __LINE__, DEVLIMITS_INVALID_FEATURE_REQUESTED, "DL",
- "You requested features that are unavailable on this device. You should first query feature "
- "availability by calling vkGetPhysicalDeviceFeatures().");
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0,
+ __LINE__, DEVLIMITS_INVALID_FEATURE_REQUESTED, "DL",
+ "You requested features that are unavailable on this device. You should first query feature "
+ "availability by calling vkGetPhysicalDeviceFeatures().");
}
- return skip_call;
+ return skip;
}
VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) {
instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(gpu), instance_layer_data_map);
- bool skip_call = false;
+ bool skip = false;
// Check that any requested features are available
if (pCreateInfo->pEnabledFeatures) {
- skip_call |= ValidateRequestedFeatures(instance_data, gpu, pCreateInfo->pEnabledFeatures);
+ skip |= ValidateRequestedFeatures(instance_data, gpu, pCreateInfo->pEnabledFeatures);
}
- skip_call |= ValidateRequestedQueueFamilyProperties(instance_data, gpu, pCreateInfo);
+ skip |= ValidateRequestedQueueFamilyProperties(instance_data, gpu, pCreateInfo);
- if (skip_call) {
+ if (skip) {
return VK_ERROR_VALIDATION_FAILED_EXT;
}
@@ -4239,15 +4226,15 @@ static void SubmitFence(QUEUE_STATE *pQueue, FENCE_NODE *pFence, uint64_t submit
}
static bool validateCommandBufferSimultaneousUse(layer_data *dev_data, GLOBAL_CB_NODE *pCB, int current_submit_count) {
- bool skip_call = false;
+ bool skip = false;
if ((dev_data->globalInFlightCmdBuffers.count(pCB->commandBuffer) || current_submit_count > 1) &&
!(pCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- 0, __LINE__, VALIDATION_ERROR_00133, "DS",
- "Command Buffer 0x%p is already in use and is not marked for simultaneous use. %s", pCB->commandBuffer,
- validation_error_map[VALIDATION_ERROR_00133]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00133, "DS",
+ "Command Buffer 0x%p is already in use and is not marked for simultaneous use. %s", pCB->commandBuffer,
+ validation_error_map[VALIDATION_ERROR_00133]);
}
- return skip_call;
+ return skip;
}
static bool validateCommandBufferState(layer_data *dev_data, GLOBAL_CB_NODE *cb_state, const char *call_source,
@@ -4278,7 +4265,7 @@ static bool validateCommandBufferState(layer_data *dev_data, GLOBAL_CB_NODE *cb_
}
static bool validateResources(layer_data *dev_data, GLOBAL_CB_NODE *cb_node) {
- bool skip_call = false;
+ bool skip = false;
// TODO : We should be able to remove the NULL look-up checks from the code below as long as
// all the corresponding cases are verified to cause CB_INVALID state and the CB_INVALID state
@@ -4287,13 +4274,13 @@ static bool validateResources(layer_data *dev_data, GLOBAL_CB_NODE *cb_node) {
for (auto buffer : drawDataElement.buffers) {
auto buffer_state = GetBufferState(dev_data, buffer);
if (!buffer_state) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT,
- (uint64_t)(buffer), __LINE__, DRAWSTATE_INVALID_BUFFER, "DS",
- "Cannot submit cmd buffer using deleted buffer 0x%" PRIx64 ".", (uint64_t)(buffer));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT,
+ (uint64_t)(buffer), __LINE__, DRAWSTATE_INVALID_BUFFER, "DS",
+ "Cannot submit cmd buffer using deleted buffer 0x%" PRIx64 ".", (uint64_t)(buffer));
}
}
}
- return skip_call;
+ return skip;
}
// Check that the queue family index of 'queue' matches one of the entries in pQueueFamilyIndices
@@ -4325,19 +4312,18 @@ bool ValidImageBufferQueue(layer_data *dev_data, GLOBAL_CB_NODE *cb_node, const
// Validate that queueFamilyIndices of primary command buffers match this queue
// Secondary command buffers were previously validated in vkCmdExecuteCommands().
static bool validateQueueFamilyIndices(layer_data *dev_data, GLOBAL_CB_NODE *pCB, VkQueue queue) {
- bool skip_call = false;
+ bool skip = false;
auto pPool = GetCommandPoolNode(dev_data, pCB->createInfo.commandPool);
auto queue_state = GetQueueState(dev_data, queue);
if (pPool && queue_state) {
if (pPool->queueFamilyIndex != queue_state->queueFamilyIndex) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, VALIDATION_ERROR_00139, "DS",
- "vkQueueSubmit: Primary command buffer 0x%p created in queue family %d is being submitted on queue "
- "0x%p from queue family %d. %s",
- pCB->commandBuffer, pPool->queueFamilyIndex, queue, queue_state->queueFamilyIndex,
- validation_error_map[VALIDATION_ERROR_00139]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, VALIDATION_ERROR_00139, "DS",
+ "vkQueueSubmit: Primary command buffer 0x%p created in queue family %d is being submitted on queue "
+ "0x%p from queue family %d. %s",
+ pCB->commandBuffer, pPool->queueFamilyIndex, queue, queue_state->queueFamilyIndex,
+ validation_error_map[VALIDATION_ERROR_00139]);
}
// Ensure that any bound images or buffers created with SHARING_MODE_CONCURRENT have access to the current queue family
@@ -4345,37 +4331,36 @@ static bool validateQueueFamilyIndices(layer_data *dev_data, GLOBAL_CB_NODE *pCB
if (object.type == kVulkanObjectTypeImage) {
auto image_state = GetImageState(dev_data, reinterpret_cast<VkImage &>(object.handle));
if (image_state && image_state->createInfo.sharingMode == VK_SHARING_MODE_CONCURRENT) {
- skip_call |= ValidImageBufferQueue(dev_data, pCB, &object, queue, image_state->createInfo.queueFamilyIndexCount,
- image_state->createInfo.pQueueFamilyIndices);
+ skip |= ValidImageBufferQueue(dev_data, pCB, &object, queue, image_state->createInfo.queueFamilyIndexCount,
+ image_state->createInfo.pQueueFamilyIndices);
}
} else if (object.type == kVulkanObjectTypeBuffer) {
auto buffer_state = GetBufferState(dev_data, reinterpret_cast<VkBuffer &>(object.handle));
if (buffer_state && buffer_state->createInfo.sharingMode == VK_SHARING_MODE_CONCURRENT) {
- skip_call |=
- ValidImageBufferQueue(dev_data, pCB, &object, queue, buffer_state->createInfo.queueFamilyIndexCount,
- buffer_state->createInfo.pQueueFamilyIndices);
+ skip |= ValidImageBufferQueue(dev_data, pCB, &object, queue, buffer_state->createInfo.queueFamilyIndexCount,
+ buffer_state->createInfo.pQueueFamilyIndices);
}
}
}
}
- return skip_call;
+ return skip;
}
static bool validatePrimaryCommandBufferState(layer_data *dev_data, GLOBAL_CB_NODE *pCB, int current_submit_count) {
// Track in-use for resources off of primary and any secondary CBs
- bool skip_call = false;
+ bool skip = false;
// If USAGE_SIMULTANEOUS_USE_BIT not set then CB cannot already be executing
// on device
- skip_call |= validateCommandBufferSimultaneousUse(dev_data, pCB, current_submit_count);
+ skip |= validateCommandBufferSimultaneousUse(dev_data, pCB, current_submit_count);
- skip_call |= validateResources(dev_data, pCB);
+ skip |= validateResources(dev_data, pCB);
if (!pCB->secondaryCommandBuffers.empty()) {
for (auto secondaryCmdBuffer : pCB->secondaryCommandBuffers) {
GLOBAL_CB_NODE *pSubCB = GetCBNode(dev_data, secondaryCmdBuffer);
- skip_call |= validateResources(dev_data, pSubCB);
+ skip |= validateResources(dev_data, pSubCB);
if ((pSubCB->primaryCommandBuffer != pCB->commandBuffer) &&
!(pSubCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT)) {
log_msg(
@@ -4389,33 +4374,32 @@ static bool validatePrimaryCommandBufferState(layer_data *dev_data, GLOBAL_CB_NO
}
}
- skip_call |= validateCommandBufferState(dev_data, pCB, "vkQueueSubmit()", current_submit_count);
+ skip |= validateCommandBufferState(dev_data, pCB, "vkQueueSubmit()", current_submit_count);
- return skip_call;
+ return skip;
}
static bool ValidateFenceForSubmit(layer_data *dev_data, FENCE_NODE *pFence) {
- bool skip_call = false;
+ bool skip = false;
if (pFence) {
if (pFence->state == FENCE_INFLIGHT) {
// TODO: opportunities for VALIDATION_ERROR_00127, VALIDATION_ERROR_01647, VALIDATION_ERROR_01953
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT,
- (uint64_t)(pFence->fence), __LINE__, DRAWSTATE_INVALID_FENCE, "DS",
- "Fence 0x%" PRIx64 " is already in use by another submission.", (uint64_t)(pFence->fence));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT,
+ (uint64_t)(pFence->fence), __LINE__, DRAWSTATE_INVALID_FENCE, "DS",
+ "Fence 0x%" PRIx64 " is already in use by another submission.", (uint64_t)(pFence->fence));
}
else if (pFence->state == FENCE_RETIRED) {
// TODO: opportunities for VALIDATION_ERROR_00126, VALIDATION_ERROR_01646, VALIDATION_ERROR_01953
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT,
- reinterpret_cast<uint64_t &>(pFence->fence), __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM",
- "Fence 0x%" PRIxLEAST64 " submitted in SIGNALED state. Fences must be reset before being submitted",
- reinterpret_cast<uint64_t &>(pFence->fence));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT,
+ reinterpret_cast<uint64_t &>(pFence->fence), __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM",
+ "Fence 0x%" PRIxLEAST64 " submitted in SIGNALED state. Fences must be reset before being submitted",
+ reinterpret_cast<uint64_t &>(pFence->fence));
}
}
- return skip_call;
+ return skip;
}
static void PostCallRecordQueueSubmit(layer_data *dev_data, VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits,
@@ -4490,8 +4474,8 @@ static void PostCallRecordQueueSubmit(layer_data *dev_data, VkQueue queue, uint3
static bool PreCallValidateQueueSubmit(layer_data *dev_data, VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits,
VkFence fence) {
auto pFence = GetFenceNode(dev_data, fence);
- bool skip_call = ValidateFenceForSubmit(dev_data, pFence);
- if (skip_call) {
+ bool skip = ValidateFenceForSubmit(dev_data, pFence);
+ if (skip) {
return true;
}
@@ -4503,18 +4487,17 @@ static bool PreCallValidateQueueSubmit(layer_data *dev_data, VkQueue queue, uint
for (uint32_t submit_idx = 0; submit_idx < submitCount; submit_idx++) {
const VkSubmitInfo *submit = &pSubmits[submit_idx];
for (uint32_t i = 0; i < submit->waitSemaphoreCount; ++i) {
- skip_call |= ValidateStageMaskGsTsEnables(dev_data, submit->pWaitDstStageMask[i], "vkQueueSubmit()",
- VALIDATION_ERROR_00142, VALIDATION_ERROR_00143);
+ skip |= ValidateStageMaskGsTsEnables(dev_data, submit->pWaitDstStageMask[i], "vkQueueSubmit()", VALIDATION_ERROR_00142,
+ VALIDATION_ERROR_00143);
VkSemaphore semaphore = submit->pWaitSemaphores[i];
auto pSemaphore = GetSemaphoreNode(dev_data, semaphore);
if (pSemaphore) {
if (unsignaled_semaphores.count(semaphore) ||
(!(signaled_semaphores.count(semaphore)) && !(pSemaphore->signaled))) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
- reinterpret_cast<const uint64_t &>(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
- "Queue 0x%p is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.", queue,
- reinterpret_cast<const uint64_t &>(semaphore));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
+ reinterpret_cast<const uint64_t &>(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
+ "Queue 0x%p is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.", queue,
+ reinterpret_cast<const uint64_t &>(semaphore));
} else {
signaled_semaphores.erase(semaphore);
unsignaled_semaphores.insert(semaphore);
@@ -4526,13 +4509,12 @@ static bool PreCallValidateQueueSubmit(layer_data *dev_data, VkQueue queue, uint
auto pSemaphore = GetSemaphoreNode(dev_data, semaphore);
if (pSemaphore) {
if (signaled_semaphores.count(semaphore) || (!(unsignaled_semaphores.count(semaphore)) && pSemaphore->signaled)) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
- reinterpret_cast<const uint64_t &>(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
- "Queue 0x%p is signaling semaphore 0x%" PRIx64
- " that has already been signaled but not waited on by queue 0x%" PRIx64 ".",
- queue, reinterpret_cast<const uint64_t &>(semaphore),
- reinterpret_cast<uint64_t &>(pSemaphore->signaler.first));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
+ reinterpret_cast<const uint64_t &>(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
+ "Queue 0x%p is signaling semaphore 0x%" PRIx64
+ " that has already been signaled but not waited on by queue 0x%" PRIx64 ".",
+ queue, reinterpret_cast<const uint64_t &>(semaphore),
+ reinterpret_cast<uint64_t &>(pSemaphore->signaler.first));
} else {
unsignaled_semaphores.erase(semaphore);
signaled_semaphores.insert(semaphore);
@@ -4542,31 +4524,31 @@ static bool PreCallValidateQueueSubmit(layer_data *dev_data, VkQueue queue, uint
for (uint32_t i = 0; i < submit->commandBufferCount; i++) {
auto cb_node = GetCBNode(dev_data, submit->pCommandBuffers[i]);
if (cb_node) {
- skip_call |= ValidateCmdBufImageLayouts(dev_data, cb_node, localImageLayoutMap);
+ skip |= ValidateCmdBufImageLayouts(dev_data, cb_node, localImageLayoutMap);
current_cmds.push_back(submit->pCommandBuffers[i]);
- skip_call |= validatePrimaryCommandBufferState(
+ skip |= validatePrimaryCommandBufferState(
dev_data, cb_node, (int)std::count(current_cmds.begin(), current_cmds.end(), submit->pCommandBuffers[i]));
- skip_call |= validateQueueFamilyIndices(dev_data, cb_node, queue);
+ skip |= validateQueueFamilyIndices(dev_data, cb_node, queue);
// Potential early exit here as bad object state may crash in delayed function calls
- if (skip_call) {
+ if (skip) {
return true;
}
// Call submit-time functions to validate/update state
for (auto &function : cb_node->validate_functions) {
- skip_call |= function();
+ skip |= function();
}
for (auto &function : cb_node->eventUpdates) {
- skip_call |= function(queue);
+ skip |= function(queue);
}
for (auto &function : cb_node->queryUpdates) {
- skip_call |= function(queue);
+ skip |= function(queue);
}
}
}
}
- return skip_call;
+ return skip;
}
VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence) {
@@ -4695,12 +4677,12 @@ VKAPI_ATTR void VKAPI_CALL FreeMemory(VkDevice device, VkDeviceMemory mem, const
// 1. Not zero
// 2. Within the size of the memory allocation
static bool ValidateMapMemRange(layer_data *dev_data, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size) {
- bool skip_call = false;
+ bool skip = false;
if (size == 0) {
- skip_call = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
- (uint64_t)mem, __LINE__, MEMTRACK_INVALID_MAP, "MEM",
- "VkMapMemory: Attempting to map memory range of size zero");
+ skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
+ (uint64_t)mem, __LINE__, MEMTRACK_INVALID_MAP, "MEM",
+ "VkMapMemory: Attempting to map memory range of size zero");
}
auto mem_element = dev_data->memObjMap.find(mem);
@@ -4708,32 +4690,31 @@ static bool ValidateMapMemRange(layer_data *dev_data, VkDeviceMemory mem, VkDevi
auto mem_info = mem_element->second.get();
// It is an application error to call VkMapMemory on an object that is already mapped
if (mem_info->mem_range.size != 0) {
- skip_call = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
- (uint64_t)mem, __LINE__, MEMTRACK_INVALID_MAP, "MEM",
- "VkMapMemory: Attempting to map memory on an already-mapped object 0x%" PRIxLEAST64, (uint64_t)mem);
+ skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
+ (uint64_t)mem, __LINE__, MEMTRACK_INVALID_MAP, "MEM",
+ "VkMapMemory: Attempting to map memory on an already-mapped object 0x%" PRIxLEAST64, (uint64_t)mem);
}
// Validate that offset + size is within object's allocationSize
if (size == VK_WHOLE_SIZE) {
if (offset >= mem_info->alloc_info.allocationSize) {
- skip_call =
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
- (uint64_t)mem, __LINE__, MEMTRACK_INVALID_MAP, "MEM",
- "Mapping Memory from 0x%" PRIx64 " to 0x%" PRIx64
- " with size of VK_WHOLE_SIZE oversteps total array size 0x%" PRIx64,
- offset, mem_info->alloc_info.allocationSize, mem_info->alloc_info.allocationSize);
+ skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
+ (uint64_t)mem, __LINE__, MEMTRACK_INVALID_MAP, "MEM",
+ "Mapping Memory from 0x%" PRIx64 " to 0x%" PRIx64
+ " with size of VK_WHOLE_SIZE oversteps total array size 0x%" PRIx64,
+ offset, mem_info->alloc_info.allocationSize, mem_info->alloc_info.allocationSize);
}
} else {
if ((offset + size) > mem_info->alloc_info.allocationSize) {
- skip_call = log_msg(
- dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
- (uint64_t)mem, __LINE__, VALIDATION_ERROR_00628, "MEM",
- "Mapping Memory from 0x%" PRIx64 " to 0x%" PRIx64 " oversteps total array size 0x%" PRIx64 ". %s", offset,
- size + offset, mem_info->alloc_info.allocationSize, validation_error_map[VALIDATION_ERROR_00628]);
+ skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
+ (uint64_t)mem, __LINE__, VALIDATION_ERROR_00628, "MEM",
+ "Mapping Memory from 0x%" PRIx64 " to 0x%" PRIx64 " oversteps total array size 0x%" PRIx64 ". %s",
+ offset, size + offset, mem_info->alloc_info.allocationSize,
+ validation_error_map[VALIDATION_ERROR_00628]);
}
}
}
- return skip_call;
+ return skip;
}
static void storeMemRanges(layer_data *dev_data, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size) {
@@ -4745,15 +4726,15 @@ static void storeMemRanges(layer_data *dev_data, VkDeviceMemory mem, VkDeviceSiz
}
static bool deleteMemRanges(layer_data *dev_data, VkDeviceMemory mem) {
- bool skip_call = false;
+ bool skip = false;
auto mem_info = GetMemObjInfo(dev_data, mem);
if (mem_info) {
if (!mem_info->mem_range.size) {
// Valid Usage: memory must currently be mapped
- skip_call = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
- (uint64_t)mem, __LINE__, VALIDATION_ERROR_00649, "MEM",
- "Unmapping Memory without memory being mapped: mem obj 0x%" PRIxLEAST64 ". %s", (uint64_t)mem,
- validation_error_map[VALIDATION_ERROR_00649]);
+ skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
+ (uint64_t)mem, __LINE__, VALIDATION_ERROR_00649, "MEM",
+ "Unmapping Memory without memory being mapped: mem obj 0x%" PRIxLEAST64 ". %s", (uint64_t)mem,
+ validation_error_map[VALIDATION_ERROR_00649]);
}
mem_info->mem_range.size = 0;
if (mem_info->shadow_copy) {
@@ -4762,7 +4743,7 @@ static bool deleteMemRanges(layer_data *dev_data, VkDeviceMemory mem) {
mem_info->shadow_copy = 0;
}
}
- return skip_call;
+ return skip;
}
// Guard value for pad data
@@ -4809,20 +4790,20 @@ static void initializeAndTrackMemory(layer_data *dev_data, VkDeviceMemory mem, V
// a fence being waited on should not already be signaled and
// it should have been submitted on a queue or during acquire next image
static inline bool verifyWaitFenceState(layer_data *dev_data, VkFence fence, const char *apiCall) {
- bool skip_call = false;
+ bool skip = false;
auto pFence = GetFenceNode(dev_data, fence);
if (pFence) {
if (pFence->state == FENCE_UNSIGNALED) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT,
- reinterpret_cast<uint64_t &>(fence), __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM",
- "%s called for fence 0x%" PRIxLEAST64
- " which has not been submitted on a Queue or during "
- "acquire next image.",
- apiCall, reinterpret_cast<uint64_t &>(fence));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT,
+ reinterpret_cast<uint64_t &>(fence), __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM",
+ "%s called for fence 0x%" PRIxLEAST64
+ " which has not been submitted on a Queue or during "
+ "acquire next image.",
+ apiCall, reinterpret_cast<uint64_t &>(fence));
}
}
- return skip_call;
+ return skip;
}
static void RetireFence(layer_data *dev_data, VkFence fence) {
@@ -5210,12 +5191,12 @@ VKAPI_ATTR VkResult VKAPI_CALL GetQueryPoolResults(VkDevice device, VkQueryPool
// Prereq : For both ranges, range->end - range->start > 0. This case should have already resulted
// in an error so not checking that here
// pad_ranges bool indicates a linear and non-linear comparison which requires padding
-// In the case where padding is required, if an alias is encountered then a validation error is reported and skip_call
-// may be set by the callback function so caller should merge in skip_call value if padding case is possible.
+// In the case where padding is required, if an alias is encountered then a validation error is reported and skip
+// may be set by the callback function so caller should merge in skip value if padding case is possible.
// This check can be skipped by passing skip_checks=true, for call sites outside the validation path.
-static bool rangesIntersect(layer_data const *dev_data, MEMORY_RANGE const *range1, MEMORY_RANGE const *range2, bool *skip_call,
+static bool rangesIntersect(layer_data const *dev_data, MEMORY_RANGE const *range1, MEMORY_RANGE const *range2, bool *skip,
bool skip_checks) {
- *skip_call = false;
+ *skip = false;
auto r1_start = range1->start;
auto r1_end = range1->end;
auto r2_start = range2->start;
@@ -5234,13 +5215,13 @@ static bool rangesIntersect(layer_data const *dev_data, MEMORY_RANGE const *rang
const char *r2_linear_str = range2->linear ? "linear" : "non-linear";
const char *r2_type_str = range2->image ? "image" : "buffer";
auto obj_type = range1->image ? VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT : VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT;
- *skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, obj_type, range1->handle, 0,
- MEMTRACK_INVALID_ALIASING, "MEM", "%s %s 0x%" PRIx64 " is aliased with %s %s 0x%" PRIx64
- " which may indicate a bug. For further info refer to the "
- "Buffer-Image Granularity section of the Vulkan specification. "
- "(https://www.khronos.org/registry/vulkan/specs/1.0-extensions/"
- "xhtml/vkspec.html#resources-bufferimagegranularity)",
- r1_linear_str, r1_type_str, range1->handle, r2_linear_str, r2_type_str, range2->handle);
+ *skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, obj_type, range1->handle, 0,
+ MEMTRACK_INVALID_ALIASING, "MEM", "%s %s 0x%" PRIx64 " is aliased with %s %s 0x%" PRIx64
+ " which may indicate a bug. For further info refer to the "
+ "Buffer-Image Granularity section of the Vulkan specification. "
+ "(https://www.khronos.org/registry/vulkan/specs/1.0-extensions/"
+ "xhtml/vkspec.html#resources-bufferimagegranularity)",
+ r1_linear_str, r1_type_str, range1->handle, r2_linear_str, r2_type_str, range2->handle);
}
// Ranges intersect
return true;
@@ -5448,17 +5429,16 @@ VKAPI_ATTR void VKAPI_CALL DestroyImage(VkDevice device, VkImage image, const Vk
static bool ValidateMemoryTypes(const layer_data *dev_data, const DEVICE_MEM_INFO *mem_info, const uint32_t memory_type_bits,
const char *funcName, UNIQUE_VALIDATION_ERROR_CODE msgCode) {
- bool skip_call = false;
+ bool skip = false;
if (((1 << mem_info->alloc_info.memoryTypeIndex) & memory_type_bits) == 0) {
- skip_call =
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
- reinterpret_cast<const uint64_t &>(mem_info->mem), __LINE__, msgCode, "MT",
- "%s(): MemoryRequirements->memoryTypeBits (0x%X) for this object type are not compatible with the memory "
- "type (0x%X) of this memory object 0x%" PRIx64 ". %s",
- funcName, memory_type_bits, mem_info->alloc_info.memoryTypeIndex,
- reinterpret_cast<const uint64_t &>(mem_info->mem), validation_error_map[msgCode]);
+ skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
+ reinterpret_cast<const uint64_t &>(mem_info->mem), __LINE__, msgCode, "MT",
+ "%s(): MemoryRequirements->memoryTypeBits (0x%X) for this object type are not compatible with the memory "
+ "type (0x%X) of this memory object 0x%" PRIx64 ". %s",
+ funcName, memory_type_bits, mem_info->alloc_info.memoryTypeIndex,
+ reinterpret_cast<const uint64_t &>(mem_info->mem), validation_error_map[msgCode]);
}
- return skip_call;
+ return skip;
}
static bool PreCallValidateBindBufferMemory(layer_data *dev_data, VkBuffer buffer, BUFFER_STATE *buffer_state, VkDeviceMemory mem,
@@ -5767,37 +5747,36 @@ VKAPI_ATTR void VKAPI_CALL DestroyDescriptorPool(VkDevice device, VkDescriptorPo
}
}
}
-// Verify cmdBuffer in given cb_node is not in global in-flight set, and return skip_call result
+// Verify cmdBuffer in given cb_node is not in global in-flight set, and return skip result
// If this is a secondary command buffer, then make sure its primary is also in-flight
// If primary is not in-flight, then remove secondary from global in-flight set
// This function is only valid at a point when cmdBuffer is being reset or freed
static bool checkCommandBufferInFlight(layer_data *dev_data, const GLOBAL_CB_NODE *cb_node, const char *action,
UNIQUE_VALIDATION_ERROR_CODE error_code) {
- bool skip_call = false;
+ bool skip = false;
if (dev_data->globalInFlightCmdBuffers.count(cb_node->commandBuffer)) {
// Primary CB or secondary where primary is also in-flight is an error
if ((cb_node->createInfo.level != VK_COMMAND_BUFFER_LEVEL_SECONDARY) ||
(dev_data->globalInFlightCmdBuffers.count(cb_node->primaryCommandBuffer))) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<const uint64_t &>(cb_node->commandBuffer), __LINE__, error_code, "DS",
- "Attempt to %s command buffer (0x%p) which is in use. %s", action, cb_node->commandBuffer,
- validation_error_map[error_code]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<const uint64_t &>(cb_node->commandBuffer), __LINE__, error_code, "DS",
+ "Attempt to %s command buffer (0x%p) which is in use. %s", action, cb_node->commandBuffer,
+ validation_error_map[error_code]);
}
}
- return skip_call;
+ return skip;
}
// Iterate over all cmdBuffers in given commandPool and verify that each is not in use
static bool checkCommandBuffersInFlight(layer_data *dev_data, COMMAND_POOL_NODE *pPool, const char *action,
UNIQUE_VALIDATION_ERROR_CODE error_code) {
- bool skip_call = false;
+ bool skip = false;
for (auto cmd_buffer : pPool->commandBuffers) {
if (dev_data->globalInFlightCmdBuffers.count(cmd_buffer)) {
- skip_call |= checkCommandBufferInFlight(dev_data, GetCBNode(dev_data, cmd_buffer), action, error_code);
+ skip |= checkCommandBufferInFlight(dev_data, GetCBNode(dev_data, cmd_buffer), action, error_code);
}
}
- return skip_call;
+ return skip;
}
static void clearCommandBuffersInFlight(layer_data *dev_data, COMMAND_POOL_NODE *pPool) {
@@ -5809,18 +5788,18 @@ static void clearCommandBuffersInFlight(layer_data *dev_data, COMMAND_POOL_NODE
VKAPI_ATTR void VKAPI_CALL FreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount,
const VkCommandBuffer *pCommandBuffers) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
- bool skip_call = false;
+ bool skip = false;
std::unique_lock<std::mutex> lock(global_lock);
for (uint32_t i = 0; i < commandBufferCount; i++) {
auto cb_node = GetCBNode(dev_data, pCommandBuffers[i]);
// Delete CB information structure, and remove from commandBufferMap
if (cb_node) {
- skip_call |= checkCommandBufferInFlight(dev_data, cb_node, "free", VALIDATION_ERROR_00096);
+ skip |= checkCommandBufferInFlight(dev_data, cb_node, "free", VALIDATION_ERROR_00096);
}
}
- if (skip_call) return;
+ if (skip) return;
auto pPool = GetCommandPoolNode(dev_data, commandPool);
for (uint32_t i = 0; i < commandBufferCount; i++) {
@@ -5932,14 +5911,14 @@ VKAPI_ATTR void VKAPI_CALL DestroyCommandPool(VkDevice device, VkCommandPool com
VKAPI_ATTR VkResult VKAPI_CALL ResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
- bool skip_call = false;
+ bool skip = false;
std::unique_lock<std::mutex> lock(global_lock);
auto pPool = GetCommandPoolNode(dev_data, commandPool);
- skip_call |= checkCommandBuffersInFlight(dev_data, pPool, "reset command pool with", VALIDATION_ERROR_00072);
+ skip |= checkCommandBuffersInFlight(dev_data, pPool, "reset command pool with", VALIDATION_ERROR_00072);
lock.unlock();
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
VkResult result = dev_data->dispatch_table.ResetCommandPool(device, commandPool, flags);
@@ -5957,20 +5936,20 @@ VKAPI_ATTR VkResult VKAPI_CALL ResetCommandPool(VkDevice device, VkCommandPool c
VKAPI_ATTR VkResult VKAPI_CALL ResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
- bool skip_call = false;
+ bool skip = false;
std::unique_lock<std::mutex> lock(global_lock);
for (uint32_t i = 0; i < fenceCount; ++i) {
auto pFence = GetFenceNode(dev_data, pFences[i]);
if (pFence && pFence->state == FENCE_INFLIGHT) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT,
- reinterpret_cast<const uint64_t &>(pFences[i]), __LINE__, VALIDATION_ERROR_00183, "DS",
- "Fence 0x%" PRIx64 " is in use. %s", reinterpret_cast<const uint64_t &>(pFences[i]),
- validation_error_map[VALIDATION_ERROR_00183]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT,
+ reinterpret_cast<const uint64_t &>(pFences[i]), __LINE__, VALIDATION_ERROR_00183, "DS",
+ "Fence 0x%" PRIx64 " is in use. %s", reinterpret_cast<const uint64_t &>(pFences[i]),
+ validation_error_map[VALIDATION_ERROR_00183]);
}
}
lock.unlock();
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
VkResult result = dev_data->dispatch_table.ResetFences(device, fenceCount, pFences);
@@ -6091,9 +6070,9 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateBufferView(VkDevice device, const VkBufferV
const VkAllocationCallbacks *pAllocator, VkBufferView *pView) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
- bool skip_call = PreCallValidateCreateBufferView(dev_data, pCreateInfo);
+ bool skip = PreCallValidateCreateBufferView(dev_data, pCreateInfo);
lock.unlock();
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
VkResult result = dev_data->dispatch_table.CreateBufferView(device, pCreateInfo, pAllocator, pView);
if (VK_SUCCESS == result) {
lock.lock();
@@ -6461,22 +6440,21 @@ static bool validatePushConstantRange(const layer_data *dev_data, const uint32_t
const char *caller_name, uint32_t index = 0) {
if (dev_data->instance_data->disabled.push_constant_range) return false;
uint32_t const maxPushConstantsSize = dev_data->phys_dev_properties.properties.limits.maxPushConstantsSize;
- bool skip_call = false;
+ bool skip = false;
// Check that offset + size don't exceed the max.
// Prevent arithetic overflow here by avoiding addition and testing in this order.
if ((offset >= maxPushConstantsSize) || (size > maxPushConstantsSize - offset)) {
// This is a pain just to adapt the log message to the caller, but better to sort it out only when there is a problem.
if (0 == strcmp(caller_name, "vkCreatePipelineLayout()")) {
if (offset >= maxPushConstantsSize) {
- 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_00877, "DS",
- "%s call has push constants index %u with offset %u that "
- "exceeds this device's maxPushConstantSize of %u. %s",
- caller_name, index, offset, maxPushConstantsSize, validation_error_map[VALIDATION_ERROR_00877]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00877, "DS",
+ "%s call has push constants index %u with offset %u that "
+ "exceeds this device's maxPushConstantSize of %u. %s",
+ caller_name, index, offset, maxPushConstantsSize, validation_error_map[VALIDATION_ERROR_00877]);
}
if (size > maxPushConstantsSize - offset) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
__LINE__, VALIDATION_ERROR_00880, "DS",
"%s call has push constants index %u with offset %u and size %u that "
@@ -6485,15 +6463,14 @@ static bool validatePushConstantRange(const layer_data *dev_data, const uint32_t
}
} else if (0 == strcmp(caller_name, "vkCmdPushConstants()")) {
if (offset >= maxPushConstantsSize) {
- 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_00991, "DS",
- "%s call has push constants index %u with offset %u that "
- "exceeds this device's maxPushConstantSize of %u. %s",
- caller_name, index, offset, maxPushConstantsSize, validation_error_map[VALIDATION_ERROR_00991]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00991, "DS",
+ "%s call has push constants index %u with offset %u that "
+ "exceeds this device's maxPushConstantSize of %u. %s",
+ caller_name, index, offset, maxPushConstantsSize, validation_error_map[VALIDATION_ERROR_00991]);
}
if (size > maxPushConstantsSize - offset) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
__LINE__, VALIDATION_ERROR_00992, "DS",
"%s call has push constants index %u with offset %u and size %u that "
@@ -6501,95 +6478,95 @@ static bool validatePushConstantRange(const layer_data *dev_data, const uint32_t
caller_name, index, offset, size, maxPushConstantsSize, validation_error_map[VALIDATION_ERROR_00992]);
}
} else {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
- __LINE__, DRAWSTATE_INTERNAL_ERROR, "DS", "%s caller not supported.", caller_name);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, DRAWSTATE_INTERNAL_ERROR, "DS", "%s caller not supported.", caller_name);
}
}
// size needs to be non-zero and a multiple of 4.
if ((size == 0) || ((size & 0x3) != 0)) {
if (0 == strcmp(caller_name, "vkCreatePipelineLayout()")) {
if (size == 0) {
- 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_00878, "DS",
- "%s call has push constants index %u with "
- "size %u. Size must be greater than zero. %s",
- caller_name, index, size, validation_error_map[VALIDATION_ERROR_00878]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00878, "DS",
+ "%s call has push constants index %u with "
+ "size %u. Size must be greater than zero. %s",
+ caller_name, index, size, validation_error_map[VALIDATION_ERROR_00878]);
}
if (size & 0x3) {
- 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_00879, "DS",
- "%s call has push constants index %u with "
- "size %u. Size must be a multiple of 4. %s",
- caller_name, index, size, validation_error_map[VALIDATION_ERROR_00879]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00879, "DS",
+ "%s call has push constants index %u with "
+ "size %u. Size must be a multiple of 4. %s",
+ caller_name, index, size, validation_error_map[VALIDATION_ERROR_00879]);
}
} else if (0 == strcmp(caller_name, "vkCmdPushConstants()")) {
if (size == 0) {
- 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_01000, "DS",
- "%s call has push constants index %u with "
- "size %u. Size must be greater than zero. %s",
- caller_name, index, size, validation_error_map[VALIDATION_ERROR_01000]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_01000, "DS",
+ "%s call has push constants index %u with "
+ "size %u. Size must be greater than zero. %s",
+ caller_name, index, size, validation_error_map[VALIDATION_ERROR_01000]);
}
if (size & 0x3) {
- 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_00990, "DS",
- "%s call has push constants index %u with "
- "size %u. Size must be a multiple of 4. %s",
- caller_name, index, size, validation_error_map[VALIDATION_ERROR_00990]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00990, "DS",
+ "%s call has push constants index %u with "
+ "size %u. Size must be a multiple of 4. %s",
+ caller_name, index, size, validation_error_map[VALIDATION_ERROR_00990]);
}
} else {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
- __LINE__, DRAWSTATE_INTERNAL_ERROR, "DS", "%s caller not supported.", caller_name);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, DRAWSTATE_INTERNAL_ERROR, "DS", "%s caller not supported.", caller_name);
}
}
// offset needs to be a multiple of 4.
if ((offset & 0x3) != 0) {
if (0 == strcmp(caller_name, "vkCreatePipelineLayout()")) {
- 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_02521, "DS",
- "%s call has push constants index %u with "
- "offset %u. Offset must be a multiple of 4. %s",
- caller_name, index, offset, validation_error_map[VALIDATION_ERROR_02521]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_02521, "DS",
+ "%s call has push constants index %u with "
+ "offset %u. Offset must be a multiple of 4. %s",
+ caller_name, index, offset, validation_error_map[VALIDATION_ERROR_02521]);
} else if (0 == strcmp(caller_name, "vkCmdPushConstants()")) {
- 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_00989, "DS",
- "%s call has push constants with "
- "offset %u. Offset must be a multiple of 4. %s",
- caller_name, offset, validation_error_map[VALIDATION_ERROR_00989]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00989, "DS",
+ "%s call has push constants with "
+ "offset %u. Offset must be a multiple of 4. %s",
+ caller_name, offset, validation_error_map[VALIDATION_ERROR_00989]);
} else {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
- __LINE__, DRAWSTATE_INTERNAL_ERROR, "DS", "%s caller not supported.", caller_name);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, DRAWSTATE_INTERNAL_ERROR, "DS", "%s caller not supported.", caller_name);
}
}
- return skip_call;
+ return skip;
}
VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
// TODO : Add checks for VALIDATION_ERRORS 865-870
// Push Constant Range checks
uint32_t i, j;
for (i = 0; i < pCreateInfo->pushConstantRangeCount; ++i) {
- skip_call |= validatePushConstantRange(dev_data, pCreateInfo->pPushConstantRanges[i].offset,
- pCreateInfo->pPushConstantRanges[i].size, "vkCreatePipelineLayout()", i);
+ skip |= validatePushConstantRange(dev_data, pCreateInfo->pPushConstantRanges[i].offset,
+ pCreateInfo->pPushConstantRanges[i].size, "vkCreatePipelineLayout()", i);
if (0 == pCreateInfo->pPushConstantRanges[i].stageFlags) {
- 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_00882, "DS", "vkCreatePipelineLayout() call has no stageFlags set. %s",
- validation_error_map[VALIDATION_ERROR_00882]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00882, "DS", "vkCreatePipelineLayout() call has no stageFlags set. %s",
+ validation_error_map[VALIDATION_ERROR_00882]);
}
}
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
// As of 1.0.28, there is a VU that states that a stage flag cannot appear more than once in the list of push constant ranges.
for (i = 0; i < pCreateInfo->pushConstantRangeCount; ++i) {
for (j = i + 1; j < pCreateInfo->pushConstantRangeCount; ++j) {
if (0 != (pCreateInfo->pPushConstantRanges[i].stageFlags & pCreateInfo->pPushConstantRanges[j].stageFlags)) {
- 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_00871, "DS",
- "vkCreatePipelineLayout() Duplicate stage flags found in ranges %d and %d. %s", i, j,
- validation_error_map[VALIDATION_ERROR_00871]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00871, "DS",
+ "vkCreatePipelineLayout() Duplicate stage flags found in ranges %d and %d. %s", i, j,
+ validation_error_map[VALIDATION_ERROR_00871]);
}
}
}
@@ -6668,10 +6645,10 @@ VKAPI_ATTR VkResult VKAPI_CALL AllocateDescriptorSets(VkDevice device, const VkD
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
cvdescriptorset::AllocateDescriptorSetsData common_data(pAllocateInfo->descriptorSetCount);
- bool skip_call = PreCallValidateAllocateDescriptorSets(dev_data, pAllocateInfo, &common_data);
+ bool skip = PreCallValidateAllocateDescriptorSets(dev_data, pAllocateInfo, &common_data);
lock.unlock();
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
VkResult result = dev_data->dispatch_table.AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
@@ -6686,24 +6663,24 @@ VKAPI_ATTR VkResult VKAPI_CALL AllocateDescriptorSets(VkDevice device, const VkD
static bool PreCallValidateFreeDescriptorSets(const layer_data *dev_data, VkDescriptorPool pool, uint32_t count,
const VkDescriptorSet *descriptor_sets) {
if (dev_data->instance_data->disabled.free_descriptor_sets) return false;
- bool skip_call = false;
+ bool skip = false;
// First make sure sets being destroyed are not currently in-use
for (uint32_t i = 0; i < count; ++i) {
if (descriptor_sets[i] != VK_NULL_HANDLE) {
- skip_call |= validateIdleDescriptorSet(dev_data, descriptor_sets[i], "vkFreeDescriptorSets");
+ skip |= validateIdleDescriptorSet(dev_data, descriptor_sets[i], "vkFreeDescriptorSets");
}
}
DESCRIPTOR_POOL_STATE *pool_state = GetDescriptorPoolState(dev_data, pool);
if (pool_state && !(VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT & pool_state->createInfo.flags)) {
// Can't Free from a NON_FREE pool
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT,
- reinterpret_cast<uint64_t &>(pool), __LINE__, VALIDATION_ERROR_00922, "DS",
- "It is invalid to call vkFreeDescriptorSets() with a pool created without setting "
- "VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT. %s",
- validation_error_map[VALIDATION_ERROR_00922]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT,
+ reinterpret_cast<uint64_t &>(pool), __LINE__, VALIDATION_ERROR_00922, "DS",
+ "It is invalid to call vkFreeDescriptorSets() with a pool created without setting "
+ "VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT. %s",
+ validation_error_map[VALIDATION_ERROR_00922]);
}
- return skip_call;
+ return skip;
}
// Sets have been removed from the pool so update underlying state
static void PostCallRecordFreeDescriptorSets(layer_data *dev_data, VkDescriptorPool pool, uint32_t count,
@@ -6733,10 +6710,10 @@ VKAPI_ATTR VkResult VKAPI_CALL FreeDescriptorSets(VkDevice device, VkDescriptorP
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
// Make sure that no sets being destroyed are in-flight
std::unique_lock<std::mutex> lock(global_lock);
- bool skip_call = PreCallValidateFreeDescriptorSets(dev_data, descriptorPool, count, pDescriptorSets);
+ bool skip = PreCallValidateFreeDescriptorSets(dev_data, descriptorPool, count, pDescriptorSets);
lock.unlock();
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
VkResult result = dev_data->dispatch_table.FreeDescriptorSets(device, descriptorPool, count, pDescriptorSets);
if (VK_SUCCESS == result) {
lock.lock();
@@ -6777,10 +6754,10 @@ VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSets(VkDevice device, uint32_t descri
// Only map look-up at top level is for device-level layer_data
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
- bool skip_call = PreCallValidateUpdateDescriptorSets(dev_data, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount,
- pDescriptorCopies);
+ bool skip = PreCallValidateUpdateDescriptorSets(dev_data, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount,
+ pDescriptorCopies);
lock.unlock();
- if (!skip_call) {
+ if (!skip) {
dev_data->dispatch_table.UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount,
pDescriptorCopies);
lock.lock();
@@ -6835,7 +6812,7 @@ static void AddFramebufferBinding(layer_data *dev_data, GLOBAL_CB_NODE *cb_state
}
VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
// Validate command buffer level
@@ -6843,19 +6820,18 @@ VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(VkCommandBuffer commandBuffer,
if (cb_node) {
// This implicitly resets the Cmd Buffer so make sure any fence is done and then clear memory references
if (dev_data->globalInFlightCmdBuffers.count(commandBuffer)) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- (uint64_t)commandBuffer, __LINE__, VALIDATION_ERROR_00103, "MEM",
- "Calling vkBeginCommandBuffer() on active command buffer 0x%p before it has completed. "
- "You must check command buffer fence before this call. %s",
- commandBuffer, validation_error_map[VALIDATION_ERROR_00103]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ (uint64_t)commandBuffer, __LINE__, VALIDATION_ERROR_00103, "MEM",
+ "Calling vkBeginCommandBuffer() on active command buffer 0x%p before it has completed. "
+ "You must check command buffer fence before this call. %s",
+ commandBuffer, validation_error_map[VALIDATION_ERROR_00103]);
}
clear_cmd_buf_and_mem_references(dev_data, cb_node);
if (cb_node->createInfo.level != VK_COMMAND_BUFFER_LEVEL_PRIMARY) {
// Secondary Command Buffer
const VkCommandBufferInheritanceInfo *pInfo = pBeginInfo->pInheritanceInfo;
if (!pInfo) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00106, "DS",
"vkBeginCommandBuffer(): Secondary Command Buffer (0x%p) must have inheritance info. %s", commandBuffer,
@@ -6873,17 +6849,17 @@ VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(VkCommandBuffer commandBuffer,
GetRenderPassState(dev_data, pInfo->renderPass)->createInfo.ptr(),
errorString)) {
// renderPass that framebuffer was created with must be compatible with local renderPass
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00112, "DS",
- "vkBeginCommandBuffer(): Secondary Command "
- "Buffer (0x%p) renderPass (0x%" PRIxLEAST64
- ") is incompatible w/ framebuffer "
- "(0x%" PRIxLEAST64 ") w/ render pass (0x%" PRIxLEAST64 ") due to: %s. %s",
- commandBuffer, reinterpret_cast<const uint64_t &>(pInfo->renderPass),
- reinterpret_cast<const uint64_t &>(pInfo->framebuffer),
- reinterpret_cast<uint64_t &>(framebuffer->createInfo.renderPass),
- errorString.c_str(), validation_error_map[VALIDATION_ERROR_00112]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00112, "DS",
+ "vkBeginCommandBuffer(): Secondary Command "
+ "Buffer (0x%p) renderPass (0x%" PRIxLEAST64
+ ") is incompatible w/ framebuffer "
+ "(0x%" PRIxLEAST64 ") w/ render pass (0x%" PRIxLEAST64 ") due to: %s. %s",
+ commandBuffer, reinterpret_cast<const uint64_t &>(pInfo->renderPass),
+ reinterpret_cast<const uint64_t &>(pInfo->framebuffer),
+ reinterpret_cast<uint64_t &>(framebuffer->createInfo.renderPass), errorString.c_str(),
+ validation_error_map[VALIDATION_ERROR_00112]);
}
// Connect this framebuffer and its children to this cmdBuffer
AddFramebufferBinding(dev_data, cb_node, framebuffer);
@@ -6891,42 +6867,41 @@ VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(VkCommandBuffer commandBuffer,
}
if ((pInfo->occlusionQueryEnable == VK_FALSE || dev_data->enabled_features.occlusionQueryPrecise == VK_FALSE) &&
(pInfo->queryFlags & VK_QUERY_CONTROL_PRECISE_BIT)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast<uint64_t>(commandBuffer),
- __LINE__, VALIDATION_ERROR_00107, "DS",
- "vkBeginCommandBuffer(): Secondary Command Buffer (0x%p) must not have "
- "VK_QUERY_CONTROL_PRECISE_BIT if occulusionQuery is disabled or the device does not "
- "support precise occlusion queries. %s",
- commandBuffer, validation_error_map[VALIDATION_ERROR_00107]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast<uint64_t>(commandBuffer),
+ __LINE__, VALIDATION_ERROR_00107, "DS",
+ "vkBeginCommandBuffer(): Secondary Command Buffer (0x%p) must not have "
+ "VK_QUERY_CONTROL_PRECISE_BIT if occulusionQuery is disabled or the device does not "
+ "support precise occlusion queries. %s",
+ commandBuffer, validation_error_map[VALIDATION_ERROR_00107]);
}
}
if (pInfo && pInfo->renderPass != VK_NULL_HANDLE) {
auto renderPass = GetRenderPassState(dev_data, pInfo->renderPass);
if (renderPass) {
if (pInfo->subpass >= renderPass->createInfo.subpassCount) {
- skip_call |= log_msg(
- dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- (uint64_t)commandBuffer, __LINE__, VALIDATION_ERROR_00111, "DS",
- "vkBeginCommandBuffer(): Secondary Command Buffers (0x%p) must have a subpass index (%d) "
- "that is less than the number of subpasses (%d). %s",
- commandBuffer, pInfo->subpass, renderPass->createInfo.subpassCount,
- validation_error_map[VALIDATION_ERROR_00111]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, (uint64_t)commandBuffer, __LINE__,
+ VALIDATION_ERROR_00111, "DS",
+ "vkBeginCommandBuffer(): Secondary Command Buffers (0x%p) must have a subpass index (%d) "
+ "that is less than the number of subpasses (%d). %s",
+ commandBuffer, pInfo->subpass, renderPass->createInfo.subpassCount,
+ validation_error_map[VALIDATION_ERROR_00111]);
}
}
}
}
if (CB_RECORDING == cb_node->state) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- (uint64_t)commandBuffer, __LINE__, VALIDATION_ERROR_00103, "DS",
- "vkBeginCommandBuffer(): Cannot call Begin on command buffer (0x%p"
- ") in the RECORDING state. Must first call vkEndCommandBuffer(). %s",
- commandBuffer, validation_error_map[VALIDATION_ERROR_00103]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ (uint64_t)commandBuffer, __LINE__, VALIDATION_ERROR_00103, "DS",
+ "vkBeginCommandBuffer(): Cannot call Begin on command buffer (0x%p"
+ ") in the RECORDING state. Must first call vkEndCommandBuffer(). %s",
+ commandBuffer, validation_error_map[VALIDATION_ERROR_00103]);
} else if (CB_RECORDED == cb_node->state || (CB_INVALID == cb_node->state && CMD_END == cb_node->last_cmd)) {
VkCommandPool cmdPool = cb_node->createInfo.commandPool;
auto pPool = GetCommandPoolNode(dev_data, cmdPool);
if (!(VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT & pPool->createFlags)) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
(uint64_t)commandBuffer, __LINE__, VALIDATION_ERROR_00105, "DS",
"Call to vkBeginCommandBuffer() on command buffer (0x%p"
@@ -6953,7 +6928,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(VkCommandBuffer commandBuffer,
}
}
lock.unlock();
- if (skip_call) {
+ if (skip) {
return VK_ERROR_VALIDATION_FAILED_EXT;
}
VkResult result = dev_data->dispatch_table.BeginCommandBuffer(commandBuffer, pBeginInfo);
@@ -6962,7 +6937,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(VkCommandBuffer commandBuffer,
}
VKAPI_ATTR VkResult VKAPI_CALL EndCommandBuffer(VkCommandBuffer commandBuffer) {
- bool skip_call = false;
+ bool skip = false;
VkResult result = VK_SUCCESS;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
@@ -6972,19 +6947,18 @@ VKAPI_ATTR VkResult VKAPI_CALL EndCommandBuffer(VkCommandBuffer commandBuffer) {
!(pCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT)) {
// This needs spec clarification to update valid usage, see comments in PR:
// https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/pull/516#discussion_r63013756
- skip_call |= insideRenderPass(dev_data, pCB, "vkEndCommandBuffer()", VALIDATION_ERROR_00123);
+ skip |= insideRenderPass(dev_data, pCB, "vkEndCommandBuffer()", VALIDATION_ERROR_00123);
}
- skip_call |= ValidateCmd(dev_data, pCB, CMD_END, "vkEndCommandBuffer()");
+ skip |= ValidateCmd(dev_data, pCB, CMD_END, "vkEndCommandBuffer()");
UpdateCmdBufferLastCmd(pCB, CMD_END);
for (auto query : pCB->activeQueries) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00124, "DS",
- "Ending command buffer with in progress query: queryPool 0x%" PRIx64 ", index %d. %s",
- (uint64_t)(query.pool), query.index, validation_error_map[VALIDATION_ERROR_00124]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00124, "DS",
+ "Ending command buffer with in progress query: queryPool 0x%" PRIx64 ", index %d. %s",
+ (uint64_t)(query.pool), query.index, validation_error_map[VALIDATION_ERROR_00124]);
}
}
- if (!skip_call) {
+ if (!skip) {
lock.unlock();
result = dev_data->dispatch_table.EndCommandBuffer(commandBuffer);
lock.lock();
@@ -7001,22 +6975,22 @@ VKAPI_ATTR VkResult VKAPI_CALL EndCommandBuffer(VkCommandBuffer commandBuffer) {
}
VKAPI_ATTR VkResult VKAPI_CALL ResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
VkCommandPool cmdPool = pCB->createInfo.commandPool;
auto pPool = GetCommandPoolNode(dev_data, cmdPool);
if (!(VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT & pPool->createFlags)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- (uint64_t)commandBuffer, __LINE__, VALIDATION_ERROR_00093, "DS",
- "Attempt to reset command buffer (0x%p) created from command pool (0x%" PRIxLEAST64
- ") that does NOT have the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT bit set. %s",
- commandBuffer, (uint64_t)cmdPool, validation_error_map[VALIDATION_ERROR_00093]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ (uint64_t)commandBuffer, __LINE__, VALIDATION_ERROR_00093, "DS",
+ "Attempt to reset command buffer (0x%p) created from command pool (0x%" PRIxLEAST64
+ ") that does NOT have the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT bit set. %s",
+ commandBuffer, (uint64_t)cmdPool, validation_error_map[VALIDATION_ERROR_00093]);
}
- skip_call |= checkCommandBufferInFlight(dev_data, pCB, "reset", VALIDATION_ERROR_00092);
+ skip |= checkCommandBufferInFlight(dev_data, pCB, "reset", VALIDATION_ERROR_00092);
lock.unlock();
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
VkResult result = dev_data->dispatch_table.ResetCommandBuffer(commandBuffer, flags);
if (VK_SUCCESS == result) {
lock.lock();
@@ -7077,169 +7051,163 @@ VKAPI_ATTR void VKAPI_CALL CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipe
VKAPI_ATTR void VKAPI_CALL CmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount,
const VkViewport *pViewports) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetViewport()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01446);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_SETVIEWPORTSTATE, "vkCmdSetViewport()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetViewport()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01446);
+ skip |= ValidateCmd(dev_data, pCB, CMD_SETVIEWPORTSTATE, "vkCmdSetViewport()");
UpdateCmdBufferLastCmd(pCB, CMD_SETVIEWPORTSTATE);
pCB->viewportMask |= ((1u << viewportCount) - 1u) << firstViewport;
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
+ if (!skip) dev_data->dispatch_table.CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
}
VKAPI_ATTR void VKAPI_CALL CmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount,
const VkRect2D *pScissors) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetScissor()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01495);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_SETSCISSORSTATE, "vkCmdSetScissor()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetScissor()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01495);
+ skip |= ValidateCmd(dev_data, pCB, CMD_SETSCISSORSTATE, "vkCmdSetScissor()");
UpdateCmdBufferLastCmd(pCB, CMD_SETSCISSORSTATE);
pCB->scissorMask |= ((1u << scissorCount) - 1u) << firstScissor;
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
+ if (!skip) dev_data->dispatch_table.CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
}
VKAPI_ATTR void VKAPI_CALL CmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetLineWidth()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01480);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_SETLINEWIDTHSTATE, "vkCmdSetLineWidth()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetLineWidth()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01480);
+ skip |= ValidateCmd(dev_data, pCB, CMD_SETLINEWIDTHSTATE, "vkCmdSetLineWidth()");
UpdateCmdBufferLastCmd(pCB, CMD_SETLINEWIDTHSTATE);
pCB->status |= CBSTATUS_LINE_WIDTH_SET;
PIPELINE_STATE *pPipeTrav = pCB->lastBound[VK_PIPELINE_BIND_POINT_GRAPHICS].pipeline_state;
if (pPipeTrav != NULL && !isDynamic(pPipeTrav, VK_DYNAMIC_STATE_LINE_WIDTH)) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_01476, "DS",
- "vkCmdSetLineWidth called but pipeline was created without VK_DYNAMIC_STATE_LINE_WIDTH "
- "flag. This is undefined behavior and could be ignored. %s",
- validation_error_map[VALIDATION_ERROR_01476]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_01476, "DS",
+ "vkCmdSetLineWidth called but pipeline was created without VK_DYNAMIC_STATE_LINE_WIDTH "
+ "flag. This is undefined behavior and could be ignored. %s",
+ validation_error_map[VALIDATION_ERROR_01476]);
} else {
- skip_call |= verifyLineWidth(dev_data, DRAWSTATE_INVALID_SET, kVulkanObjectTypeCommandBuffer,
- reinterpret_cast<uint64_t &>(commandBuffer), lineWidth);
+ skip |= verifyLineWidth(dev_data, DRAWSTATE_INVALID_SET, kVulkanObjectTypeCommandBuffer,
+ reinterpret_cast<uint64_t &>(commandBuffer), lineWidth);
}
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdSetLineWidth(commandBuffer, lineWidth);
+ if (!skip) dev_data->dispatch_table.CmdSetLineWidth(commandBuffer, lineWidth);
}
VKAPI_ATTR void VKAPI_CALL CmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp,
float depthBiasSlopeFactor) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetDepthBias()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01485);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_SETDEPTHBIASSTATE, "vkCmdSetDepthBias()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetDepthBias()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01485);
+ skip |= ValidateCmd(dev_data, pCB, CMD_SETDEPTHBIASSTATE, "vkCmdSetDepthBias()");
if ((depthBiasClamp != 0.0) && (!dev_data->enabled_features.depthBiasClamp)) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_01482, "DS",
- "vkCmdSetDepthBias(): the depthBiasClamp device feature is disabled: the depthBiasClamp "
- "parameter must be set to 0.0. %s",
- validation_error_map[VALIDATION_ERROR_01482]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_01482, "DS",
+ "vkCmdSetDepthBias(): the depthBiasClamp device feature is disabled: the depthBiasClamp "
+ "parameter must be set to 0.0. %s",
+ validation_error_map[VALIDATION_ERROR_01482]);
}
- if (!skip_call) {
+ if (!skip) {
UpdateCmdBufferLastCmd(pCB, CMD_SETDEPTHBIASSTATE);
pCB->status |= CBSTATUS_DEPTH_BIAS_SET;
}
}
lock.unlock();
- if (!skip_call)
+ if (!skip)
dev_data->dispatch_table.CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
}
VKAPI_ATTR void VKAPI_CALL CmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |=
- ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetBlendConstants()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01553);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_SETBLENDSTATE, "vkCmdSetBlendConstants()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetBlendConstants()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01553);
+ skip |= ValidateCmd(dev_data, pCB, CMD_SETBLENDSTATE, "vkCmdSetBlendConstants()");
UpdateCmdBufferLastCmd(pCB, CMD_SETBLENDSTATE);
pCB->status |= CBSTATUS_BLEND_CONSTANTS_SET;
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdSetBlendConstants(commandBuffer, blendConstants);
+ if (!skip) dev_data->dispatch_table.CmdSetBlendConstants(commandBuffer, blendConstants);
}
VKAPI_ATTR void VKAPI_CALL CmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetDepthBounds()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01509);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_SETDEPTHBOUNDSSTATE, "vkCmdSetDepthBounds()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetDepthBounds()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01509);
+ skip |= ValidateCmd(dev_data, pCB, CMD_SETDEPTHBOUNDSSTATE, "vkCmdSetDepthBounds()");
UpdateCmdBufferLastCmd(pCB, CMD_SETDEPTHBOUNDSSTATE);
pCB->status |= CBSTATUS_DEPTH_BOUNDS_SET;
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
+ if (!skip) dev_data->dispatch_table.CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
}
VKAPI_ATTR void VKAPI_CALL CmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
uint32_t compareMask) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |=
- ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetStencilCompareMask()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01519);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILREADMASKSTATE, "vkCmdSetStencilCompareMask()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetStencilCompareMask()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01519);
+ skip |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILREADMASKSTATE, "vkCmdSetStencilCompareMask()");
UpdateCmdBufferLastCmd(pCB, CMD_SETSTENCILREADMASKSTATE);
pCB->status |= CBSTATUS_STENCIL_READ_MASK_SET;
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
+ if (!skip) dev_data->dispatch_table.CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
}
VKAPI_ATTR void VKAPI_CALL CmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |=
- ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetStencilWriteMask()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01525);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILWRITEMASKSTATE, "vkCmdSetStencilWriteMask()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetStencilWriteMask()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01525);
+ skip |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILWRITEMASKSTATE, "vkCmdSetStencilWriteMask()");
UpdateCmdBufferLastCmd(pCB, CMD_SETSTENCILWRITEMASKSTATE);
pCB->status |= CBSTATUS_STENCIL_WRITE_MASK_SET;
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
+ if (!skip) dev_data->dispatch_table.CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
}
VKAPI_ATTR void VKAPI_CALL CmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |=
- ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetStencilReference()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01531);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILREFERENCESTATE, "vkCmdSetStencilReference()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetStencilReference()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_01531);
+ skip |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILREFERENCESTATE, "vkCmdSetStencilReference()");
UpdateCmdBufferLastCmd(pCB, CMD_SETSTENCILREFERENCESTATE);
pCB->status |= CBSTATUS_STENCIL_REFERENCE_SET;
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdSetStencilReference(commandBuffer, faceMask, reference);
+ if (!skip) dev_data->dispatch_table.CmdSetStencilReference(commandBuffer, faceMask, reference);
}
VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint,
@@ -7865,36 +7833,35 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyImageToBuffer(VkCommandBuffer commandBuffer, V
VKAPI_ATTR void VKAPI_CALL CmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset,
VkDeviceSize dataSize, const uint32_t *pData) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
auto cb_node = GetCBNode(dev_data, commandBuffer);
auto dst_buff_state = GetBufferState(dev_data, dstBuffer);
if (cb_node && dst_buff_state) {
- skip_call |= ValidateMemoryIsBoundToBuffer(dev_data, dst_buff_state, "vkCmdUpdateBuffer()", VALIDATION_ERROR_02530);
+ skip |= ValidateMemoryIsBoundToBuffer(dev_data, dst_buff_state, "vkCmdUpdateBuffer()", VALIDATION_ERROR_02530);
// Update bindings between buffer and cmd buffer
AddCommandBufferBindingBuffer(dev_data, cb_node, dst_buff_state);
// Validate that DST buffer has correct usage flags set
- skip_call |= ValidateBufferUsageFlags(dev_data, dst_buff_state, VK_BUFFER_USAGE_TRANSFER_DST_BIT, true,
- VALIDATION_ERROR_01146, "vkCmdUpdateBuffer()", "VK_BUFFER_USAGE_TRANSFER_DST_BIT");
+ skip |= ValidateBufferUsageFlags(dev_data, dst_buff_state, VK_BUFFER_USAGE_TRANSFER_DST_BIT, true, VALIDATION_ERROR_01146,
+ "vkCmdUpdateBuffer()", "VK_BUFFER_USAGE_TRANSFER_DST_BIT");
std::function<bool()> function = [=]() {
SetBufferMemoryValid(dev_data, dst_buff_state, true);
return false;
};
cb_node->validate_functions.push_back(function);
- skip_call |=
- ValidateCmdQueueFlags(dev_data, cb_node, "vkCmdUpdateBuffer()",
- VK_QUEUE_TRANSFER_BIT | VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, VALIDATION_ERROR_01154);
- skip_call |= ValidateCmd(dev_data, cb_node, CMD_UPDATEBUFFER, "vkCmdUpdateBuffer()");
+ skip |= ValidateCmdQueueFlags(dev_data, cb_node, "vkCmdUpdateBuffer()",
+ VK_QUEUE_TRANSFER_BIT | VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, VALIDATION_ERROR_01154);
+ skip |= ValidateCmd(dev_data, cb_node, CMD_UPDATEBUFFER, "vkCmdUpdateBuffer()");
UpdateCmdBufferLastCmd(cb_node, CMD_UPDATEBUFFER);
- skip_call |= insideRenderPass(dev_data, cb_node, "vkCmdUpdateBuffer()", VALIDATION_ERROR_01155);
+ skip |= insideRenderPass(dev_data, cb_node, "vkCmdUpdateBuffer()", VALIDATION_ERROR_01155);
} else {
assert(0);
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
+ if (!skip) dev_data->dispatch_table.CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
}
VKAPI_ATTR void VKAPI_CALL CmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset,
@@ -8001,17 +7968,17 @@ bool setEventStageMask(VkQueue queue, VkCommandBuffer commandBuffer, VkEvent eve
}
VKAPI_ATTR void VKAPI_CALL CmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetEvent()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT,
- VALIDATION_ERROR_00237);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_SETEVENT, "vkCmdSetEvent()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetEvent()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT,
+ VALIDATION_ERROR_00237);
+ skip |= ValidateCmd(dev_data, pCB, CMD_SETEVENT, "vkCmdSetEvent()");
UpdateCmdBufferLastCmd(pCB, CMD_SETEVENT);
- skip_call |= insideRenderPass(dev_data, pCB, "vkCmdSetEvent()", VALIDATION_ERROR_00238);
- skip_call |=
+ skip |= insideRenderPass(dev_data, pCB, "vkCmdSetEvent()", VALIDATION_ERROR_00238);
+ skip |=
ValidateStageMaskGsTsEnables(dev_data, stageMask, "vkCmdSetEvent()", VALIDATION_ERROR_00230, VALIDATION_ERROR_00231);
auto event_state = GetEventNode(dev_data, event);
if (event_state) {
@@ -8028,21 +7995,21 @@ VKAPI_ATTR void VKAPI_CALL CmdSetEvent(VkCommandBuffer commandBuffer, VkEvent ev
pCB->eventUpdates.push_back(eventUpdate);
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdSetEvent(commandBuffer, event, stageMask);
+ if (!skip) dev_data->dispatch_table.CmdSetEvent(commandBuffer, event, stageMask);
}
VKAPI_ATTR void VKAPI_CALL CmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdResetEvent()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT,
- VALIDATION_ERROR_00248);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_RESETEVENT, "vkCmdResetEvent()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdResetEvent()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT,
+ VALIDATION_ERROR_00248);
+ skip |= ValidateCmd(dev_data, pCB, CMD_RESETEVENT, "vkCmdResetEvent()");
UpdateCmdBufferLastCmd(pCB, CMD_RESETEVENT);
- skip_call |= insideRenderPass(dev_data, pCB, "vkCmdResetEvent()", VALIDATION_ERROR_00249);
- skip_call |=
+ skip |= insideRenderPass(dev_data, pCB, "vkCmdResetEvent()", VALIDATION_ERROR_00249);
+ skip |=
ValidateStageMaskGsTsEnables(dev_data, stageMask, "vkCmdResetEvent()", VALIDATION_ERROR_00240, VALIDATION_ERROR_00241);
auto event_state = GetEventNode(dev_data, event);
if (event_state) {
@@ -8060,7 +8027,7 @@ VKAPI_ATTR void VKAPI_CALL CmdResetEvent(VkCommandBuffer commandBuffer, VkEvent
pCB->eventUpdates.push_back(eventUpdate);
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdResetEvent(commandBuffer, event, stageMask);
+ if (!skip) dev_data->dispatch_table.CmdResetEvent(commandBuffer, event, stageMask);
}
static bool ValidateBarriers(const char *funcName, VkCommandBuffer cmdBuffer, uint32_t memBarrierCount,
@@ -8242,7 +8209,7 @@ static bool ValidateBarriers(const char *funcName, VkCommandBuffer cmdBuffer, ui
bool validateEventStageMask(VkQueue queue, GLOBAL_CB_NODE *pCB, uint32_t eventCount, size_t firstEventIndex,
VkPipelineStageFlags sourceStageMask) {
- bool skip_call = false;
+ bool skip = false;
VkPipelineStageFlags stageMask = 0;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
for (uint32_t i = 0; i < eventCount; ++i) {
@@ -8255,10 +8222,10 @@ bool validateEventStageMask(VkQueue queue, GLOBAL_CB_NODE *pCB, uint32_t eventCo
} else {
auto global_event_data = GetEventNode(dev_data, event);
if (!global_event_data) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT,
- reinterpret_cast<const uint64_t &>(event), __LINE__, DRAWSTATE_INVALID_EVENT, "DS",
- "Event 0x%" PRIx64 " cannot be waited on if it has never been set.",
- reinterpret_cast<const uint64_t &>(event));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT,
+ reinterpret_cast<const uint64_t &>(event), __LINE__, DRAWSTATE_INVALID_EVENT, "DS",
+ "Event 0x%" PRIx64 " cannot be waited on if it has never been set.",
+ reinterpret_cast<const uint64_t &>(event));
} else {
stageMask |= global_event_data->stageMask;
}
@@ -8267,16 +8234,16 @@ bool validateEventStageMask(VkQueue queue, GLOBAL_CB_NODE *pCB, uint32_t eventCo
// TODO: Need to validate that host_bit is only set if set event is called
// but set event can be called at any time.
if (sourceStageMask != stageMask && sourceStageMask != (stageMask | VK_PIPELINE_STAGE_HOST_BIT)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, VALIDATION_ERROR_00254, "DS",
- "Submitting cmdbuffer with call to VkCmdWaitEvents "
- "using srcStageMask 0x%X which must be the bitwise "
- "OR of the stageMask parameters used in calls to "
- "vkCmdSetEvent and VK_PIPELINE_STAGE_HOST_BIT if "
- "used with vkSetEvent but instead is 0x%X. %s",
- sourceStageMask, stageMask, validation_error_map[VALIDATION_ERROR_00254]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, VALIDATION_ERROR_00254, "DS",
+ "Submitting cmdbuffer with call to VkCmdWaitEvents "
+ "using srcStageMask 0x%X which must be the bitwise "
+ "OR of the stageMask parameters used in calls to "
+ "vkCmdSetEvent and VK_PIPELINE_STAGE_HOST_BIT if "
+ "used with vkSetEvent but instead is 0x%X. %s",
+ sourceStageMask, stageMask, validation_error_map[VALIDATION_ERROR_00254]);
}
- return skip_call;
+ return skip;
}
// Note that we only check bits that HAVE required queueflags -- don't care entries are skipped
@@ -8479,7 +8446,7 @@ bool setQueryState(VkQueue queue, VkCommandBuffer commandBuffer, QueryObject obj
}
VKAPI_ATTR void VKAPI_CALL CmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
@@ -8489,15 +8456,15 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryP
if (!pCB->startedQueries.count(query)) {
pCB->startedQueries.insert(query);
}
- skip_call |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdBeginQuery()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT,
- VALIDATION_ERROR_01039);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_BEGINQUERY, "vkCmdBeginQuery()");
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdBeginQuery()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT,
+ VALIDATION_ERROR_01039);
+ skip |= ValidateCmd(dev_data, pCB, CMD_BEGINQUERY, "vkCmdBeginQuery()");
UpdateCmdBufferLastCmd(pCB, CMD_BEGINQUERY);
addCommandBufferBinding(&GetQueryPoolNode(dev_data, queryPool)->cb_bindings,
{reinterpret_cast<uint64_t &>(queryPool), kVulkanObjectTypeQueryPool}, pCB);
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdBeginQuery(commandBuffer, queryPool, slot, flags);
+ if (!skip) dev_data->dispatch_table.CmdBeginQuery(commandBuffer, queryPool, slot, flags);
}
VKAPI_ATTR void VKAPI_CALL CmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot) {
@@ -8555,7 +8522,7 @@ VKAPI_ATTR void VKAPI_CALL CmdResetQueryPool(VkCommandBuffer commandBuffer, VkQu
}
bool validateQuery(VkQueue queue, GLOBAL_CB_NODE *pCB, VkQueryPool queryPool, uint32_t queryCount, uint32_t firstQuery) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(pCB->commandBuffer), layer_data_map);
auto queue_data = dev_data->queueMap.find(queue);
if (queue_data == dev_data->queueMap.end()) return false;
@@ -8578,14 +8545,13 @@ bool validateQuery(VkQueue queue, GLOBAL_CB_NODE *pCB, VkQueryPool queryPool, ui
}
}
if (fail) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_QUERY, "DS",
- "Requesting a copy from query to buffer with invalid query: queryPool 0x%" PRIx64 ", index %d",
- reinterpret_cast<uint64_t &>(queryPool), firstQuery + i);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_QUERY, "DS",
+ "Requesting a copy from query to buffer with invalid query: queryPool 0x%" PRIx64 ", index %d",
+ reinterpret_cast<uint64_t &>(queryPool), firstQuery + i);
}
}
- return skip_call;
+ return skip;
}
VKAPI_ATTR void VKAPI_CALL CmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery,
@@ -8732,13 +8698,13 @@ static bool MatchUsage(layer_data *dev_data, uint32_t count, const VkAttachmentR
// 7. fb attachments used by renderPass for color/input/ds have correct usage bit set
// 8. fb dimensions are within physical device limits
static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebufferCreateInfo *pCreateInfo) {
- bool skip_call = false;
+ bool skip = false;
auto rp_state = GetRenderPassState(dev_data, pCreateInfo->renderPass);
if (rp_state) {
const VkRenderPassCreateInfo *rpci = rp_state->createInfo.ptr();
if (rpci->attachmentCount != pCreateInfo->attachmentCount) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT,
reinterpret_cast<const uint64_t &>(pCreateInfo->renderPass), __LINE__, VALIDATION_ERROR_00404, "DS",
"vkCreateFramebuffer(): VkFramebufferCreateInfo attachmentCount of %u does not match attachmentCount of %u of "
@@ -8752,7 +8718,7 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf
auto view_state = GetImageViewState(dev_data, image_views[i]);
auto &ivci = view_state->create_info;
if (ivci.format != rpci->pAttachments[i].format) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT,
reinterpret_cast<const uint64_t &>(pCreateInfo->renderPass), __LINE__, VALIDATION_ERROR_00408, "DS",
"vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has format of %s that does not match "
@@ -8763,7 +8729,7 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf
}
const VkImageCreateInfo *ici = &GetImageState(dev_data, ivci.image)->createInfo;
if (ici->samples != rpci->pAttachments[i].samples) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT,
reinterpret_cast<const uint64_t &>(pCreateInfo->renderPass), __LINE__, VALIDATION_ERROR_00409, "DS",
"vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has %s samples that do not match "
@@ -8773,19 +8739,18 @@ 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, 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]);
+ skip |= 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]);
}
const uint32_t mip_level = ivci.subresourceRange.baseMipLevel;
uint32_t mip_width = max(1u, ici->extent.width >> mip_level);
uint32_t mip_height = max(1u, ici->extent.height >> mip_level);
if ((ivci.subresourceRange.layerCount < pCreateInfo->layers) || (mip_width < pCreateInfo->width) ||
(mip_height < pCreateInfo->height)) {
- skip_call |=
+ skip |=
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 "
@@ -8803,7 +8768,7 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf
((ivci.components.g != VK_COMPONENT_SWIZZLE_IDENTITY) && (ivci.components.g != VK_COMPONENT_SWIZZLE_G)) ||
((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(
+ skip |= log_msg(
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 "
@@ -8822,49 +8787,49 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf
// Verify correct attachment usage flags
for (uint32_t subpass = 0; subpass < rpci->subpassCount; subpass++) {
// Verify input attachments:
- skip_call |=
+ skip |=
MatchUsage(dev_data, rpci->pSubpasses[subpass].inputAttachmentCount, rpci->pSubpasses[subpass].pInputAttachments,
pCreateInfo, VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, VALIDATION_ERROR_00407);
// Verify color attachments:
- skip_call |=
+ skip |=
MatchUsage(dev_data, rpci->pSubpasses[subpass].colorAttachmentCount, rpci->pSubpasses[subpass].pColorAttachments,
pCreateInfo, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VALIDATION_ERROR_00405);
// Verify depth/stencil attachments:
if (rpci->pSubpasses[subpass].pDepthStencilAttachment != nullptr) {
- skip_call |= MatchUsage(dev_data, 1, rpci->pSubpasses[subpass].pDepthStencilAttachment, pCreateInfo,
- VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, VALIDATION_ERROR_00406);
+ skip |= MatchUsage(dev_data, 1, rpci->pSubpasses[subpass].pDepthStencilAttachment, pCreateInfo,
+ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, VALIDATION_ERROR_00406);
}
}
}
// 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, 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",
- pCreateInfo->width, dev_data->phys_dev_properties.properties.limits.maxFramebufferWidth,
- validation_error_map[VALIDATION_ERROR_00413]);
+ skip |= 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",
+ pCreateInfo->width, dev_data->phys_dev_properties.properties.limits.maxFramebufferWidth,
+ 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, 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",
- pCreateInfo->height, dev_data->phys_dev_properties.properties.limits.maxFramebufferHeight,
- validation_error_map[VALIDATION_ERROR_00414]);
+ skip |= 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",
+ pCreateInfo->height, dev_data->phys_dev_properties.properties.limits.maxFramebufferHeight,
+ 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, 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",
- pCreateInfo->layers, dev_data->phys_dev_properties.properties.limits.maxFramebufferLayers,
- validation_error_map[VALIDATION_ERROR_00415]);
+ skip |= 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",
+ pCreateInfo->layers, dev_data->phys_dev_properties.properties.limits.maxFramebufferLayers,
+ validation_error_map[VALIDATION_ERROR_00415]);
}
- return skip_call;
+ return skip;
}
// Validate VkFramebufferCreateInfo state prior to calling down chain to create Framebuffer object
@@ -8872,9 +8837,9 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf
// false indicates that call down chain should proceed
static bool PreCallValidateCreateFramebuffer(layer_data *dev_data, const VkFramebufferCreateInfo *pCreateInfo) {
// TODO : Verify that renderPass FB is created with is compatible with FB
- bool skip_call = false;
- skip_call |= ValidateFramebufferCreateInfo(dev_data, pCreateInfo);
- return skip_call;
+ bool skip = false;
+ skip |= ValidateFramebufferCreateInfo(dev_data, pCreateInfo);
+ return skip;
}
// CreateFramebuffer state has been validated and call down chain completed so record new framebuffer object
@@ -8902,10 +8867,10 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateFramebuffer(VkDevice device, const VkFrameb
const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
- bool skip_call = PreCallValidateCreateFramebuffer(dev_data, pCreateInfo);
+ bool skip = PreCallValidateCreateFramebuffer(dev_data, pCreateInfo);
lock.unlock();
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
VkResult result = dev_data->dispatch_table.CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
@@ -8935,8 +8900,8 @@ static bool FindDependency(const uint32_t index, const uint32_t dependent, const
}
static bool CheckDependencyExists(const layer_data *dev_data, const uint32_t subpass,
- const std::vector<uint32_t> &dependent_subpasses,
- const std::vector<DAGNode> &subpass_to_node, bool &skip_call) {
+ const std::vector<uint32_t> &dependent_subpasses, const std::vector<DAGNode> &subpass_to_node,
+ bool &skip) {
bool result = true;
// Loop through all subpasses that share the same attachment and make sure a dependency exists
for (uint32_t k = 0; k < dependent_subpasses.size(); ++k) {
@@ -8950,10 +8915,10 @@ static bool CheckDependencyExists(const layer_data *dev_data, const uint32_t sub
std::unordered_set<uint32_t> processed_nodes;
if (!(FindDependency(subpass, dependent_subpasses[k], subpass_to_node, processed_nodes) ||
FindDependency(dependent_subpasses[k], subpass, subpass_to_node, processed_nodes))) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT,
- 0, __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS",
- "A dependency between subpasses %d and %d must exist but one is not specified.", subpass,
- dependent_subpasses[k]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS",
+ "A dependency between subpasses %d and %d must exist but one is not specified.", subpass,
+ dependent_subpasses[k]);
result = false;
}
}
@@ -8962,7 +8927,7 @@ static bool CheckDependencyExists(const layer_data *dev_data, const uint32_t sub
}
static bool CheckPreserved(const layer_data *dev_data, const VkRenderPassCreateInfo *pCreateInfo, const int index,
- const uint32_t attachment, const std::vector<DAGNode> &subpass_to_node, int depth, bool &skip_call) {
+ const uint32_t attachment, const std::vector<DAGNode> &subpass_to_node, int depth, bool &skip) {
const DAGNode &node = subpass_to_node[index];
// If this node writes to the attachment return true as next nodes need to preserve the attachment.
const VkSubpassDescription &subpass = pCreateInfo->pSubpasses[index];
@@ -8978,7 +8943,7 @@ static bool CheckPreserved(const layer_data *dev_data, const VkRenderPassCreateI
bool result = false;
// Loop through previous nodes and see if any of them write to the attachment.
for (auto elem : node.prev) {
- result |= CheckPreserved(dev_data, pCreateInfo, elem, attachment, subpass_to_node, depth + 1, skip_call);
+ result |= CheckPreserved(dev_data, pCreateInfo, elem, attachment, subpass_to_node, depth + 1, skip);
}
// If the attachment was written to by a previous node than this node needs to preserve it.
if (result && depth > 0) {
@@ -8990,10 +8955,9 @@ static bool CheckPreserved(const layer_data *dev_data, const VkRenderPassCreateI
}
}
if (!has_preserved) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
- DRAWSTATE_INVALID_RENDERPASS, "DS",
- "Attachment %d is used by a later subpass and must be preserved in subpass %d.", attachment, index);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS",
+ "Attachment %d is used by a later subpass and must be preserved in subpass %d.", attachment, index);
}
}
return result;
@@ -9012,7 +8976,7 @@ bool isRegionOverlapping(VkImageSubresourceRange range1, VkImageSubresourceRange
static bool ValidateDependencies(const layer_data *dev_data, FRAMEBUFFER_STATE const *framebuffer,
RENDER_PASS_STATE const *renderPass) {
- bool skip_call = false;
+ bool skip = false;
auto const pFramebufferInfo = framebuffer->createInfo.ptr();
auto const pCreateInfo = renderPass->createInfo.ptr();
auto const &subpass_to_node = renderPass->subpassToNode;
@@ -9058,7 +9022,7 @@ static bool ValidateDependencies(const layer_data *dev_data, FRAMEBUFFER_STATE c
uint32_t attachment = i;
for (auto other_attachment : overlapping_attachments[i]) {
if (!(pCreateInfo->pAttachments[attachment].flags & VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT)) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT,
reinterpret_cast<const uint64_t &>(framebuffer->framebuffer), __LINE__, VALIDATION_ERROR_00324, "DS",
"Attachment %d aliases attachment %d but doesn't "
@@ -9066,7 +9030,7 @@ static bool ValidateDependencies(const layer_data *dev_data, FRAMEBUFFER_STATE c
attachment, other_attachment, validation_error_map[VALIDATION_ERROR_00324]);
}
if (!(pCreateInfo->pAttachments[other_attachment].flags & VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT)) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT,
reinterpret_cast<const uint64_t &>(framebuffer->framebuffer), __LINE__, VALIDATION_ERROR_00324, "DS",
"Attachment %d aliases attachment %d but doesn't "
@@ -9105,7 +9069,7 @@ static bool ValidateDependencies(const layer_data *dev_data, FRAMEBUFFER_STATE c
}
if (attachmentIndices.count(attachment)) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
__LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS",
"Cannot use same attachment (%u) as both color and depth output in same subpass (%u).", attachment, i);
@@ -9119,19 +9083,19 @@ static bool ValidateDependencies(const layer_data *dev_data, FRAMEBUFFER_STATE c
for (uint32_t j = 0; j < subpass.inputAttachmentCount; ++j) {
uint32_t attachment = subpass.pInputAttachments[j].attachment;
if (attachment == VK_ATTACHMENT_UNUSED) continue;
- CheckDependencyExists(dev_data, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call);
+ CheckDependencyExists(dev_data, i, output_attachment_to_subpass[attachment], subpass_to_node, skip);
}
// If the attachment is an output then all subpasses that use the attachment must have a dependency relationship
for (uint32_t j = 0; j < subpass.colorAttachmentCount; ++j) {
uint32_t attachment = subpass.pColorAttachments[j].attachment;
if (attachment == VK_ATTACHMENT_UNUSED) continue;
- CheckDependencyExists(dev_data, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call);
- CheckDependencyExists(dev_data, i, input_attachment_to_subpass[attachment], subpass_to_node, skip_call);
+ CheckDependencyExists(dev_data, i, output_attachment_to_subpass[attachment], subpass_to_node, skip);
+ CheckDependencyExists(dev_data, i, input_attachment_to_subpass[attachment], subpass_to_node, skip);
}
if (subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
const uint32_t &attachment = subpass.pDepthStencilAttachment->attachment;
- CheckDependencyExists(dev_data, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call);
- CheckDependencyExists(dev_data, i, input_attachment_to_subpass[attachment], subpass_to_node, skip_call);
+ CheckDependencyExists(dev_data, i, output_attachment_to_subpass[attachment], subpass_to_node, skip);
+ CheckDependencyExists(dev_data, i, input_attachment_to_subpass[attachment], subpass_to_node, skip);
}
}
// Loop through implicit dependencies, if this pass reads make sure the attachment is preserved for all passes after it was
@@ -9139,15 +9103,15 @@ static bool ValidateDependencies(const layer_data *dev_data, FRAMEBUFFER_STATE c
for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) {
const VkSubpassDescription &subpass = pCreateInfo->pSubpasses[i];
for (uint32_t j = 0; j < subpass.inputAttachmentCount; ++j) {
- CheckPreserved(dev_data, pCreateInfo, i, subpass.pInputAttachments[j].attachment, subpass_to_node, 0, skip_call);
+ CheckPreserved(dev_data, pCreateInfo, i, subpass.pInputAttachments[j].attachment, subpass_to_node, 0, skip);
}
}
- return skip_call;
+ return skip;
}
static bool CreatePassDAG(const layer_data *dev_data, VkDevice device, const VkRenderPassCreateInfo *pCreateInfo,
std::vector<DAGNode> &subpass_to_node, std::vector<bool> &has_self_dependency) {
- bool skip_call = false;
+ bool skip = false;
for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) {
DAGNode &subpass_node = subpass_to_node[i];
subpass_node.pass = i;
@@ -9156,14 +9120,14 @@ static bool CreatePassDAG(const layer_data *dev_data, VkDevice device, const VkR
const VkSubpassDependency &dependency = pCreateInfo->pDependencies[i];
if (dependency.srcSubpass == VK_SUBPASS_EXTERNAL || dependency.dstSubpass == VK_SUBPASS_EXTERNAL) {
if (dependency.srcSubpass == dependency.dstSubpass) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
__LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS", "The src and dest subpasses cannot both be external.");
}
} else if (dependency.srcSubpass > dependency.dstSubpass) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
- __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS",
- "Depedency graph must be specified such that an earlier pass cannot depend on a later pass.");
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS",
+ "Depedency graph must be specified such that an earlier pass cannot depend on a later pass.");
} else if (dependency.srcSubpass == dependency.dstSubpass) {
has_self_dependency[dependency.srcSubpass] = true;
} else {
@@ -9171,13 +9135,13 @@ static bool CreatePassDAG(const layer_data *dev_data, VkDevice device, const VkR
subpass_to_node[dependency.srcSubpass].next.push_back(dependency.dstSubpass);
}
}
- return skip_call;
+ return skip;
}
VKAPI_ATTR VkResult VKAPI_CALL CreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
- bool skip_call = false;
+ bool skip = false;
spv_result_t spv_valid = SPV_SUCCESS;
if (!GetDisables(dev_data)->shader_validation) {
@@ -9189,17 +9153,17 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateShaderModule(VkDevice device, const VkShade
spv_valid = spvValidate(ctx, &binary, &diag);
if (spv_valid != SPV_SUCCESS) {
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,
- 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)");
+ skip |= log_msg(dev_data->report_data,
+ spv_valid == SPV_WARNING ? VK_DEBUG_REPORT_WARNING_BIT_EXT : VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ 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)");
}
}
spvDiagnosticDestroy(diag);
spvContextDestroy(ctx);
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
}
VkResult res = dev_data->dispatch_table.CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule);
@@ -9213,37 +9177,37 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateShaderModule(VkDevice device, const VkShade
}
static bool ValidateAttachmentIndex(layer_data *dev_data, uint32_t attachment, uint32_t attachment_count, const char *type) {
- bool skip_call = false;
+ bool skip = false;
if (attachment >= attachment_count && attachment != VK_ATTACHMENT_UNUSED) {
- 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_00325, "DS",
- "CreateRenderPass: %s attachment %d must be less than the total number of attachments %d. %s", type,
- attachment, attachment_count, validation_error_map[VALIDATION_ERROR_00325]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
+ VALIDATION_ERROR_00325, "DS",
+ "CreateRenderPass: %s attachment %d must be less than the total number of attachments %d. %s", type,
+ attachment, attachment_count, validation_error_map[VALIDATION_ERROR_00325]);
}
- return skip_call;
+ return skip;
}
static bool IsPowerOfTwo(unsigned x) { return x && !(x & (x - 1)); }
static bool ValidateRenderpassAttachmentUsage(layer_data *dev_data, const VkRenderPassCreateInfo *pCreateInfo) {
- bool skip_call = false;
+ bool skip = false;
for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) {
const VkSubpassDescription &subpass = pCreateInfo->pSubpasses[i];
if (subpass.pipelineBindPoint != VK_PIPELINE_BIND_POINT_GRAPHICS) {
- 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_00347, "DS",
- "CreateRenderPass: Pipeline bind point for subpass %d must be VK_PIPELINE_BIND_POINT_GRAPHICS. %s",
- i, validation_error_map[VALIDATION_ERROR_00347]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00347, "DS",
+ "CreateRenderPass: Pipeline bind point for subpass %d must be VK_PIPELINE_BIND_POINT_GRAPHICS. %s", i,
+ validation_error_map[VALIDATION_ERROR_00347]);
}
for (uint32_t j = 0; j < subpass.preserveAttachmentCount; ++j) {
uint32_t attachment = subpass.pPreserveAttachments[j];
if (attachment == VK_ATTACHMENT_UNUSED) {
- 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_00356, "DS",
- "CreateRenderPass: Preserve attachment (%d) must not be VK_ATTACHMENT_UNUSED. %s", j,
- validation_error_map[VALIDATION_ERROR_00356]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_00356, "DS",
+ "CreateRenderPass: Preserve attachment (%d) must not be VK_ATTACHMENT_UNUSED. %s", j,
+ validation_error_map[VALIDATION_ERROR_00356]);
} else {
- skip_call |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Preserve");
+ skip |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Preserve");
}
}
@@ -9258,57 +9222,57 @@ static bool ValidateRenderpassAttachmentUsage(layer_data *dev_data, const VkRend
uint32_t attachment;
if (subpass.pResolveAttachments) {
attachment = subpass.pResolveAttachments[j].attachment;
- skip_call |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Resolve");
+ skip |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Resolve");
- if (!skip_call && attachment != VK_ATTACHMENT_UNUSED &&
+ if (!skip && 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,
- 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),
- validation_error_map[VALIDATION_ERROR_00352]);
+ skip |= 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),
+ validation_error_map[VALIDATION_ERROR_00352]);
}
}
attachment = subpass.pColorAttachments[j].attachment;
- skip_call |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Color");
+ skip |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Color");
- if (!skip_call && attachment != VK_ATTACHMENT_UNUSED) {
+ if (!skip && attachment != VK_ATTACHMENT_UNUSED) {
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,
- 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]);
+ skip |= 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]);
}
}
}
if (subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
uint32_t attachment = subpass.pDepthStencilAttachment->attachment;
- skip_call |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Depth stencil");
+ skip |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Depth stencil");
- if (!skip_call && attachment != VK_ATTACHMENT_UNUSED) {
+ if (!skip && attachment != VK_ATTACHMENT_UNUSED) {
sample_count |= (unsigned)pCreateInfo->pAttachments[attachment].samples;
}
}
for (uint32_t j = 0; j < subpass.inputAttachmentCount; ++j) {
uint32_t attachment = subpass.pInputAttachments[j].attachment;
- skip_call |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Input");
+ skip |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Input");
}
if (sample_count && !IsPowerOfTwo(sample_count)) {
- 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]);
+ skip |= 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]);
}
}
- return skip_call;
+ return skip;
}
static void MarkAttachmentFirstUse(RENDER_PASS_STATE *render_pass,
@@ -9323,25 +9287,25 @@ static void MarkAttachmentFirstUse(RENDER_PASS_STATE *render_pass,
VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
// TODO: As part of wrapping up the mem_tracker/core_validation merge the following routine should be consolidated with
// ValidateLayouts.
- skip_call |= ValidateRenderpassAttachmentUsage(dev_data, pCreateInfo);
+ skip |= ValidateRenderpassAttachmentUsage(dev_data, pCreateInfo);
for (uint32_t i = 0; i < pCreateInfo->dependencyCount; ++i) {
- skip_call |= ValidateStageMaskGsTsEnables(dev_data, pCreateInfo->pDependencies[i].srcStageMask, "vkCreateRenderPass()",
- VALIDATION_ERROR_00368, VALIDATION_ERROR_00370);
- skip_call |= ValidateStageMaskGsTsEnables(dev_data, pCreateInfo->pDependencies[i].dstStageMask, "vkCreateRenderPass()",
- VALIDATION_ERROR_00369, VALIDATION_ERROR_00371);
+ skip |= ValidateStageMaskGsTsEnables(dev_data, pCreateInfo->pDependencies[i].srcStageMask, "vkCreateRenderPass()",
+ VALIDATION_ERROR_00368, VALIDATION_ERROR_00370);
+ skip |= ValidateStageMaskGsTsEnables(dev_data, pCreateInfo->pDependencies[i].dstStageMask, "vkCreateRenderPass()",
+ VALIDATION_ERROR_00369, VALIDATION_ERROR_00371);
}
- if (!skip_call) {
- skip_call |= ValidateLayouts(dev_data, device, pCreateInfo);
+ if (!skip) {
+ skip |= ValidateLayouts(dev_data, device, pCreateInfo);
}
lock.unlock();
- if (skip_call) {
+ if (skip) {
return VK_ERROR_VALIDATION_FAILED_EXT;
}
@@ -9352,7 +9316,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass(VkDevice device, const VkRenderP
std::vector<bool> has_self_dependency(pCreateInfo->subpassCount);
std::vector<DAGNode> subpass_to_node(pCreateInfo->subpassCount);
- skip_call |= CreatePassDAG(dev_data, device, pCreateInfo, subpass_to_node, has_self_dependency);
+ skip |= CreatePassDAG(dev_data, device, pCreateInfo, subpass_to_node, has_self_dependency);
auto render_pass = unique_ptr<RENDER_PASS_STATE>(new RENDER_PASS_STATE(pCreateInfo));
render_pass->renderPass = *pRenderPass;
@@ -9384,25 +9348,25 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass(VkDevice device, const VkRenderP
static bool validatePrimaryCommandBuffer(const layer_data *dev_data, const GLOBAL_CB_NODE *pCB, const std::string &cmd_name,
UNIQUE_VALIDATION_ERROR_CODE error_code) {
- bool skip_call = false;
+ bool skip = false;
if (pCB->createInfo.level != VK_COMMAND_BUFFER_LEVEL_PRIMARY) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, error_code, "DS",
- "Cannot execute command %s on a secondary command buffer. %s", cmd_name.c_str(),
- validation_error_map[error_code]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, error_code, "DS",
+ "Cannot execute command %s on a secondary command buffer. %s", cmd_name.c_str(),
+ validation_error_map[error_code]);
}
- return skip_call;
+ return skip;
}
static bool VerifyRenderAreaBounds(const layer_data *dev_data, const VkRenderPassBeginInfo *pRenderPassBegin) {
- bool skip_call = false;
+ bool skip = false;
const safe_VkFramebufferCreateInfo *pFramebufferInfo =
&GetFramebufferState(dev_data, pRenderPassBegin->framebuffer)->createInfo;
if (pRenderPassBegin->renderArea.offset.x < 0 ||
(pRenderPassBegin->renderArea.offset.x + pRenderPassBegin->renderArea.extent.width) > pFramebufferInfo->width ||
pRenderPassBegin->renderArea.offset.y < 0 ||
(pRenderPassBegin->renderArea.offset.y + pRenderPassBegin->renderArea.extent.height) > pFramebufferInfo->height) {
- skip_call |= static_cast<bool>(log_msg(
+ skip |= static_cast<bool>(log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
DRAWSTATE_INVALID_RENDER_AREA, "CORE",
"Cannot execute a render pass with renderArea not within the bound of the "
@@ -9411,7 +9375,7 @@ static bool VerifyRenderAreaBounds(const layer_data *dev_data, const VkRenderPas
pRenderPassBegin->renderArea.offset.x, pRenderPassBegin->renderArea.offset.y, pRenderPassBegin->renderArea.extent.width,
pRenderPassBegin->renderArea.extent.height, pFramebufferInfo->width, pFramebufferInfo->height));
}
- return skip_call;
+ return skip;
}
// If this is a stencil format, make sure the stencil[Load|Store]Op flag is checked, while if it is a depth/color attachment the
@@ -9431,7 +9395,7 @@ static bool FormatSpecificLoadAndStoreOpSettings(VkFormat format, T color_depth_
VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin,
VkSubpassContents contents) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *cb_node = GetCBNode(dev_data, commandBuffer);
@@ -9476,7 +9440,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass(VkCommandBuffer commandBuffer, con
}
}
if (clear_op_size > pRenderPassBegin->clearValueCount) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT,
reinterpret_cast<uint64_t &>(render_pass_state->renderPass), __LINE__, VALIDATION_ERROR_00442, "DS",
"In vkCmdBeginRenderPass() the VkRenderPassBeginInfo struct has a clearValueCount of %u but there must "
@@ -9489,7 +9453,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass(VkCommandBuffer commandBuffer, con
clear_op_size, clear_op_size - 1, validation_error_map[VALIDATION_ERROR_00442]);
}
if (clear_op_size < pRenderPassBegin->clearValueCount) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT,
reinterpret_cast<uint64_t &>(render_pass_state->renderPass), __LINE__,
DRAWSTATE_RENDERPASS_TOO_MANY_CLEAR_VALUES, "DS",
@@ -9499,15 +9463,15 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass(VkCommandBuffer commandBuffer, con
pRenderPassBegin->clearValueCount, clear_op_size, reinterpret_cast<uint64_t &>(render_pass_state->renderPass),
clear_op_size - 1);
}
- skip_call |= VerifyRenderAreaBounds(dev_data, pRenderPassBegin);
- skip_call |= VerifyFramebufferAndRenderPassLayouts(dev_data, cb_node, pRenderPassBegin,
- GetFramebufferState(dev_data, pRenderPassBegin->framebuffer));
- skip_call |= insideRenderPass(dev_data, cb_node, "vkCmdBeginRenderPass()", VALIDATION_ERROR_00440);
- skip_call |= ValidateDependencies(dev_data, framebuffer, render_pass_state);
- skip_call |= validatePrimaryCommandBuffer(dev_data, cb_node, "vkCmdBeginRenderPass", VALIDATION_ERROR_00441);
- skip_call |=
+ skip |= VerifyRenderAreaBounds(dev_data, pRenderPassBegin);
+ skip |= VerifyFramebufferAndRenderPassLayouts(dev_data, cb_node, pRenderPassBegin,
+ GetFramebufferState(dev_data, pRenderPassBegin->framebuffer));
+ skip |= insideRenderPass(dev_data, cb_node, "vkCmdBeginRenderPass()", VALIDATION_ERROR_00440);
+ skip |= ValidateDependencies(dev_data, framebuffer, render_pass_state);
+ skip |= validatePrimaryCommandBuffer(dev_data, cb_node, "vkCmdBeginRenderPass", VALIDATION_ERROR_00441);
+ skip |=
ValidateCmdQueueFlags(dev_data, cb_node, "vkCmdBeginRenderPass()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_00439);
- skip_call |= ValidateCmd(dev_data, cb_node, CMD_BEGINRENDERPASS, "vkCmdBeginRenderPass()");
+ skip |= ValidateCmd(dev_data, cb_node, CMD_BEGINRENDERPASS, "vkCmdBeginRenderPass()");
UpdateCmdBufferLastCmd(cb_node, CMD_BEGINRENDERPASS);
cb_node->activeRenderPass = render_pass_state;
// This is a shallow copy as that is all that is needed for now
@@ -9522,34 +9486,34 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass(VkCommandBuffer commandBuffer, con
}
}
lock.unlock();
- if (!skip_call) {
+ if (!skip) {
dev_data->dispatch_table.CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
}
}
VKAPI_ATTR void VKAPI_CALL CmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
- skip_call |= validatePrimaryCommandBuffer(dev_data, pCB, "vkCmdNextSubpass", VALIDATION_ERROR_00459);
- skip_call |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdNextSubpass()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_00457);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_NEXTSUBPASS, "vkCmdNextSubpass()");
+ skip |= validatePrimaryCommandBuffer(dev_data, pCB, "vkCmdNextSubpass", VALIDATION_ERROR_00459);
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdNextSubpass()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_00457);
+ skip |= ValidateCmd(dev_data, pCB, CMD_NEXTSUBPASS, "vkCmdNextSubpass()");
UpdateCmdBufferLastCmd(pCB, CMD_NEXTSUBPASS);
- skip_call |= outsideRenderPass(dev_data, pCB, "vkCmdNextSubpass()", VALIDATION_ERROR_00458);
+ skip |= outsideRenderPass(dev_data, pCB, "vkCmdNextSubpass()", VALIDATION_ERROR_00458);
auto subpassCount = pCB->activeRenderPass->createInfo.subpassCount;
if (pCB->activeSubpass == subpassCount - 1) {
- skip_call |= log_msg(
- dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00453, "DS",
- "vkCmdNextSubpass(): Attempted to advance beyond final subpass. %s", validation_error_map[VALIDATION_ERROR_00453]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00453, "DS",
+ "vkCmdNextSubpass(): Attempted to advance beyond final subpass. %s",
+ validation_error_map[VALIDATION_ERROR_00453]);
}
}
lock.unlock();
- if (skip_call) return;
+ if (skip) return;
dev_data->dispatch_table.CmdNextSubpass(commandBuffer, contents);
@@ -9563,7 +9527,7 @@ VKAPI_ATTR void VKAPI_CALL CmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpa
}
VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass(VkCommandBuffer commandBuffer) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
auto pCB = GetCBNode(dev_data, commandBuffer);
@@ -9573,10 +9537,10 @@ VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass(VkCommandBuffer commandBuffer) {
framebuffer = GetFramebufferState(dev_data, pCB->activeFramebuffer);
if (rp_state) {
if (pCB->activeSubpass != rp_state->createInfo.subpassCount - 1) {
- skip_call |= log_msg(
- dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00460, "DS",
- "vkCmdEndRenderPass(): Called before reaching final subpass. %s", validation_error_map[VALIDATION_ERROR_00460]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast<uint64_t>(commandBuffer), __LINE__,
+ VALIDATION_ERROR_00460, "DS", "vkCmdEndRenderPass(): Called before reaching final subpass. %s",
+ validation_error_map[VALIDATION_ERROR_00460]);
}
for (size_t i = 0; i < rp_state->createInfo.attachmentCount; ++i) {
@@ -9599,15 +9563,15 @@ VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass(VkCommandBuffer commandBuffer) {
}
}
}
- skip_call |= outsideRenderPass(dev_data, pCB, "vkCmdEndRenderpass()", VALIDATION_ERROR_00464);
- skip_call |= validatePrimaryCommandBuffer(dev_data, pCB, "vkCmdEndRenderPass", VALIDATION_ERROR_00465);
- skip_call |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdEndRenderPass()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_00463);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_ENDRENDERPASS, "vkCmdEndRenderPass()");
+ skip |= outsideRenderPass(dev_data, pCB, "vkCmdEndRenderpass()", VALIDATION_ERROR_00464);
+ skip |= validatePrimaryCommandBuffer(dev_data, pCB, "vkCmdEndRenderPass", VALIDATION_ERROR_00465);
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdEndRenderPass()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_00463);
+ skip |= ValidateCmd(dev_data, pCB, CMD_ENDRENDERPASS, "vkCmdEndRenderPass()");
UpdateCmdBufferLastCmd(pCB, CMD_ENDRENDERPASS);
}
lock.unlock();
- if (skip_call) return;
+ if (skip) return;
dev_data->dispatch_table.CmdEndRenderPass(commandBuffer);
@@ -9636,7 +9600,7 @@ static bool validateAttachmentCompatibility(layer_data *dev_data, VkCommandBuffe
VkRenderPassCreateInfo const *primaryPassCI, uint32_t primaryAttach,
VkCommandBuffer secondaryBuffer, VkRenderPassCreateInfo const *secondaryPassCI,
uint32_t secondaryAttach, bool is_multi) {
- bool skip_call = false;
+ bool skip = false;
if (primaryPassCI->attachmentCount <= primaryAttach) {
primaryAttach = VK_ATTACHMENT_UNUSED;
}
@@ -9644,37 +9608,37 @@ static bool validateAttachmentCompatibility(layer_data *dev_data, VkCommandBuffe
secondaryAttach = VK_ATTACHMENT_UNUSED;
}
if (primaryAttach == VK_ATTACHMENT_UNUSED && secondaryAttach == VK_ATTACHMENT_UNUSED) {
- return skip_call;
+ return skip;
}
if (primaryAttach == VK_ATTACHMENT_UNUSED) {
- skip_call |= logInvalidAttachmentMessage(dev_data, secondaryBuffer, primaryAttach, secondaryAttach,
- "The first is unused while the second is not.");
- return skip_call;
+ skip |= logInvalidAttachmentMessage(dev_data, secondaryBuffer, primaryAttach, secondaryAttach,
+ "The first is unused while the second is not.");
+ return skip;
}
if (secondaryAttach == VK_ATTACHMENT_UNUSED) {
- skip_call |= logInvalidAttachmentMessage(dev_data, secondaryBuffer, primaryAttach, secondaryAttach,
- "The second is unused while the first is not.");
- return skip_call;
+ skip |= logInvalidAttachmentMessage(dev_data, secondaryBuffer, primaryAttach, secondaryAttach,
+ "The second is unused while the first is not.");
+ return skip;
}
if (primaryPassCI->pAttachments[primaryAttach].format != secondaryPassCI->pAttachments[secondaryAttach].format) {
- skip_call |=
+ skip |=
logInvalidAttachmentMessage(dev_data, secondaryBuffer, primaryAttach, secondaryAttach, "They have different formats.");
}
if (primaryPassCI->pAttachments[primaryAttach].samples != secondaryPassCI->pAttachments[secondaryAttach].samples) {
- skip_call |=
+ skip |=
logInvalidAttachmentMessage(dev_data, secondaryBuffer, primaryAttach, secondaryAttach, "They have different samples.");
}
if (is_multi && primaryPassCI->pAttachments[primaryAttach].flags != secondaryPassCI->pAttachments[secondaryAttach].flags) {
- skip_call |=
+ skip |=
logInvalidAttachmentMessage(dev_data, secondaryBuffer, primaryAttach, secondaryAttach, "They have different flags.");
}
- return skip_call;
+ return skip;
}
static bool validateSubpassCompatibility(layer_data *dev_data, VkCommandBuffer primaryBuffer,
VkRenderPassCreateInfo const *primaryPassCI, VkCommandBuffer secondaryBuffer,
VkRenderPassCreateInfo const *secondaryPassCI, const int subpass, bool is_multi) {
- bool skip_call = false;
+ bool skip = false;
const VkSubpassDescription &primary_desc = primaryPassCI->pSubpasses[subpass];
const VkSubpassDescription &secondary_desc = secondaryPassCI->pSubpasses[subpass];
uint32_t maxInputAttachmentCount = std::max(primary_desc.inputAttachmentCount, secondary_desc.inputAttachmentCount);
@@ -9686,8 +9650,8 @@ static bool validateSubpassCompatibility(layer_data *dev_data, VkCommandBuffer p
if (i < secondary_desc.inputAttachmentCount) {
secondary_input_attach = secondary_desc.pInputAttachments[i].attachment;
}
- skip_call |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPassCI, primary_input_attach, secondaryBuffer,
- secondaryPassCI, secondary_input_attach, is_multi);
+ skip |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPassCI, primary_input_attach, secondaryBuffer,
+ secondaryPassCI, secondary_input_attach, is_multi);
}
uint32_t maxColorAttachmentCount = std::max(primary_desc.colorAttachmentCount, secondary_desc.colorAttachmentCount);
for (uint32_t i = 0; i < maxColorAttachmentCount; ++i) {
@@ -9698,8 +9662,8 @@ static bool validateSubpassCompatibility(layer_data *dev_data, VkCommandBuffer p
if (i < secondary_desc.colorAttachmentCount) {
secondary_color_attach = secondary_desc.pColorAttachments[i].attachment;
}
- skip_call |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPassCI, primary_color_attach, secondaryBuffer,
- secondaryPassCI, secondary_color_attach, is_multi);
+ skip |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPassCI, primary_color_attach, secondaryBuffer,
+ secondaryPassCI, secondary_color_attach, is_multi);
uint32_t primary_resolve_attach = VK_ATTACHMENT_UNUSED, secondary_resolve_attach = VK_ATTACHMENT_UNUSED;
if (i < primary_desc.colorAttachmentCount && primary_desc.pResolveAttachments) {
primary_resolve_attach = primary_desc.pResolveAttachments[i].attachment;
@@ -9707,8 +9671,8 @@ static bool validateSubpassCompatibility(layer_data *dev_data, VkCommandBuffer p
if (i < secondary_desc.colorAttachmentCount && secondary_desc.pResolveAttachments) {
secondary_resolve_attach = secondary_desc.pResolveAttachments[i].attachment;
}
- skip_call |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPassCI, primary_resolve_attach,
- secondaryBuffer, secondaryPassCI, secondary_resolve_attach, is_multi);
+ skip |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPassCI, primary_resolve_attach, secondaryBuffer,
+ secondaryPassCI, secondary_resolve_attach, is_multi);
}
uint32_t primary_depthstencil_attach = VK_ATTACHMENT_UNUSED, secondary_depthstencil_attach = VK_ATTACHMENT_UNUSED;
if (primary_desc.pDepthStencilAttachment) {
@@ -9717,9 +9681,9 @@ static bool validateSubpassCompatibility(layer_data *dev_data, VkCommandBuffer p
if (secondary_desc.pDepthStencilAttachment) {
secondary_depthstencil_attach = secondary_desc.pDepthStencilAttachment[0].attachment;
}
- skip_call |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPassCI, primary_depthstencil_attach,
- secondaryBuffer, secondaryPassCI, secondary_depthstencil_attach, is_multi);
- return skip_call;
+ skip |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPassCI, primary_depthstencil_attach, secondaryBuffer,
+ secondaryPassCI, secondary_depthstencil_attach, is_multi);
+ return skip;
}
// Verify that given renderPass CreateInfo for primary and secondary command buffers are compatible.
@@ -9728,64 +9692,63 @@ static bool validateSubpassCompatibility(layer_data *dev_data, VkCommandBuffer p
static bool validateRenderPassCompatibility(layer_data *dev_data, VkCommandBuffer primaryBuffer,
VkRenderPassCreateInfo const *primaryPassCI, VkCommandBuffer secondaryBuffer,
VkRenderPassCreateInfo const *secondaryPassCI) {
- bool skip_call = false;
+ bool skip = false;
if (primaryPassCI->subpassCount != secondaryPassCI->subpassCount) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(primaryBuffer), __LINE__, DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, "DS",
- "vkCmdExecuteCommands() called w/ invalid secondary Cmd Buffer 0x%" PRIx64
- " that has a subpassCount of %u that is incompatible with the primary Cmd Buffer 0x%" PRIx64
- " that has a subpassCount of %u.",
- reinterpret_cast<uint64_t &>(secondaryBuffer), secondaryPassCI->subpassCount,
- reinterpret_cast<uint64_t &>(primaryBuffer), primaryPassCI->subpassCount);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(primaryBuffer), __LINE__, DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, "DS",
+ "vkCmdExecuteCommands() called w/ invalid secondary Cmd Buffer 0x%" PRIx64
+ " that has a subpassCount of %u that is incompatible with the primary Cmd Buffer 0x%" PRIx64
+ " that has a subpassCount of %u.",
+ reinterpret_cast<uint64_t &>(secondaryBuffer), secondaryPassCI->subpassCount,
+ reinterpret_cast<uint64_t &>(primaryBuffer), primaryPassCI->subpassCount);
} else {
for (uint32_t i = 0; i < primaryPassCI->subpassCount; ++i) {
- skip_call |= validateSubpassCompatibility(dev_data, primaryBuffer, primaryPassCI, secondaryBuffer, secondaryPassCI, i,
- primaryPassCI->subpassCount > 1);
+ skip |= validateSubpassCompatibility(dev_data, primaryBuffer, primaryPassCI, secondaryBuffer, secondaryPassCI, i,
+ primaryPassCI->subpassCount > 1);
}
}
- return skip_call;
+ return skip;
}
static bool validateFramebuffer(layer_data *dev_data, VkCommandBuffer primaryBuffer, const GLOBAL_CB_NODE *pCB,
VkCommandBuffer secondaryBuffer, const GLOBAL_CB_NODE *pSubCB) {
- bool skip_call = false;
+ bool skip = false;
if (!pSubCB->beginInfo.pInheritanceInfo) {
- return skip_call;
+ return skip;
}
VkFramebuffer primary_fb = pCB->activeFramebuffer;
VkFramebuffer secondary_fb = pSubCB->beginInfo.pInheritanceInfo->framebuffer;
if (secondary_fb != VK_NULL_HANDLE) {
if (primary_fb != secondary_fb) {
- skip_call |= log_msg(
- dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(primaryBuffer), __LINE__, VALIDATION_ERROR_02060, "DS",
- "vkCmdExecuteCommands() called w/ invalid secondary command buffer 0x%" PRIx64 " which has a framebuffer 0x%" PRIx64
- " that is not the same as the primary command buffer's current active framebuffer 0x%" PRIx64 ". %s",
- reinterpret_cast<uint64_t &>(secondaryBuffer), reinterpret_cast<uint64_t &>(secondary_fb),
- reinterpret_cast<uint64_t &>(primary_fb), validation_error_map[VALIDATION_ERROR_02060]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(primaryBuffer), __LINE__, VALIDATION_ERROR_02060, "DS",
+ "vkCmdExecuteCommands() called w/ invalid secondary command buffer 0x%" PRIx64
+ " which has a framebuffer 0x%" PRIx64
+ " that is not the same as the primary command buffer's current active framebuffer 0x%" PRIx64 ". %s",
+ reinterpret_cast<uint64_t &>(secondaryBuffer), reinterpret_cast<uint64_t &>(secondary_fb),
+ reinterpret_cast<uint64_t &>(primary_fb), validation_error_map[VALIDATION_ERROR_02060]);
}
auto fb = GetFramebufferState(dev_data, secondary_fb);
if (!fb) {
- skip_call |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(primaryBuffer), __LINE__, DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, "DS",
- "vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%p "
- "which has invalid framebuffer 0x%" PRIx64 ".",
- (void *)secondaryBuffer, (uint64_t)(secondary_fb));
- return skip_call;
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(primaryBuffer), __LINE__, DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, "DS",
+ "vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%p "
+ "which has invalid framebuffer 0x%" PRIx64 ".",
+ (void *)secondaryBuffer, (uint64_t)(secondary_fb));
+ return skip;
}
auto cb_renderpass = GetRenderPassState(dev_data, pSubCB->beginInfo.pInheritanceInfo->renderPass);
if (cb_renderpass->renderPass != fb->createInfo.renderPass) {
- skip_call |= validateRenderPassCompatibility(dev_data, secondaryBuffer, fb->renderPassCreateInfo.ptr(), secondaryBuffer,
- cb_renderpass->createInfo.ptr());
+ skip |= validateRenderPassCompatibility(dev_data, secondaryBuffer, fb->renderPassCreateInfo.ptr(), secondaryBuffer,
+ cb_renderpass->createInfo.ptr());
}
}
- return skip_call;
+ return skip;
}
static bool validateSecondaryCommandBufferState(layer_data *dev_data, GLOBAL_CB_NODE *pCB, GLOBAL_CB_NODE *pSubCB) {
- bool skip_call = false;
+ bool skip = false;
unordered_set<int> activeTypes;
for (auto queryObject : pCB->activeQueries) {
auto queryPoolData = dev_data->queryPoolMap.find(queryObject.pool);
@@ -9794,15 +9757,15 @@ static bool validateSecondaryCommandBufferState(layer_data *dev_data, GLOBAL_CB_
pSubCB->beginInfo.pInheritanceInfo) {
VkQueryPipelineStatisticFlags cmdBufStatistics = pSubCB->beginInfo.pInheritanceInfo->pipelineStatistics;
if ((cmdBufStatistics & queryPoolData->second.createInfo.pipelineStatistics) != cmdBufStatistics) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, VALIDATION_ERROR_02065, "DS",
- "vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%p "
- "which has invalid active query pool 0x%" PRIx64
- ". Pipeline statistics is being queried so the command "
- "buffer must have all bits set on the queryPool. %s",
- pCB->commandBuffer, reinterpret_cast<const uint64_t &>(queryPoolData->first),
- validation_error_map[VALIDATION_ERROR_02065]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast<uint64_t>(pCB->commandBuffer),
+ __LINE__, VALIDATION_ERROR_02065, "DS",
+ "vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%p "
+ "which has invalid active query pool 0x%" PRIx64
+ ". Pipeline statistics is being queried so the command "
+ "buffer must have all bits set on the queryPool. %s",
+ pCB->commandBuffer, reinterpret_cast<const uint64_t &>(queryPoolData->first),
+ validation_error_map[VALIDATION_ERROR_02065]);
}
}
activeTypes.insert(queryPoolData->second.createInfo.queryType);
@@ -9811,7 +9774,7 @@ static bool validateSecondaryCommandBufferState(layer_data *dev_data, GLOBAL_CB_
for (auto queryObject : pSubCB->startedQueries) {
auto queryPoolData = dev_data->queryPoolMap.find(queryObject.pool);
if (queryPoolData != dev_data->queryPoolMap.end() && activeTypes.count(queryPoolData->second.createInfo.queryType)) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, "DS",
"vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%p "
@@ -9826,7 +9789,7 @@ static bool validateSecondaryCommandBufferState(layer_data *dev_data, GLOBAL_CB_
auto primary_pool = GetCommandPoolNode(dev_data, pCB->createInfo.commandPool);
auto secondary_pool = GetCommandPoolNode(dev_data, pSubCB->createInfo.commandPool);
if (primary_pool && secondary_pool && (primary_pool->queueFamilyIndex != secondary_pool->queueFamilyIndex)) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
reinterpret_cast<uint64_t>(pSubCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_QUEUE_FAMILY, "DS",
"vkCmdExecuteCommands(): Primary command buffer 0x%p"
@@ -9834,12 +9797,12 @@ static bool validateSecondaryCommandBufferState(layer_data *dev_data, GLOBAL_CB_
pCB->commandBuffer, primary_pool->queueFamilyIndex, pSubCB->commandBuffer, secondary_pool->queueFamilyIndex);
}
- return skip_call;
+ return skip;
}
VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount,
const VkCommandBuffer *pCommandBuffers) {
- bool skip_call = false;
+ bool skip = false;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
@@ -9849,7 +9812,7 @@ VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uin
pSubCB = GetCBNode(dev_data, pCommandBuffers[i]);
assert(pSubCB);
if (VK_COMMAND_BUFFER_LEVEL_PRIMARY == pSubCB->createInfo.level) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
reinterpret_cast<uint64_t>(pCommandBuffers[i]), __LINE__, VALIDATION_ERROR_00156, "DS",
"vkCmdExecuteCommands() called w/ Primary Cmd Buffer 0x%p in element %u of pCommandBuffers "
@@ -9858,7 +9821,7 @@ VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uin
} else if (pCB->activeRenderPass) { // Secondary CB w/i RenderPass must have *CONTINUE_BIT set
auto secondary_rp_state = GetRenderPassState(dev_data, pSubCB->beginInfo.pInheritanceInfo->renderPass);
if (!(pSubCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT)) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
reinterpret_cast<uint64_t>(pCommandBuffers[i]), __LINE__, VALIDATION_ERROR_02057, "DS",
"vkCmdExecuteCommands(): Secondary Command Buffer (0x%p) executed within render pass (0x%" PRIxLEAST64
@@ -9868,19 +9831,18 @@ VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uin
} else {
// Make sure render pass is compatible with parent command buffer pass if has continue
if (pCB->activeRenderPass->renderPass != secondary_rp_state->renderPass) {
- skip_call |=
- validateRenderPassCompatibility(dev_data, commandBuffer, pCB->activeRenderPass->createInfo.ptr(),
- pCommandBuffers[i], secondary_rp_state->createInfo.ptr());
+ skip |= validateRenderPassCompatibility(dev_data, commandBuffer, pCB->activeRenderPass->createInfo.ptr(),
+ pCommandBuffers[i], secondary_rp_state->createInfo.ptr());
}
// If framebuffer for secondary CB is not NULL, then it must match active FB from primaryCB
- skip_call |= validateFramebuffer(dev_data, commandBuffer, pCB, pCommandBuffers[i], pSubCB);
+ skip |= validateFramebuffer(dev_data, commandBuffer, pCB, pCommandBuffers[i], pSubCB);
}
string errorString = "";
// secondaryCB must have been created w/ RP compatible w/ primaryCB active renderpass
if ((pCB->activeRenderPass->renderPass != secondary_rp_state->renderPass) &&
!verify_renderpass_compatibility(dev_data, pCB->activeRenderPass->createInfo.ptr(),
secondary_rp_state->createInfo.ptr(), errorString)) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
reinterpret_cast<uint64_t>(pCommandBuffers[i]), __LINE__, DRAWSTATE_RENDERPASS_INCOMPATIBLE, "DS",
"vkCmdExecuteCommands(): Secondary Command Buffer (0x%p) w/ render pass (0x%" PRIxLEAST64
@@ -9890,22 +9852,22 @@ VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uin
}
}
// TODO(mlentine): Move more logic into this method
- skip_call |= validateSecondaryCommandBufferState(dev_data, pCB, pSubCB);
- skip_call |= validateCommandBufferState(dev_data, pSubCB, "vkCmdExecuteCommands()", 0);
+ skip |= validateSecondaryCommandBufferState(dev_data, pCB, pSubCB);
+ skip |= validateCommandBufferState(dev_data, pSubCB, "vkCmdExecuteCommands()", 0);
// Secondary cmdBuffers are considered pending execution starting w/
// being recorded
if (!(pSubCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT)) {
if (dev_data->globalInFlightCmdBuffers.find(pSubCB->commandBuffer) != dev_data->globalInFlightCmdBuffers.end()) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(pCB->commandBuffer), __LINE__, VALIDATION_ERROR_00154, "DS",
- "Attempt to simultaneously execute command buffer 0x%p"
- " without VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT set! %s",
- pCB->commandBuffer, validation_error_map[VALIDATION_ERROR_00154]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast<uint64_t>(pCB->commandBuffer),
+ __LINE__, VALIDATION_ERROR_00154, "DS",
+ "Attempt to simultaneously execute command buffer 0x%p"
+ " without VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT set! %s",
+ pCB->commandBuffer, validation_error_map[VALIDATION_ERROR_00154]);
}
if (pCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT) {
// Warn that non-simultaneous secondary cmd buffer renders primary non-simultaneous
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
reinterpret_cast<uint64_t>(pCommandBuffers[i]), __LINE__, DRAWSTATE_INVALID_CB_SIMULTANEOUS_USE, "DS",
"vkCmdExecuteCommands(): Secondary Command Buffer (0x%p) "
@@ -9917,7 +9879,7 @@ VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uin
}
}
if (!pCB->activeQueries.empty() && !dev_data->enabled_features.inheritedQueries) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
reinterpret_cast<uint64_t>(pCommandBuffers[i]), __LINE__, VALIDATION_ERROR_02062, "DS",
"vkCmdExecuteCommands(): Secondary Command Buffer "
@@ -9937,22 +9899,21 @@ VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uin
pCB->queryUpdates.push_back(function);
}
}
- skip_call |= validatePrimaryCommandBuffer(dev_data, pCB, "vkCmdExecuteComands", VALIDATION_ERROR_00163);
- skip_call |=
- ValidateCmdQueueFlags(dev_data, pCB, "vkCmdExecuteComands()",
- VK_QUEUE_TRANSFER_BIT | VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, VALIDATION_ERROR_00162);
- skip_call |= ValidateCmd(dev_data, pCB, CMD_EXECUTECOMMANDS, "vkCmdExecuteComands()");
+ skip |= validatePrimaryCommandBuffer(dev_data, pCB, "vkCmdExecuteComands", VALIDATION_ERROR_00163);
+ skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdExecuteComands()",
+ VK_QUEUE_TRANSFER_BIT | VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, VALIDATION_ERROR_00162);
+ skip |= ValidateCmd(dev_data, pCB, CMD_EXECUTECOMMANDS, "vkCmdExecuteComands()");
UpdateCmdBufferLastCmd(pCB, CMD_EXECUTECOMMANDS);
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.CmdExecuteCommands(commandBuffer, commandBuffersCount, pCommandBuffers);
+ if (!skip) dev_data->dispatch_table.CmdExecuteCommands(commandBuffer, commandBuffersCount, pCommandBuffers);
}
VKAPI_ATTR VkResult VKAPI_CALL MapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags,
void **ppData) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
- bool skip_call = false;
+ bool skip = false;
VkResult result = VK_ERROR_VALIDATION_FAILED_EXT;
std::unique_lock<std::mutex> lock(global_lock);
DEVICE_MEM_INFO *mem_info = GetMemObjInfo(dev_data, mem);
@@ -9960,21 +9921,21 @@ VKAPI_ATTR VkResult VKAPI_CALL MapMemory(VkDevice device, VkDeviceMemory mem, Vk
// TODO : This could me more fine-grained to track just region that is valid
mem_info->global_valid = true;
auto end_offset = (VK_WHOLE_SIZE == size) ? mem_info->alloc_info.allocationSize - 1 : offset + size - 1;
- skip_call |= ValidateMapImageLayouts(dev_data, device, mem_info, offset, end_offset);
+ skip |= ValidateMapImageLayouts(dev_data, device, mem_info, offset, end_offset);
// TODO : Do we need to create new "bound_range" for the mapped range?
SetMemRangesValid(dev_data, mem_info, offset, end_offset);
if ((dev_data->phys_dev_mem_props.memoryTypes[mem_info->alloc_info.memoryTypeIndex].propertyFlags &
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0) {
- skip_call = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
- (uint64_t)mem, __LINE__, VALIDATION_ERROR_00629, "MEM",
- "Mapping Memory without VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set: mem obj 0x%" PRIxLEAST64 ". %s",
- (uint64_t)mem, validation_error_map[VALIDATION_ERROR_00629]);
+ skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT,
+ (uint64_t)mem, __LINE__, VALIDATION_ERROR_00629, "MEM",
+ "Mapping Memory without VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set: mem obj 0x%" PRIxLEAST64 ". %s",
+ (uint64_t)mem, validation_error_map[VALIDATION_ERROR_00629]);
}
}
- skip_call |= ValidateMapMemRange(dev_data, mem, offset, size);
+ skip |= ValidateMapMemRange(dev_data, mem, offset, size);
lock.unlock();
- if (!skip_call) {
+ if (!skip) {
result = dev_data->dispatch_table.MapMemory(device, mem, offset, size, flags, ppData);
if (VK_SUCCESS == result) {
lock.lock();
@@ -9989,12 +9950,12 @@ VKAPI_ATTR VkResult VKAPI_CALL MapMemory(VkDevice device, VkDeviceMemory mem, Vk
VKAPI_ATTR void VKAPI_CALL UnmapMemory(VkDevice device, VkDeviceMemory mem) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
- bool skip_call = false;
+ bool skip = false;
std::unique_lock<std::mutex> lock(global_lock);
- skip_call |= deleteMemRanges(dev_data, mem);
+ skip |= deleteMemRanges(dev_data, mem);
lock.unlock();
- if (!skip_call) {
+ if (!skip) {
dev_data->dispatch_table.UnmapMemory(device, mem);
}
}
@@ -10250,7 +10211,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory(VkDevice device, VkImage image, V
}
VKAPI_ATTR VkResult VKAPI_CALL SetEvent(VkDevice device, VkEvent event) {
- bool skip_call = false;
+ bool skip = false;
VkResult result = VK_ERROR_VALIDATION_FAILED_EXT;
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
@@ -10259,10 +10220,10 @@ VKAPI_ATTR VkResult VKAPI_CALL SetEvent(VkDevice device, VkEvent event) {
event_state->needsSignaled = false;
event_state->stageMask = VK_PIPELINE_STAGE_HOST_BIT;
if (event_state->write_in_use) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT,
- reinterpret_cast<const uint64_t &>(event), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
- "Cannot call vkSetEvent() on event 0x%" PRIxLEAST64 " that is already in use by a command buffer.",
- reinterpret_cast<const uint64_t &>(event));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT,
+ reinterpret_cast<const uint64_t &>(event), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
+ "Cannot call vkSetEvent() on event 0x%" PRIxLEAST64 " that is already in use by a command buffer.",
+ reinterpret_cast<const uint64_t &>(event));
}
}
lock.unlock();
@@ -10275,7 +10236,7 @@ VKAPI_ATTR VkResult VKAPI_CALL SetEvent(VkDevice device, VkEvent event) {
event_entry->second |= VK_PIPELINE_STAGE_HOST_BIT;
}
}
- if (!skip_call) result = dev_data->dispatch_table.SetEvent(device, event);
+ if (!skip) result = dev_data->dispatch_table.SetEvent(device, event);
return result;
}
@@ -10283,13 +10244,13 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse(VkQueue queue, uint32_t bindInfoC
VkFence fence) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
VkResult result = VK_ERROR_VALIDATION_FAILED_EXT;
- bool skip_call = false;
+ bool skip = false;
std::unique_lock<std::mutex> lock(global_lock);
auto pFence = GetFenceNode(dev_data, fence);
auto pQueue = GetQueueState(dev_data, queue);
// First verify that fence is not in use
- skip_call |= ValidateFenceForSubmit(dev_data, pFence);
+ skip |= ValidateFenceForSubmit(dev_data, pFence);
if (pFence) {
SubmitFence(pQueue, pFence, std::max(1u, bindInfoCount));
@@ -10303,7 +10264,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse(VkQueue queue, uint32_t bindInfoC
auto sparse_binding = bindInfo.pBufferBinds[j].pBinds[k];
if (SetSparseMemBinding(dev_data, {sparse_binding.memory, sparse_binding.memoryOffset, sparse_binding.size},
(uint64_t)bindInfo.pBufferBinds[j].buffer, kVulkanObjectTypeBuffer, "vkQueueBindSparse"))
- skip_call = true;
+ skip = true;
}
}
for (uint32_t j = 0; j < bindInfo.imageOpaqueBindCount; j++) {
@@ -10311,7 +10272,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse(VkQueue queue, uint32_t bindInfoC
auto sparse_binding = bindInfo.pImageOpaqueBinds[j].pBinds[k];
if (SetSparseMemBinding(dev_data, {sparse_binding.memory, sparse_binding.memoryOffset, sparse_binding.size},
(uint64_t)bindInfo.pImageOpaqueBinds[j].image, kVulkanObjectTypeImage, "vkQueueBindSparse"))
- skip_call = true;
+ skip = true;
}
}
for (uint32_t j = 0; j < bindInfo.imageBindCount; j++) {
@@ -10321,7 +10282,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse(VkQueue queue, uint32_t bindInfoC
VkDeviceSize size = sparse_binding.extent.depth * sparse_binding.extent.height * sparse_binding.extent.width * 4;
if (SetSparseMemBinding(dev_data, {sparse_binding.memory, sparse_binding.memoryOffset, size},
(uint64_t)bindInfo.pImageBinds[j].image, kVulkanObjectTypeImage, "vkQueueBindSparse"))
- skip_call = true;
+ skip = true;
}
}
@@ -10339,11 +10300,11 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse(VkQueue queue, uint32_t bindInfoC
pSemaphore->signaler.first = VK_NULL_HANDLE;
pSemaphore->signaled = false;
} else {
- skip_call |= log_msg(
- dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
- reinterpret_cast<const uint64_t &>(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
- "vkQueueBindSparse: Queue 0x%p is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.",
- queue, reinterpret_cast<const uint64_t &>(semaphore));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
+ reinterpret_cast<const uint64_t &>(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
+ "vkQueueBindSparse: Queue 0x%p is waiting on semaphore 0x%" PRIx64
+ " that has no way to be signaled.",
+ queue, reinterpret_cast<const uint64_t &>(semaphore));
}
}
}
@@ -10352,12 +10313,11 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse(VkQueue queue, uint32_t bindInfoC
auto pSemaphore = GetSemaphoreNode(dev_data, semaphore);
if (pSemaphore) {
if (pSemaphore->signaled) {
- skip_call =
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
- reinterpret_cast<const uint64_t &>(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
- "vkQueueBindSparse: Queue 0x%p is signaling semaphore 0x%" PRIx64
- ", but that semaphore is already signaled.",
- queue, reinterpret_cast<const uint64_t &>(semaphore));
+ skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
+ reinterpret_cast<const uint64_t &>(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
+ "vkQueueBindSparse: Queue 0x%p is signaling semaphore 0x%" PRIx64
+ ", but that semaphore is already signaled.",
+ queue, reinterpret_cast<const uint64_t &>(semaphore));
} else {
pSemaphore->signaler.first = queue;
pSemaphore->signaler.second = pQueue->seq + pQueue->submissions.size() + 1;
@@ -10380,7 +10340,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse(VkQueue queue, uint32_t bindInfoC
lock.unlock();
- if (!skip_call) return dev_data->dispatch_table.QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
+ if (!skip) return dev_data->dispatch_table.QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
return result;
}
@@ -10667,7 +10627,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSwapchainKHR(VkDevice device, const VkSwapc
VKAPI_ATTR void VKAPI_CALL DestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
- bool skip_call = false;
+ bool skip = false;
std::unique_lock<std::mutex> lock(global_lock);
auto swapchain_data = GetSwapchainNode(dev_data, swapchain);
@@ -10684,8 +10644,7 @@ VKAPI_ATTR void VKAPI_CALL DestroySwapchainKHR(VkDevice device, VkSwapchainKHR s
}
dev_data->imageSubresourceMap.erase(image_sub);
}
- skip_call =
- ClearMemoryObjectBindings(dev_data, (uint64_t)swapchain_image, kVulkanObjectTypeSwapchainKHR);
+ skip = ClearMemoryObjectBindings(dev_data, (uint64_t)swapchain_image, kVulkanObjectTypeSwapchainKHR);
dev_data->imageMap.erase(swapchain_image);
}
}
@@ -10699,7 +10658,7 @@ VKAPI_ATTR void VKAPI_CALL DestroySwapchainKHR(VkDevice device, VkSwapchainKHR s
dev_data->device_extensions.swapchainMap.erase(swapchain);
}
lock.unlock();
- if (!skip_call) dev_data->dispatch_table.DestroySwapchainKHR(device, swapchain, pAllocator);
+ if (!skip) dev_data->dispatch_table.DestroySwapchainKHR(device, swapchain, pAllocator);
}
VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pCount,
@@ -10760,7 +10719,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR(VkDevice device, VkSwapchai
VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
- bool skip_call = false;
+ bool skip = false;
std::lock_guard<std::mutex> lock(global_lock);
auto queue_state = GetQueueState(dev_data, queue);
@@ -10768,10 +10727,10 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf
for (uint32_t i = 0; i < pPresentInfo->waitSemaphoreCount; ++i) {
auto pSemaphore = GetSemaphoreNode(dev_data, pPresentInfo->pWaitSemaphores[i]);
if (pSemaphore && !pSemaphore->signaled) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0, __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS,
- "DS", "Queue 0x%p is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.", queue,
- reinterpret_cast<const uint64_t &>(pPresentInfo->pWaitSemaphores[i]));
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0,
+ __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS",
+ "Queue 0x%p is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.", queue,
+ reinterpret_cast<const uint64_t &>(pPresentInfo->pWaitSemaphores[i]));
}
}
@@ -10779,7 +10738,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf
auto swapchain_data = GetSwapchainNode(dev_data, pPresentInfo->pSwapchains[i]);
if (swapchain_data) {
if (pPresentInfo->pImageIndices[i] >= swapchain_data->images.size()) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__, DRAWSTATE_SWAPCHAIN_INVALID_IMAGE,
"DS", "vkQueuePresentKHR: Swapchain image index too large (%u). There are only %u images in this swapchain.",
@@ -10787,10 +10746,10 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf
} else {
auto image = swapchain_data->images[pPresentInfo->pImageIndices[i]];
auto image_state = GetImageState(dev_data, image);
- skip_call |= ValidateImageMemoryIsValid(dev_data, image_state, "vkQueuePresentKHR()");
+ skip |= ValidateImageMemoryIsValid(dev_data, image_state, "vkQueuePresentKHR()");
if (!image_state->acquired) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__,
DRAWSTATE_SWAPCHAIN_IMAGE_NOT_ACQUIRED, "DS",
@@ -10801,7 +10760,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf
if (FindLayouts(dev_data, image, layouts)) {
for (auto layout : layouts) {
if (layout != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT,
reinterpret_cast<uint64_t &>(queue), __LINE__, VALIDATION_ERROR_01964, "DS",
"Images passed to present must be in layout "
@@ -10820,14 +10779,14 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf
auto support_it = surface_state->gpu_queue_support.find({dev_data->physical_device, queue_state->queueFamilyIndex});
if (support_it == surface_state->gpu_queue_support.end()) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__,
DRAWSTATE_SWAPCHAIN_UNSUPPORTED_QUEUE, "DS",
"vkQueuePresentKHR: Presenting image without calling "
"vkGetPhysicalDeviceSurfaceSupportKHR");
} else if (!support_it->second) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__, VALIDATION_ERROR_01961, "DS",
"vkQueuePresentKHR: Presenting image on queue that cannot "
@@ -10855,27 +10814,29 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf
VkRectLayerKHR rect = region.pRectangles[j];
// TODO: Need to update these errors to their unique error ids when available
if ((rect.offset.x + rect.extent.width) > swapchain_data->createInfo.imageExtent.width) {
- skip_call |= log_msg(
- dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
- reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__,
- DRAWSTATE_SWAPCHAIN_INVALID_IMAGE, "DS", "vkQueuePresentKHR(): For VkPresentRegionKHR down pNext "
- "chain, pRegion[%i].pRectangles[%i], the sum of offset.x "
- "(%i) and extent.width (%i) is greater than the "
- "corresponding swapchain's imageExtent.width (%i).",
- i, j, rect.offset.x, rect.extent.width, swapchain_data->createInfo.imageExtent.width);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
+ reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__,
+ DRAWSTATE_SWAPCHAIN_INVALID_IMAGE, "DS",
+ "vkQueuePresentKHR(): For VkPresentRegionKHR down pNext "
+ "chain, pRegion[%i].pRectangles[%i], the sum of offset.x "
+ "(%i) and extent.width (%i) is greater than the "
+ "corresponding swapchain's imageExtent.width (%i).",
+ i, j, rect.offset.x, rect.extent.width, swapchain_data->createInfo.imageExtent.width);
}
if ((rect.offset.y + rect.extent.height) > swapchain_data->createInfo.imageExtent.height) {
- skip_call |= log_msg(
- dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
- reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__,
- DRAWSTATE_SWAPCHAIN_INVALID_IMAGE, "DS", "vkQueuePresentKHR(): For VkPresentRegionKHR down pNext "
- "chain, pRegion[%i].pRectangles[%i], the sum of offset.y "
- "(%i) and extent.height (%i) is greater than the "
- "corresponding swapchain's imageExtent.height (%i).",
- i, j, rect.offset.y, rect.extent.height, swapchain_data->createInfo.imageExtent.height);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
+ reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__,
+ DRAWSTATE_SWAPCHAIN_INVALID_IMAGE, "DS",
+ "vkQueuePresentKHR(): For VkPresentRegionKHR down pNext "
+ "chain, pRegion[%i].pRectangles[%i], the sum of offset.y "
+ "(%i) and extent.height (%i) is greater than the "
+ "corresponding swapchain's imageExtent.height (%i).",
+ i, j, rect.offset.y, rect.extent.height, swapchain_data->createInfo.imageExtent.height);
}
if (rect.layer > swapchain_data->createInfo.imageArrayLayers) {
- skip_call |= log_msg(
+ skip |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__,
DRAWSTATE_SWAPCHAIN_INVALID_IMAGE, "DS",
@@ -10890,7 +10851,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf
}
}
- if (skip_call) {
+ if (skip) {
return VK_ERROR_VALIDATION_FAILED_EXT;
}
@@ -10999,37 +10960,37 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSharedSwapchainsKHR(VkDevice device, uint32
VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout,
VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) {
layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
- bool skip_call = false;
+ bool skip = false;
std::unique_lock<std::mutex> lock(global_lock);
if (fence == VK_NULL_HANDLE && semaphore == VK_NULL_HANDLE) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
- reinterpret_cast<uint64_t &>(device), __LINE__, DRAWSTATE_SWAPCHAIN_NO_SYNC_FOR_ACQUIRE, "DS",
- "vkAcquireNextImageKHR: Semaphore and fence cannot both be VK_NULL_HANDLE. There would be no way "
- "to determine the completion of this operation.");
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
+ reinterpret_cast<uint64_t &>(device), __LINE__, DRAWSTATE_SWAPCHAIN_NO_SYNC_FOR_ACQUIRE, "DS",
+ "vkAcquireNextImageKHR: Semaphore and fence cannot both be VK_NULL_HANDLE. There would be no way "
+ "to determine the completion of this operation.");
}
auto pSemaphore = GetSemaphoreNode(dev_data, semaphore);
if (pSemaphore && pSemaphore->signaled) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
- reinterpret_cast<const uint64_t &>(semaphore), __LINE__, VALIDATION_ERROR_01952, "DS",
- "vkAcquireNextImageKHR: Semaphore must not be currently signaled or in a wait state. %s",
- validation_error_map[VALIDATION_ERROR_01952]);
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
+ reinterpret_cast<const uint64_t &>(semaphore), __LINE__, VALIDATION_ERROR_01952, "DS",
+ "vkAcquireNextImageKHR: Semaphore must not be currently signaled or in a wait state. %s",
+ validation_error_map[VALIDATION_ERROR_01952]);
}
auto pFence = GetFenceNode(dev_data, fence);
if (pFence) {
- skip_call |= ValidateFenceForSubmit(dev_data, pFence);
+ skip |= ValidateFenceForSubmit(dev_data, pFence);
}
auto swapchain_data = GetSwapchainNode(dev_data, swapchain);
if (swapchain_data->replaced) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
- reinterpret_cast<uint64_t &>(swapchain), __LINE__, DRAWSTATE_SWAPCHAIN_REPLACED, "DS",
- "vkAcquireNextImageKHR: This swapchain has been replaced. The application can still "
- "present any images it has acquired, but cannot acquire any more.");
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
+ reinterpret_cast<uint64_t &>(swapchain), __LINE__, DRAWSTATE_SWAPCHAIN_REPLACED, "DS",
+ "vkAcquireNextImageKHR: This swapchain has been replaced. The application can still "
+ "present any images it has acquired, but cannot acquire any more.");
}
auto physical_device_state = GetPhysicalDeviceState(dev_data->instance_data, dev_data->physical_device);
@@ -11037,7 +10998,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(VkDevice device, VkSwapchainK
uint64_t acquired_images = std::count_if(swapchain_data->images.begin(), swapchain_data->images.end(),
[=](VkImage image) { return GetImageState(dev_data, image)->acquired; });
if (acquired_images > swapchain_data->images.size() - physical_device_state->surfaceCapabilities.minImageCount) {
- skip_call |=
+ skip |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
reinterpret_cast<uint64_t const &>(swapchain), __LINE__, DRAWSTATE_SWAPCHAIN_TOO_MANY_IMAGES, "DS",
"vkAcquireNextImageKHR: Application has already acquired the maximum number of images (0x%" PRIxLEAST64 ")",
@@ -11046,15 +11007,15 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(VkDevice device, VkSwapchainK
}
if (swapchain_data->images.size() == 0) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
- reinterpret_cast<uint64_t const &>(swapchain), __LINE__, DRAWSTATE_SWAPCHAIN_IMAGES_NOT_FOUND, "DS",
- "vkAcquireNextImageKHR: No images found to acquire from. Application probably did not call "
- "vkGetSwapchainImagesKHR after swapchain creation.");
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
+ reinterpret_cast<uint64_t const &>(swapchain), __LINE__, DRAWSTATE_SWAPCHAIN_IMAGES_NOT_FOUND, "DS",
+ "vkAcquireNextImageKHR: No images found to acquire from. Application probably did not call "
+ "vkGetSwapchainImagesKHR after swapchain creation.");
}
lock.unlock();
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
VkResult result = dev_data->dispatch_table.AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex);
@@ -11083,7 +11044,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(VkDevice device, VkSwapchainK
VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount,
VkPhysicalDevice *pPhysicalDevices) {
- bool skip_call = false;
+ bool skip = false;
instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map);
assert(instance_data);
@@ -11094,22 +11055,22 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uin
if (UNCALLED == instance_data->vkEnumeratePhysicalDevicesState) {
// Flag warning here. You can call this without having queried the count, but it may not be
// robust on platforms with multiple physical devices.
- skip_call |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, 0, __LINE__, DEVLIMITS_MISSING_QUERY_COUNT, "DL",
- "Call sequence has vkEnumeratePhysicalDevices() w/ non-NULL pPhysicalDevices. You should first "
- "call vkEnumeratePhysicalDevices() w/ NULL pPhysicalDevices to query pPhysicalDeviceCount.");
+ skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT,
+ 0, __LINE__, DEVLIMITS_MISSING_QUERY_COUNT, "DL",
+ "Call sequence has vkEnumeratePhysicalDevices() w/ non-NULL pPhysicalDevices. You should first "
+ "call vkEnumeratePhysicalDevices() w/ NULL pPhysicalDevices to query pPhysicalDeviceCount.");
} // TODO : Could also flag a warning if re-calling this function in QUERY_DETAILS state
else if (instance_data->physical_devices_count != *pPhysicalDeviceCount) {
// Having actual count match count from app is not a requirement, so this can be a warning
- skip_call |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL",
- "Call to vkEnumeratePhysicalDevices() w/ pPhysicalDeviceCount value %u, but actual count "
- "supported by this instance is %u.",
- *pPhysicalDeviceCount, instance_data->physical_devices_count);
+ skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL",
+ "Call to vkEnumeratePhysicalDevices() w/ pPhysicalDeviceCount value %u, but actual count "
+ "supported by this instance is %u.",
+ *pPhysicalDeviceCount, instance_data->physical_devices_count);
}
instance_data->vkEnumeratePhysicalDevicesState = QUERY_DETAILS;
}
- if (skip_call) {
+ if (skip) {
return VK_ERROR_VALIDATION_FAILED_EXT;
}
VkResult result = instance_data->dispatch_table.EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices);
@@ -11259,7 +11220,7 @@ static VkResult CreateSurface(VkInstance instance, TCreateInfo const *pCreateInf
}
VKAPI_ATTR void VKAPI_CALL DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator) {
- bool skip_call = false;
+ bool skip = false;
instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
auto surface_state = GetSurfaceState(instance_data, surface);
@@ -11270,7 +11231,7 @@ VKAPI_ATTR void VKAPI_CALL DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR s
}
lock.unlock();
- if (!skip_call) {
+ if (!skip) {
// Call down the call chain:
instance_data->dispatch_table.DestroySurfaceKHR(instance, surface, pAllocator);
}
@@ -11362,7 +11323,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevi
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
uint32_t *pPresentModeCount,
VkPresentModeKHR *pPresentModes) {
- bool skip_call = false;
+ bool skip = false;
auto instance_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
// TODO: this isn't quite right. available modes may differ by surface AND physical device.
@@ -11374,7 +11335,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModesKHR(VkPhysica
auto prev_mode_count = (uint32_t)physical_device_state->present_modes.size();
switch (call_state) {
case UNCALLED:
- skip_call |= log_msg(
+ skip |= log_msg(
instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
reinterpret_cast<uint64_t>(physicalDevice), __LINE__, DEVLIMITS_MUST_QUERY_COUNT, "DL",
"vkGetPhysicalDeviceSurfacePresentModesKHR() called with non-NULL pPresentModeCount; but no prior positive "
@@ -11383,20 +11344,20 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModesKHR(VkPhysica
default:
// both query count and query details
if (*pPresentModeCount != prev_mode_count) {
- skip_call |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
- reinterpret_cast<uint64_t>(physicalDevice), __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL",
- "vkGetPhysicalDeviceSurfacePresentModesKHR() called with *pPresentModeCount (%u) that "
- "differs from the value "
- "(%u) that was returned when pPresentModes was NULL.",
- *pPresentModeCount, prev_mode_count);
+ skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, reinterpret_cast<uint64_t>(physicalDevice),
+ __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL",
+ "vkGetPhysicalDeviceSurfacePresentModesKHR() called with *pPresentModeCount (%u) that "
+ "differs from the value "
+ "(%u) that was returned when pPresentModes was NULL.",
+ *pPresentModeCount, prev_mode_count);
}
break;
}
}
lock.unlock();
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
auto result = instance_data->dispatch_table.GetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount,
pPresentModes);
@@ -11423,7 +11384,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModesKHR(VkPhysica
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
uint32_t *pSurfaceFormatCount,
VkSurfaceFormatKHR *pSurfaceFormats) {
- bool skip_call = false;
+ bool skip = false;
auto instance_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
auto physical_device_state = GetPhysicalDeviceState(instance_data, physicalDevice);
@@ -11437,7 +11398,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevi
// Since we haven't recorded a preliminary value of *pSurfaceFormatCount, that likely means that the application
// didn't
// previously call this function with a NULL value of pSurfaceFormats:
- skip_call |= log_msg(
+ skip |= log_msg(
instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
reinterpret_cast<uint64_t>(physicalDevice), __LINE__, DEVLIMITS_MUST_QUERY_COUNT, "DL",
"vkGetPhysicalDeviceSurfaceFormatsKHR() called with non-NULL pSurfaceFormatCount; but no prior positive "
@@ -11445,7 +11406,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevi
break;
default:
if (prev_format_count != *pSurfaceFormatCount) {
- skip_call |= log_msg(
+ skip |= log_msg(
instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, reinterpret_cast<uint64_t>(physicalDevice), __LINE__,
DEVLIMITS_COUNT_MISMATCH, "DL",
@@ -11460,7 +11421,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevi
}
lock.unlock();
- if (skip_call) return VK_ERROR_VALIDATION_FAILED_EXT;
+ if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
// Call down the call chain:
auto result = instance_data->dispatch_table.GetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount,
@@ -11541,7 +11502,7 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceExtensionProperties(VkPhysicalDevi
VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX(
VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) {
- bool skip_call = false;
+ bool skip = false;
instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map);
if (instance_data) {
@@ -11552,25 +11513,25 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX(
if (UNCALLED == instance_data->vkEnumeratePhysicalDeviceGroupsState) {
// Flag warning here. You can call this without having queried the count, but it may not be
// robust on platforms with multiple physical devices.
- skip_call |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, 0, __LINE__, DEVLIMITS_MISSING_QUERY_COUNT, "DL",
- "Call sequence has vkEnumeratePhysicalDeviceGroupsKHX() w/ non-NULL "
- "pPhysicalDeviceGroupProperties. You should first "
- "call vkEnumeratePhysicalDeviceGroupsKHX() w/ NULL pPhysicalDeviceGroupProperties to query "
- "pPhysicalDeviceGroupCount.");
+ skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, 0, __LINE__, DEVLIMITS_MISSING_QUERY_COUNT, "DL",
+ "Call sequence has vkEnumeratePhysicalDeviceGroupsKHX() w/ non-NULL "
+ "pPhysicalDeviceGroupProperties. You should first "
+ "call vkEnumeratePhysicalDeviceGroupsKHX() w/ NULL pPhysicalDeviceGroupProperties to query "
+ "pPhysicalDeviceGroupCount.");
} // TODO : Could also flag a warning if re-calling this function in QUERY_DETAILS state
else if (instance_data->physical_device_groups_count != *pPhysicalDeviceGroupCount) {
// Having actual count match count from app is not a requirement, so this can be a warning
- skip_call |=
+ skip |=
log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
- VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL",
- "Call to vkEnumeratePhysicalDeviceGroupsKHX() w/ pPhysicalDeviceGroupCount value %u, but actual count "
- "supported by this instance is %u.",
- *pPhysicalDeviceGroupCount, instance_data->physical_device_groups_count);
+ VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL",
+ "Call to vkEnumeratePhysicalDeviceGroupsKHX() w/ pPhysicalDeviceGroupCount value %u, but actual count "
+ "supported by this instance is %u.",
+ *pPhysicalDeviceGroupCount, instance_data->physical_device_groups_count);
}
instance_data->vkEnumeratePhysicalDeviceGroupsState = QUERY_DETAILS;
}
- if (skip_call) {
+ if (skip) {
return VK_ERROR_VALIDATION_FAILED_EXT;
}
VkResult result = instance_data->dispatch_table.EnumeratePhysicalDeviceGroupsKHX(instance, pPhysicalDeviceGroupCount,