aboutsummaryrefslogtreecommitdiff
path: root/layers/device_limits.cpp
diff options
context:
space:
mode:
authorMichael Lentine <mlentine@google.com>2016-01-28 15:03:46 -0600
committerTobin Ehlis <tobine@google.com>2016-02-03 15:51:51 -0700
commit5bc5421fb655a38afff00939afcdc1f2482f14b2 (patch)
treea4db5dc8f4006c85d2b52696b225f8d35b948510 /layers/device_limits.cpp
parent52ef57d311940634489550540a7c19bf7c952958 (diff)
downloadusermoji-5bc5421fb655a38afff00939afcdc1f2482f14b2.tar.xz
layers: Check that queryFlags is valid if enabled.
Diffstat (limited to 'layers/device_limits.cpp')
-rw-r--r--layers/device_limits.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/layers/device_limits.cpp b/layers/device_limits.cpp
index 54d01769..5a7111c6 100644
--- a/layers/device_limits.cpp
+++ b/layers/device_limits.cpp
@@ -51,6 +51,7 @@
#include "vulkan/vk_layer.h"
#include "vk_layer_config.h"
#include "vulkan/vk_debug_marker_layer.h"
+#include "vk_enum_validate_helper.h"
#include "vk_layer_table.h"
#include "vk_layer_debug_marker_table.h"
#include "vk_layer_data.h"
@@ -550,6 +551,13 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuf
DEVLIMITS_INVALID_INHERITED_QUERY, "DL",
"Cannot set inherited occlusionQueryEnable in vkBeginCommandBuffer() when device does not support inheritedQueries.");
}
+ if (dev_data->actualPhysicalDeviceFeatures.inheritedQueries != VK_FALSE && pInfo && pInfo->occlusionQueryEnable != VK_FALSE &&
+ !validate_VkQueryControlFlagBits(VkQueryControlFlagBits(pInfo->queryFlags))) {
+ skipCall |= 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__,
+ DEVLIMITS_INVALID_INHERITED_QUERY, "DL",
+ "Cannot enable in occlusion queries in vkBeginCommandBuffer() and set queryFlags to %d which is not a valid combination of VkQueryControlFlagBits.",
+ pInfo->queryFlags);
+ }
if (!skipCall)
dev_data->device_dispatch_table->BeginCommandBuffer(commandBuffer, pBeginInfo);
}