summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-01-15 18:06:10 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2021-01-18 13:21:15 +0100
commit9f7088fd7f0aac84b565f8a9494bf9de4bab85ea (patch)
tree79cb892bb96dfe97479206e731fc42f019c68b3a /tests
parent036021b0d0ee03c095a26200cf8c8b478c37eae1 (diff)
rhi: Stop hardcoding the Vulkan backend's desired instance extensions
Instead, have a static function in QRhiVulkanInitParams then Qt Quick and anyone else who creates a QVulkanInstance that is then used in combination with QRhi can query. Change-Id: I046e0d84541fc00f5487a7527c97be262221527f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/rhi/qrhi/tst_qrhi.cpp3
-rw-r--r--tests/manual/rhi/hellominimalcrossgfxtriangle/main.cpp2
-rw-r--r--tests/manual/rhi/shared/examplefw.h3
3 files changed, 3 insertions, 5 deletions
diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
index db83f7955f..1b473ed023 100644
--- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
+++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
@@ -165,8 +165,7 @@ void tst_QRhi::initTestCase()
QByteArrayLiteral("VK_LAYER_LUNARG_swapchain"),
QByteArrayLiteral("VK_LAYER_GOOGLE_unique_objects") });
#endif
- vulkanInstance.setExtensions(QByteArrayList()
- << "VK_KHR_get_physical_device_properties2");
+ vulkanInstance.setExtensions(QRhiVulkanInitParams::preferredInstanceExtensions());
vulkanInstance.create();
initParams.vk.inst = &vulkanInstance;
#endif
diff --git a/tests/manual/rhi/hellominimalcrossgfxtriangle/main.cpp b/tests/manual/rhi/hellominimalcrossgfxtriangle/main.cpp
index 8e04e8303d..a8e1556057 100644
--- a/tests/manual/rhi/hellominimalcrossgfxtriangle/main.cpp
+++ b/tests/manual/rhi/hellominimalcrossgfxtriangle/main.cpp
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
"VK_LAYER_LUNARG_swapchain",
"VK_LAYER_GOOGLE_unique_objects"});
#endif
- inst.setExtensions({ "VK_KHR_get_physical_device_properties2" });
+ inst.setExtensions(QRhiVulkanInitParams::preferredInstanceExtensions());
if (!inst.create()) {
qWarning("Failed to create Vulkan instance, switching to OpenGL");
graphicsApi = QRhi::OpenGLES2;
diff --git a/tests/manual/rhi/shared/examplefw.h b/tests/manual/rhi/shared/examplefw.h
index 282e3ec8d6..228dc2a181 100644
--- a/tests/manual/rhi/shared/examplefw.h
+++ b/tests/manual/rhi/shared/examplefw.h
@@ -549,8 +549,7 @@ int main(int argc, char **argv)
<< "VK_LAYER_GOOGLE_unique_objects");
#endif
}
- inst.setExtensions(QByteArrayList()
- << "VK_KHR_get_physical_device_properties2");
+ inst.setExtensions(QRhiVulkanInitParams::preferredInstanceExtensions());
if (!inst.create()) {
qWarning("Failed to create Vulkan instance, switching to OpenGL");
graphicsApi = OpenGL;