diff options
-rw-r--r-- | src/gui/vulkan/qvulkaninstance.cpp | 7 | ||||
-rw-r--r-- | tests/auto/gui/qvulkan/tst_qvulkan.cpp | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/gui/vulkan/qvulkaninstance.cpp b/src/gui/vulkan/qvulkaninstance.cpp index ddee0e47a4..319053dec2 100644 --- a/src/gui/vulkan/qvulkaninstance.cpp +++ b/src/gui/vulkan/qvulkaninstance.cpp @@ -531,6 +531,13 @@ void QVulkanInstance::setExtensions(const QByteArrayList &extensions) \note This function can only be called before create() and has no effect if called afterwards. + + \note Be aware that Vulkan 1.1 changes the behavior with regards to the + Vulkan API version field. In Vulkan 1.0 specifying an unsupported \a + vulkanVersion led to failing create() with \c VK_ERROR_INCOMPATIBLE_DRIVER, + as was mandated by the specification. Starting with Vulkan 1.1, the + specification disallows this, the driver must accept any version without + failing the instance creation. */ void QVulkanInstance::setApiVersion(const QVersionNumber &vulkanVersion) { 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) |