From 5eab5d62530f351307a01ca57af964e5c506079c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 21 May 2021 19:05:19 +0200 Subject: [PATCH] rhi: vk: Switch to the modern validation layer internally Task-number: QTBUG-88388 Change-Id: Ia30af6c4554594f094af7866ad6e10ed7929de27 Reviewed-by: Andy Nichols --- src/gui/rhi/qrhivulkan.cpp | 17 +++-------------- tests/auto/gui/rhi/qrhi/tst_qrhi.cpp | 12 +----------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp index 73288cb4a1..fa1bf9160c 100644 --- a/src/gui/rhi/qrhivulkan.cpp +++ b/src/gui/rhi/qrhivulkan.cpp @@ -104,18 +104,7 @@ QT_BEGIN_NAMESPACE ... QVulkanInstance inst; - #ifndef Q_OS_ANDROID - inst.setLayers(QByteArrayList() << "VK_LAYER_LUNARG_standard_validation"); - #else - inst.setLayers(QByteArrayList() - << "VK_LAYER_GOOGLE_threading" - << "VK_LAYER_LUNARG_parameter_validation" - << "VK_LAYER_LUNARG_object_tracker" - << "VK_LAYER_LUNARG_core_validation" - << "VK_LAYER_LUNARG_image" - << "VK_LAYER_LUNARG_swapchain" - << "VK_LAYER_GOOGLE_unique_objects"); - #endif + inst.setLayers({ "VK_LAYER_KHRONOS_validation" }); // for debugging only, not for release builds inst.setExtensions(QRhiVulkanInitParams::preferredInstanceExtensions()); if (!inst.create()) qFatal("Vulkan not available"); @@ -549,8 +538,8 @@ bool QRhiVulkan::create(QRhi::Flags flags) queueInfo[0].pQueuePriorities = prio; QList devLayers; - if (inst->layers().contains("VK_LAYER_LUNARG_standard_validation")) - devLayers.append("VK_LAYER_LUNARG_standard_validation"); + if (inst->layers().contains("VK_LAYER_KHRONOS_validation")) + devLayers.append("VK_LAYER_KHRONOS_validation"); QVulkanInfoVector devExts; uint32_t devExtCount = 0; diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp index 18eebaae1e..bdcbc587fc 100644 --- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp +++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp @@ -169,17 +169,7 @@ void tst_QRhi::initTestCase() #endif #ifdef TST_VK -#ifndef Q_OS_ANDROID - vulkanInstance.setLayers({ QByteArrayLiteral("VK_LAYER_LUNARG_standard_validation") }); -#else - vulkanInstance.setLayers({ QByteArrayLiteral("VK_LAYER_GOOGLE_threading"), - QByteArrayLiteral("VK_LAYER_LUNARG_parameter_validation"), - QByteArrayLiteral("VK_LAYER_LUNARG_object_tracker"), - QByteArrayLiteral("VK_LAYER_LUNARG_core_validation"), - QByteArrayLiteral("VK_LAYER_LUNARG_image"), - QByteArrayLiteral("VK_LAYER_LUNARG_swapchain"), - QByteArrayLiteral("VK_LAYER_GOOGLE_unique_objects") }); -#endif + vulkanInstance.setLayers({ "VK_LAYER_KHRONOS_validation" }); vulkanInstance.setExtensions(QRhiVulkanInitParams::preferredInstanceExtensions()); vulkanInstance.create(); initParams.vk.inst = &vulkanInstance;