aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-11-09 16:43:06 -0700
committerMark Lobodzinski <mark@lunarg.com>2017-11-21 15:24:46 -0700
commit290188fa0b77a51ea369f26666314fb07a376a33 (patch)
treec798e90d91d7fae992216a05912ff7e8f5abc90d /layers/core_validation.cpp
parentc81f6e170d5a7d39ea1bc633f0e6ba7ac6fcf0fd (diff)
downloadusermoji-290188fa0b77a51ea369f26666314fb07a376a33.tar.xz
layers: Add GetQueryPoolResults validation check
Added check for a pool of queryType TIMESTAMP having the RESULT PARTIAL bit set and updated the error database. Change-Id: I139733202c085a7d64d7359f659714b75a46ebf1
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index c8eaf05d..0070bcfa 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -3390,6 +3390,19 @@ VKAPI_ATTR void VKAPI_CALL DestroyQueryPool(VkDevice device, VkQueryPool queryPo
static bool PreCallValidateGetQueryPoolResults(layer_data *dev_data, VkQueryPool query_pool, uint32_t first_query,
uint32_t query_count, VkQueryResultFlags flags,
unordered_map<QueryObject, vector<VkCommandBuffer>> *queries_in_flight) {
+ bool skip = false;
+ auto query_pool_state = dev_data->queryPoolMap.find(query_pool);
+ if (query_pool_state != dev_data->queryPoolMap.end()) {
+ if ((query_pool_state->second.createInfo.queryType == VK_QUERY_TYPE_TIMESTAMP) && (flags & VK_QUERY_RESULT_PARTIAL_BIT)) {
+ skip |= log_msg(
+ dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, __LINE__,
+ VALIDATION_ERROR_2fa00664, "DS",
+ "QueryPool 0x%" PRIx64
+ " was created with a queryType of VK_QUERY_TYPE_TIMESTAMP but flags contains VK_QUERY_RESULT_PARTIAL_BIT. %s",
+ HandleToUint64(query_pool), validation_error_map[VALIDATION_ERROR_2fa00664]);
+ }
+ }
+
// TODO: clean this up, it's insanely wasteful.
for (auto cmd_buffer : dev_data->commandBufferMap) {
if (cmd_buffer.second->in_use.load()) {
@@ -3400,7 +3413,6 @@ static bool PreCallValidateGetQueryPoolResults(layer_data *dev_data, VkQueryPool
}
if (dev_data->instance_data->disabled.get_query_pool_results) return false;
- bool skip = false;
for (uint32_t i = 0; i < query_count; ++i) {
QueryObject query = {query_pool, first_query + i};
auto qif_pair = queries_in_flight->find(query);