Skip to content

Commit

Permalink
bp: Fixe false positive for vkCmdBeginQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-lunarg committed Jul 9, 2024
1 parent d03e2bc commit e220d13
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion layers/best_practices/bp_cmd_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,14 @@ bool BestPractices::PreCallValidateGetQueryPoolResults(VkDevice device, VkQueryP
ASSERT_AND_RETURN_SKIP(query_pool_state);

for (uint32_t i = firstQuery; i < firstQuery + queryCount; ++i) {
if (query_pool_state->GetQueryState(i, 0u) == QUERYSTATE_RESET) {
// Some query type can't have a begin call on it (see VUID-vkCmdBeginQuery-queryType-02804)
const bool can_have_begin =
!IsValueIn(query_pool_state->create_info.queryType,
{VK_QUERY_TYPE_TIMESTAMP, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR,
VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR,
VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR,
VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV});
if (can_have_begin && query_pool_state->GetQueryState(i, 0u) == QUERYSTATE_RESET) {
const LogObjectList objlist(queryPool);
skip |= LogWarning("BestPractices-QueryPool-Unavailable", objlist, error_obj.location,
"QueryPool %s and query %" PRIu32 ": vkCmdBeginQuery() was never called.",
Expand Down

0 comments on commit e220d13

Please sign in to comment.