diff options
| author | Michael Lentine <mlentine@google.com> | 2016-02-09 10:31:11 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-02-10 09:19:29 -0700 |
| commit | 9a4da5af0a10e101d61d134f078a62c8b58dc382 (patch) | |
| tree | 435dc2270a491abca4e954fd3d5fb212b2d01dda | |
| parent | eba876d78708b086fc48abd38cd4e638e282b853 (diff) | |
| download | usermoji-9a4da5af0a10e101d61d134f078a62c8b58dc382.tar.xz | |
layers: Validate no active queries unless enabled.
| -rw-r--r-- | layers/draw_state.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index bac580cb..bb6d4ad7 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -3148,6 +3148,14 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice g my_instance_data->instance_dispatch_table->GetPhysicalDeviceQueueFamilyProperties(gpu, &count, nullptr); my_device_data->physDevProperties.queue_family_properties.resize(count); my_instance_data->instance_dispatch_table->GetPhysicalDeviceQueueFamilyProperties(gpu, &count, &my_device_data->physDevProperties.queue_family_properties[0]); + // TODO: device limits should make sure these are compatible + if (pCreateInfo->pEnabledFeatures) { + my_device_data->physDevProperties.features = + *pCreateInfo->pEnabledFeatures; + } else { + my_instance_data->instance_dispatch_table->GetPhysicalDeviceFeatures( + gpu, &my_device_data->physDevProperties.features); + } loader_platform_thread_unlock_mutex(&globalLock); return result; } @@ -6624,6 +6632,19 @@ VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer pCB->beginInfo.flags &= ~VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT; } } + if (!pCB->activeQueries.empty() && + !dev_data->physDevProperties.features.inheritedQueries) { + 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>(pCommandBuffers[i]), __LINE__, + DRAWSTATE_INVALID_COMMAND_BUFFER, "DS", + "vkCmdExecuteCommands(): Secondary Command Buffer " + "(%#" PRIxLEAST64 ") cannot be submitted with a query in " + "flight and inherited queries not " + "supported on this device.", + reinterpret_cast<uint64_t>(pCommandBuffers[i])); + } pSubCB->primaryCommandBuffer = pCB->commandBuffer; pCB->secondaryCommandBuffers.insert(pSubCB->commandBuffer); dev_data->globalInFlightCmdBuffers.insert(pSubCB->commandBuffer); |
