aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-11-21 12:30:06 -0700
committerTobin Ehlis <tobine@google.com>2016-11-21 16:14:00 -0700
commit0c68172df9bcbfe8234e8d1624adb153dcf8f884 (patch)
tree9421d70d69215cacea7cade79f9bc8ad3b849f2e /layers/core_validation.cpp
parenta2b8aae9a8d4a37e06cfe1d3db23ed91691e0758 (diff)
downloadusermoji-0c68172df9bcbfe8234e8d1624adb153dcf8f884.tar.xz
layers:Verify pipe stats are enabled for device
From Riku Salminen At vkCreateQueryPool() time, make sure that if PIPELINE_STATISTICS are requested, then the device must have pipelineStatisticsQuery enabled.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 30c08312..a8a0a854 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -6254,7 +6254,21 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateQueryPool(VkDevice device, const VkQueryPoo
const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool) {
layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
- VkResult result = dev_data->dispatch_table.CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
+ bool skip = false;
+ if (pCreateInfo && pCreateInfo->queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS) {
+ if (!dev_data->enabled_features.pipelineStatisticsQuery) {
+ 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_01006, "DS",
+ "Query pool with type VK_QUERY_TYPE_PIPELINE_STATISTICS created on a device "
+ "with VkDeviceCreateInfo.pEnabledFeatures.pipelineStatisticsQuery == VK_FALSE. %s",
+ validation_error_map[VALIDATION_ERROR_01006]);
+ }
+ }
+
+ VkResult result = VK_ERROR_VALIDATION_FAILED_EXT;
+ if (!skip) {
+ result = dev_data->dispatch_table.CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
+ }
if (result == VK_SUCCESS) {
std::lock_guard<std::mutex> lock(global_lock);
QUERY_POOL_NODE *qp_node = &dev_data->queryPoolMap[*pQueryPool];