Disable robustBufferAccess in the default VkDevice to avoid performance issues on...
authorDae Kim <dae.kimpark@imgtec.com>
Sat, 13 Feb 2016 16:03:38 +0000 (16:03 +0000)
committerDae Kim <dae.kimpark@imgtec.com>
Sat, 13 Feb 2016 16:03:38 +0000 (16:03 +0000)
external/vulkancts/modules/vulkan/vktTestCase.cpp

index 6f33b8411520d029870f56f2cb3c02d0d9b9328e..693873f643845bf3a33886de07662fa912a87150 100644 (file)
@@ -108,6 +108,8 @@ public:
        VkQueue                                                         getUniversalQueue                               (void) const;
 
 private:
+       static VkPhysicalDeviceFeatures         filterDefaultDeviceFeatures             (const VkPhysicalDeviceFeatures& deviceFeatures);
+
        const Unique<VkInstance>                        m_instance;
        const InstanceDriver                            m_instanceInterface;
 
@@ -126,7 +128,7 @@ DefaultDevice::DefaultDevice (const PlatformInterface& vkPlatform, const tcu::Co
        , m_instanceInterface                   (vkPlatform, *m_instance)
        , m_physicalDevice                              (chooseDevice(m_instanceInterface, *m_instance, cmdLine))
        , m_universalQueueFamilyIndex   (findQueueFamilyIndexWithCaps(m_instanceInterface, m_physicalDevice, VK_QUEUE_GRAPHICS_BIT|VK_QUEUE_COMPUTE_BIT))
-       , m_deviceFeatures                              (getPhysicalDeviceFeatures(m_instanceInterface, m_physicalDevice)) // \note All supported features are enabled
+       , m_deviceFeatures                              (filterDefaultDeviceFeatures(getPhysicalDeviceFeatures(m_instanceInterface, m_physicalDevice)))
        , m_deviceProperties                    (getPhysicalDeviceProperties(m_instanceInterface, m_physicalDevice)) // \note All supported features are enabled
        , m_device                                              (createDefaultDevice(m_instanceInterface, m_physicalDevice, m_universalQueueFamilyIndex, m_deviceFeatures))
        , m_deviceInterface                             (m_instanceInterface, *m_device)
@@ -144,6 +146,16 @@ VkQueue DefaultDevice::getUniversalQueue (void) const
        return queue;
 }
 
+VkPhysicalDeviceFeatures DefaultDevice::filterDefaultDeviceFeatures (const VkPhysicalDeviceFeatures& deviceFeatures)
+{
+       VkPhysicalDeviceFeatures enabledDeviceFeatures = deviceFeatures;
+
+       // Disable robustness by default, as it has an impact on performance on some HW.
+       enabledDeviceFeatures.robustBufferAccess = false;
+
+       return enabledDeviceFeatures;
+}
+
 // Allocator utilities
 
 vk::Allocator* createAllocator (DefaultDevice* device)