Fix Protected context constructor initialization list order
authorMohankumar Nekkarakalaya <mnekkara@qti.qualcomm.com>
Fri, 2 Jul 2021 17:48:19 +0000 (10:48 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 8 Jul 2021 20:31:41 +0000 (20:31 +0000)
Changed the initilization order of the Protected Context constructor
members because m_allocator depends on m_device and m_deviceDriver.

This was causing the allocator to be created with an uninitialized
device.

Affected tests: dEQP-VK.protected_memory.*

Components: Vulkan
VK-GL-CTS issue: 2990

Change-Id: I921c18aec1c4ba1e8335f6e62b8df2e9cc5f2b39

external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemContext.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemContext.hpp

index f183e7a..a04eff3 100644 (file)
@@ -37,9 +37,9 @@ ProtectedContext::ProtectedContext    (Context&                                               ctx,
        , m_vki                                 (m_instance.getDriver())
        , m_phyDevice                   (vk::chooseDevice(m_vki, m_instance, m_context.getTestContext().getCommandLine()))
        , m_queueFamilyIndex    (chooseProtectedMemQueueFamilyIndex(m_vki, m_phyDevice))
-       , m_allocator                   (createAllocator())
        , m_device                              (makeProtectedMemDevice(m_interface, m_instance, m_vki, m_phyDevice, m_queueFamilyIndex, ctx.getUsedApiVersion(), deviceExtensions, m_context.getTestContext().getCommandLine().isValidationEnabled()))
        , m_deviceDriver                (m_context.getPlatformInterface(), m_instance, *m_device)
+       , m_allocator                   (createAllocator())
        , m_queue                               (getProtectedQueue(m_deviceDriver, *m_device, m_queueFamilyIndex, 0))
 {
 }
@@ -57,9 +57,9 @@ ProtectedContext::ProtectedContext    (Context&                                               ctx,
        , m_phyDevice                   (vk::chooseDevice(m_vki, m_instance, m_context.getTestContext().getCommandLine()))
        , m_surface                             (vk::wsi::createSurface(m_vki, m_instance, wsiType, display, window))
        , m_queueFamilyIndex    (chooseProtectedMemQueueFamilyIndex(m_vki, m_phyDevice, *m_surface))
-       , m_allocator(createAllocator())
        , m_device                              (makeProtectedMemDevice(m_interface, m_instance, m_vki, m_phyDevice, m_queueFamilyIndex, ctx.getUsedApiVersion(), deviceExtensions, m_context.getTestContext().getCommandLine().isValidationEnabled()))
        , m_deviceDriver                (m_interface, m_instance, *m_device)
+       , m_allocator(createAllocator())
        , m_queue                               (getProtectedQueue(m_deviceDriver, *m_device, m_queueFamilyIndex, 0))
 {
 }
index 7b2aed6..e7832ad 100644 (file)
@@ -86,9 +86,9 @@ private:
        vk::VkPhysicalDevice                            m_phyDevice;
        const vk::Move<vk::VkSurfaceKHR>        m_surface;
        deUint32                                                        m_queueFamilyIndex;
-       const de::UniquePtr<vk::Allocator>      m_allocator;
        vk::Move<vk::VkDevice>                          m_device;
        vk::DeviceDriver                                        m_deviceDriver;
+       const de::UniquePtr<vk::Allocator>      m_allocator;
        vk::VkQueue                                                     m_queue;
 };