Check for VK_EXT_debug_marker being present and enable it if so
This commit is contained in:
parent
6362d7c216
commit
d223dfa72b
2 changed files with 13 additions and 0 deletions
|
|
@ -61,6 +61,13 @@ VkResult VulkanExampleBase::createDevice(VkDeviceQueueCreateInfo requestedQueues
|
|||
deviceCreateInfo.pQueueCreateInfos = &requestedQueues;
|
||||
deviceCreateInfo.pEnabledFeatures = NULL;
|
||||
|
||||
// enable the debug marker extension if it is present (likely meaning a debugging tool is present)
|
||||
if (vkTools::checkDeviceExtensionPresent(physicalDevice, VK_EXT_DEBUG_MARKER_EXTENSION_NAME))
|
||||
{
|
||||
enabledExtensions.push_back(VK_EXT_DEBUG_MARKER_EXTENSION_NAME);
|
||||
enableDebugMarkers = true;
|
||||
}
|
||||
|
||||
if (enabledExtensions.size() > 0)
|
||||
{
|
||||
deviceCreateInfo.enabledExtensionCount = (uint32_t)enabledExtensions.size();
|
||||
|
|
@ -249,6 +256,10 @@ void VulkanExampleBase::prepare()
|
|||
{
|
||||
vkDebug::setupDebugging(instance, VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT, NULL);
|
||||
}
|
||||
if (enableDebugMarkers)
|
||||
{
|
||||
vkDebug::setupDebugMarkers(device);
|
||||
}
|
||||
createCommandPool();
|
||||
createSetupCommandBuffer();
|
||||
setupSwapChain();
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ class VulkanExampleBase
|
|||
private:
|
||||
// Set to true when example is created with enabled validation layers
|
||||
bool enableValidation = false;
|
||||
// Set to true when the debug marker extension is detected
|
||||
bool enableDebugMarkers = false;
|
||||
// fps timer (one second interval)
|
||||
float fpsTimer = 0.0f;
|
||||
// Create application wide Vulkan instance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue