Skip negative vkCreateBuffer(size_max_uint64) test for maint4
authorPiers Daniell <pdaniell@nvidia.com>
Thu, 28 Oct 2021 16:46:40 +0000 (10:46 -0600)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Sat, 6 Nov 2021 20:20:29 +0000 (20:20 +0000)
With VK_KHR_maintenance4 it become invalid usage to call vkCreateBuffer
with a size larger than VkPhysicalDeviceMaintenance4Properties.maxBufferSize.
The dEQP-VK.api.buffer.basic.size_max_uint64 did just this even on maint4
implementation, which is invalid usage.

This CL marks this test as unsupported for implementations that support
VK_KHR_maintenance4.

Affects:

dEQP-VK.api.buffer.basic.*

Components: Vulkan

VK-GL-CTS issue: 3238

Change-Id: I4754c3af4ef253e50226a31a466bfe5772e65652
(cherry picked from commit f92d3e5a35afcf9c2f9226b81d5be54d10944819)

external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp

index a806c63..2a8ef62 100644 (file)
@@ -713,7 +713,11 @@ tcu::TestStatus testLargeBuffer(Context& context, LargeBufferParameters params)
 
 void checkMaintenance4Support(Context& context, LargeBufferParameters params)
 {
-       context.requireDeviceFunctionality("VK_KHR_maintenance4");
+       if (params.useMaxBufferSize)
+               context.requireDeviceFunctionality("VK_KHR_maintenance4");
+       else if (context.isDeviceFunctionalitySupported("VK_KHR_maintenance4") &&
+               params.bufferSize > context.getMaintenance4Properties().maxBufferSize)
+               TCU_THROW(NotSupportedError, "vkCreateBuffer with a size larger than maxBufferSize is not valid usage");
 
        const VkPhysicalDeviceFeatures& physicalDeviceFeatures = getPhysicalDeviceFeatures(context.getInstanceInterface(), context.getPhysicalDevice());
        if ((params.flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) && !physicalDeviceFeatures.sparseBinding)
@@ -755,7 +759,7 @@ void checkMaintenance4Support(Context& context, LargeBufferParameters params)
                                                        VK_BUFFER_CREATE_SPARSE_BINDING_BIT
                                                });
                addFunctionCase(basicTests.get(), "size_max_uint64", "Creating a ULLONG_MAX buffer and verify that it either succeeds or returns one of the allowed errors.",
-                                               testLargeBuffer, LargeBufferParameters
+                                               checkMaintenance4Support, testLargeBuffer, LargeBufferParameters
                                                {
                                                        std::numeric_limits<deUint64>::max(),
                                                        false,