From 9ee1886f753d5985251e10e4c02a55a0e4808785 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 23 Jan 2019 18:29:34 +0000 Subject: [PATCH] Fix swapchain mutable tests buffer allocations We're seeing failure on our implementation and those seem to be related to the fact that some buffers are allocated with one VkDevice and used with another VkDevice. This raises errors in the validation layers : Validation(ERROR): msg_code: 385926663: [ VUID-vkBindBufferMemory-memory-parent ] Object: 0x6 (Type = 8) | Object 0x6 was not created, allocated or retrieved from the correct device. The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' Affects: dEQP-VK.image.swapchain_mutable.* Change-Id: I4d3c62dace2d259061382d3014deb05bc4eac9d7 (cherry picked from commit b48fc89ada2a1b88796d1354d10210928b1fbf0d) --- .../modules/vulkan/image/vktImageMutableTests.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp b/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp index 141634f..4ae65dc 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp @@ -923,14 +923,16 @@ VkImageUsageFlags getImageUsageForTestCase (const CaseDef& caseDef) class UploadDownloadExecutor { public: - UploadDownloadExecutor(Context& context, const CaseDef& caseSpec) : + UploadDownloadExecutor(Context& context, VkDevice device, VkQueue queue, deUint32 queueFamilyIndex, const CaseDef& caseSpec) : m_caseDef(caseSpec), m_haveMaintenance2(isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")), m_vk(context.getDeviceInterface()), - m_device(context.getDevice()), - m_queue(context.getUniversalQueue()), - m_queueFamilyIndex(context.getUniversalQueueFamilyIndex()), - m_allocator(context.getDefaultAllocator()) + m_device(device), + m_queue(queue), + m_queueFamilyIndex(queueFamilyIndex), + m_allocator(context.getDeviceInterface(), device, + getPhysicalDeviceMemoryProperties(context.getInstanceInterface(), + context.getPhysicalDevice())) { } @@ -962,7 +964,7 @@ private: const VkDevice m_device; const VkQueue m_queue; const deUint32 m_queueFamilyIndex; - Allocator& m_allocator; + SimpleAllocator m_allocator; Move m_cmdPool; Move m_cmdBuffer; @@ -1750,7 +1752,7 @@ tcu::TestStatus testMutable (Context& context, const CaseDef caseDef) flushAlloc(vk, device, *colorBufferAlloc); // Execute the test - UploadDownloadExecutor executor(context, caseDef); + UploadDownloadExecutor executor(context, device, context.getUniversalQueue(), context.getUniversalQueueFamilyIndex(), caseDef); executor.run(context, *colorBuffer); // Verify results @@ -2119,7 +2121,7 @@ tcu::TestStatus testSwapchainMutable(Context& context, CaseDef caseDef) const VkDevice device = *devHelper.device; const VkPhysicalDevice physDevice = devHelper.physicalDevice; - Allocator& allocator = context.getDefaultAllocator(); + SimpleAllocator allocator(vk, device, getPhysicalDeviceMemoryProperties(vki, context.getPhysicalDevice())); // Check required features on the format for the required upload/download methods VkFormatProperties imageFormatProps, viewFormatProps; @@ -2257,7 +2259,7 @@ tcu::TestStatus testSwapchainMutable(Context& context, CaseDef caseDef) // Execute the test - UploadDownloadExecutor executor(context, caseDef); + UploadDownloadExecutor executor(context, device, devHelper.queue, devHelper.queueFamilyIndex, caseDef); executor.runSwapchain(context, *colorBuffer, swapchainImages[0]); -- 2.7.4