diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-15 12:17:52 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-15 15:33:46 +0200 |
commit | ed231455cc22f6280be917780013584020d208d8 (patch) | |
tree | 3bd5791f540733ed50bd08396840f1bbb67e14f3 /tests/auto/gui | |
parent | 6a8eb26bbafa32ef6561792c52ec72f80007377a (diff) |
Relax tst_qvulkan::vulkanVersionRequest to make it compatible with 1.1
The Vulkan spec changed the behavior for VkApplicationInfo::apiVersion
in 1.1, conveniently breaking compatibility with all existing 1.0 logic.
We can no longer assume that the 1.0 behavior, which was failing instance
creation with VK_ERROR_INCOMPATIBLE_DRIVER for an unsupported version,
is always in place. So do not rely on this in the test, and add a
reminder in QVulkanInstance docs as well.
Fixes: QTBUG-85040
Change-Id: I8f5c7a7830877b72d106c444aebfaea191083ee0
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/qvulkan/tst_qvulkan.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/gui/qvulkan/tst_qvulkan.cpp b/tests/auto/gui/qvulkan/tst_qvulkan.cpp index c80c3fed97..3315ae5225 100644 --- a/tests/auto/gui/qvulkan/tst_qvulkan.cpp +++ b/tests/auto/gui/qvulkan/tst_qvulkan.cpp @@ -153,8 +153,15 @@ void tst_QVulkan::vulkanVersionRequest() inst.destroy(); inst.setApiVersion(QVersionNumber(10, 0, 0)); - QVERIFY(!inst.create()); - QCOMPARE(inst.errorCode(), VK_ERROR_INCOMPATIBLE_DRIVER); + + bool result = inst.create(); + + // Starting with Vulkan 1.1 the spec does not allow the implementation to + // fail the instance creation. So check for the 1.0 behavior only when + // create() failed, skip this verification with 1.1+ (where create() will + // succeed for any bogus api version). + if (!result) + QCOMPARE(inst.errorCode(), VK_ERROR_INCOMPATIBLE_DRIVER); } static void waitForUnexposed(QWindow *w) |