Rework platform memory limits
authorIlkka Saarelainen <ilkka.saarelainen@siru.fi>
Thu, 2 Dec 2021 05:45:44 +0000 (07:45 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Sat, 15 Jan 2022 01:28:56 +0000 (01:28 +0000)
Some OpenGL tests in openglcts and kc_cts used Vulkan platform class to
get the available system / device memory. The memory limits are not
Vulkan related.

This CL moves the getMemoryLimits function to the base class of all
platforms, so the functions can be accessed from openglcts without
referencing any Vulkan files.

Affects:

dEQP-VK.info.memory_limits
dEQP-VK.api.buffer.suballocation.*
dEQP-VK.api.buffer.dedicated_alloc.*
dEQP-VK.api.object_management.*
dEQP-VK.memory.allocation.*
dEQP-VK.memory.device_group_allocation.*
dEQP-VK.pipeline.render_to_image.*.small.*
dEQP-VK.pipeline.render_to_image.*.huge.*

KHR-GL4*.shader_image_load_store.advanced-*

Components:
Vulkan, OpenGL, Framework

VK-GL-CTS issue: 3360

Change-Id: I0743a83148c946d962fd793c8771f2c3c2e33ecc

23 files changed:
external/fetch_kc_cts.py
external/openglcts/modules/gl/gl4cShaderImageLoadStoreTests.cpp
external/vulkancts/framework/vulkan/vkPlatform.hpp
external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp
external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp
external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp
external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineRenderToImageTests.cpp
external/vulkancts/modules/vulkan/vktInfoTests.cpp
framework/common/tcuPlatform.cpp
framework/common/tcuPlatform.hpp
framework/platform/android/tcuAndroidPlatform.cpp
framework/platform/android/tcuAndroidPlatform.hpp
framework/platform/lnx/tcuLnxVulkanPlatform.cpp
framework/platform/lnx/tcuLnxVulkanPlatform.hpp
framework/platform/null/tcuNullPlatform.cpp
framework/platform/null/tcuNullPlatform.hpp
framework/platform/nullws/tcuNullWSPlatform.hpp
framework/platform/osx/tcuOSXVulkanPlatform.cpp
framework/platform/osx/tcuOSXVulkanPlatform.hpp
framework/platform/surfaceless/tcuSurfacelessPlatform.cpp
framework/platform/win32/tcuWin32VulkanPlatform.cpp
framework/platform/win32/tcuWin32VulkanPlatform.hpp

index a090659..ccead4c 100644 (file)
@@ -32,7 +32,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "..", "scripts"))
 from build.common import *
 
 EXTERNAL_DIR   = os.path.realpath(os.path.normpath(os.path.dirname(__file__)))
-SHA1 = "0c79cf7443872c9f6d59c33e1fecfc9a79a4b42b"
+SHA1 = "0eb3b7e9d717bda5b9ccc1e32f6dfdc4a12b8b2e"
 
 PACKAGES = [
        GitRepo(
index ca399f2..1dd3384 100644 (file)
@@ -28,7 +28,6 @@
 #include "tcuPlatform.hpp"
 #include "tcuRenderTarget.hpp"
 #include "tcuVectorUtil.hpp"
-#include "vkPlatform.hpp"
 #include <assert.h>
 #include <climits>
 #include <cmath>
@@ -190,8 +189,8 @@ public:
 
        void scaleDimensionsToMemory(int& width, int& height, int devLayers, int sysLayers, int devBPP, int sysBPP)
        {
-               vk::PlatformMemoryLimits memoryLimits;
-               m_context.getTestContext().getPlatform().getVulkanPlatform().getMemoryLimits(memoryLimits);
+               tcu::PlatformMemoryLimits memoryLimits;
+               m_context.getTestContext().getPlatform().getMemoryLimits(memoryLimits);
                GLsizeiptr sysSpace               = memoryLimits.totalSystemMemory;
                GLsizeiptr devSpace               = memoryLimits.totalDeviceLocalMemory;
                int                devInSysLayers = 0;
index f12423c..fdd33e4 100644 (file)
@@ -108,31 +108,6 @@ namespace wsi
 class Display;
 } // wsi
 
-struct PlatformMemoryLimits
-{
-       // System memory properties
-       size_t                  totalSystemMemory;                                      //!< #bytes of system memory (heap + HOST_LOCAL) tests must not exceed
-
-       // Device memory properties
-       VkDeviceSize    totalDeviceLocalMemory;                         //!< #bytes of total DEVICE_LOCAL memory tests must not exceed or 0 if DEVICE_LOCAL counts against system memory
-       VkDeviceSize    deviceMemoryAllocationGranularity;      //!< VkDeviceMemory allocation granularity (typically page size)
-
-       // Device memory page table geometry
-       // \todo [2016-03-23 pyry] This becomes obsolete if Vulkan API adds a way for driver to expose internal device memory allocations
-       VkDeviceSize    devicePageSize;                                         //!< Page size on device (must be rounded up to nearest POT)
-       VkDeviceSize    devicePageTableEntrySize;                       //!< Number of bytes per page table size
-       size_t                  devicePageTableHierarchyLevels;         //!< Number of levels in device page table hierarchy
-
-       PlatformMemoryLimits (void)
-               : totalSystemMemory                                     (0)
-               , totalDeviceLocalMemory                        (0)
-               , deviceMemoryAllocationGranularity     (0)
-               , devicePageSize                                        (0)
-               , devicePageTableEntrySize                      (0)
-               , devicePageTableHierarchyLevels        (0)
-       {}
-};
-
 /*--------------------------------------------------------------------*//*!
  * \brief Vulkan platform interface
  *//*--------------------------------------------------------------------*/
@@ -143,21 +118,11 @@ public:
                                                        ~Platform                       (void) {}
 
        virtual Library*                createLibrary           (void) const = 0;
-
        virtual wsi::Display*   createWsiDisplay        (wsi::Type wsiType) const;
-       virtual bool                    hasDisplay      (wsi::Type wsiType) const;
-
-       virtual void                    getMemoryLimits         (PlatformMemoryLimits& limits) const = 0;
+       virtual bool                    hasDisplay                      (wsi::Type wsiType) const;
        virtual void                    describePlatform        (std::ostream& dst) const;
 };
 
-inline PlatformMemoryLimits getMemoryLimits (const Platform& platform)
-{
-       PlatformMemoryLimits limits;
-       platform.getMemoryLimits(limits);
-       return limits;
-}
-
 } // vk
 
 #endif // _VKPLATFORM_HPP
index 8c831ac..ed06d78 100644 (file)
@@ -53,18 +53,18 @@ enum AllocationKind
        ALLOCATION_KIND_LAST,
 };
 
-PlatformMemoryLimits getPlatformMemoryLimits (Context& context)
+tcu::PlatformMemoryLimits getPlatformMemoryLimits (Context& context)
 {
-       PlatformMemoryLimits    memoryLimits;
+       tcu::PlatformMemoryLimits memoryLimits;
 
-       context.getTestContext().getPlatform().getVulkanPlatform().getMemoryLimits(memoryLimits);
+       context.getTestContext().getPlatform().getMemoryLimits(memoryLimits);
 
        return memoryLimits;
 }
 
 VkDeviceSize getMaxBufferSize(const VkDeviceSize& bufferSize,
                                                          const VkDeviceSize& alignment,
-                                                         const PlatformMemoryLimits& limits)
+                                                         const tcu::PlatformMemoryLimits& limits)
 {
        VkDeviceSize size = bufferSize;
 
index eb338ae..7e16a9c 100644 (file)
@@ -331,7 +331,7 @@ inline bool hasDeviceExtension (Context& context, const string name)
        return context.isDeviceFunctionalitySupported(name);
 }
 
-VkDeviceSize getPageTableSize (const PlatformMemoryLimits& limits, VkDeviceSize allocationSize)
+VkDeviceSize getPageTableSize (const tcu::PlatformMemoryLimits& limits, VkDeviceSize allocationSize)
 {
        VkDeviceSize    totalSize       = 0;
 
@@ -383,9 +383,9 @@ size_t computeSystemMemoryUsage (Context& context, const typename Object::Parame
        }
 }
 
-size_t getSafeObjectCount (const PlatformMemoryLimits& memoryLimits,
-                                                  size_t                                               objectSystemMemoryUsage,
-                                                  VkDeviceSize                                 objectDeviceMemoryUsage = 0)
+size_t getSafeObjectCount (const tcu::PlatformMemoryLimits&    memoryLimits,
+                                                  size_t                                                       objectSystemMemoryUsage,
+                                                  VkDeviceSize                                         objectDeviceMemoryUsage = 0)
 {
        const VkDeviceSize      roundedUpDeviceMemory   = roundUpToNextMultiple(objectDeviceMemoryUsage, memoryLimits.deviceMemoryAllocationGranularity);
 
@@ -409,11 +409,11 @@ size_t getSafeObjectCount (const PlatformMemoryLimits&    memoryLimits,
        }
 }
 
-PlatformMemoryLimits getPlatformMemoryLimits (Context& context)
+tcu::PlatformMemoryLimits getPlatformMemoryLimits (Context& context)
 {
-       PlatformMemoryLimits    memoryLimits;
+       tcu::PlatformMemoryLimits       memoryLimits;
 
-       context.getTestContext().getPlatform().getVulkanPlatform().getMemoryLimits(memoryLimits);
+       context.getTestContext().getPlatform().getMemoryLimits(memoryLimits);
 
        return memoryLimits;
 }
index 09b54e2..4515c02 100644 (file)
@@ -289,7 +289,7 @@ public:
                , m_config                              (config)
                , m_result                              (m_context.getTestContext().getLog())
                , m_memoryTypeIndex             (0)
-               , m_memoryLimits                (getMemoryLimits(context.getTestContext().getPlatform().getVulkanPlatform()))
+               , m_memoryLimits                (tcu::getMemoryLimits(context.getTestContext().getPlatform()))
        {
                DE_ASSERT(!!m_config.memorySize != !!m_config.memoryPercentage);
        }
@@ -300,7 +300,7 @@ private:
        const TestConfig                                                m_config;
        tcu::ResultCollector                                    m_result;
        deUint32                                                                m_memoryTypeIndex;
-       const PlatformMemoryLimits                              m_memoryLimits;
+       const tcu::PlatformMemoryLimits                 m_memoryLimits;
 };
 
 
@@ -562,19 +562,19 @@ public:
        tcu::TestStatus                         iterate                                                 (void);
 
 private:
-       const size_t                            m_opCount;
-       const size_t                            m_allocSysMemSize;
-       const PlatformMemoryLimits      m_memoryLimits;
-       const deUint32                          m_totalDeviceMaskCombinations;
-
-       deUint32                                        m_memoryObjectCount;
-       deUint32                                        m_memoryProtectedObjectCount;
-       deUint32                                        m_currentDeviceMask;
-       size_t                                          m_opNdx;
-       de::Random                                      m_rng;
-       vector<Heap>                            m_heaps;
-       VkDeviceSize                            m_totalSystemMem;
-       VkDeviceSize                            m_totalDeviceMem;
+       const size_t                                    m_opCount;
+       const size_t                                    m_allocSysMemSize;
+       const tcu::PlatformMemoryLimits m_memoryLimits;
+       const deUint32                                  m_totalDeviceMaskCombinations;
+
+       deUint32                                                m_memoryObjectCount;
+       deUint32                                                m_memoryProtectedObjectCount;
+       deUint32                                                m_currentDeviceMask;
+       size_t                                                  m_opNdx;
+       de::Random                                              m_rng;
+       vector<Heap>                                    m_heaps;
+       VkDeviceSize                                    m_totalSystemMem;
+       VkDeviceSize                                    m_totalDeviceMem;
 };
 
 RandomAllocFreeTestInstance::RandomAllocFreeTestInstance (Context& context, TestConfigRandom config)
@@ -582,7 +582,7 @@ RandomAllocFreeTestInstance::RandomAllocFreeTestInstance (Context& context, Test
        , m_opCount                                             (128)
        , m_allocSysMemSize                             (computeDeviceMemorySystemMemFootprint(getDeviceInterface(), context.getDevice())
                                                                         + sizeof(MemoryObject))
-       , m_memoryLimits                                (getMemoryLimits(context.getTestContext().getPlatform().getVulkanPlatform()))
+       , m_memoryLimits                                (tcu::getMemoryLimits(context.getTestContext().getPlatform()))
        , m_totalDeviceMaskCombinations (m_subsetAllocationAllowed ? (1 << m_numPhysDevices) - 1 : 1)
        , m_memoryObjectCount                   (0)
        , m_memoryProtectedObjectCount  (0)
index 8f870ed..151f8bd 100644 (file)
@@ -1191,11 +1191,11 @@ VkDeviceSize getHostPageSize (void)
 class MemoryHeap
 {
 public:
-       MemoryHeap (const VkMemoryHeap&                 heap,
-                               const vector<MemoryType>&       memoryTypes,
-                               const PlatformMemoryLimits&     memoryLimits,
-                               const VkDeviceSize                      nonCoherentAtomSize,
-                               TotalMemoryTracker&                     totalMemTracker)
+       MemoryHeap (const VkMemoryHeap&                                 heap,
+                               const vector<MemoryType>&                       memoryTypes,
+                               const tcu::PlatformMemoryLimits&        memoryLimits,
+                               const VkDeviceSize                                      nonCoherentAtomSize,
+                               TotalMemoryTracker&                                     totalMemTracker)
                : m_heap                                (heap)
                , m_memoryTypes                 (memoryTypes)
                , m_limits                              (memoryLimits)
@@ -1243,15 +1243,15 @@ private:
                        return MEMORY_CLASS_SYSTEM;
        }
 
-       const VkMemoryHeap                      m_heap;
-       const vector<MemoryType>        m_memoryTypes;
-       const PlatformMemoryLimits&     m_limits;
-       const VkDeviceSize                      m_nonCoherentAtomSize;
-       const VkDeviceSize                      m_minAtomSize;
-       TotalMemoryTracker&                     m_totalMemTracker;
+       const VkMemoryHeap                                      m_heap;
+       const vector<MemoryType>                        m_memoryTypes;
+       const tcu::PlatformMemoryLimits&        m_limits;
+       const VkDeviceSize                                      m_nonCoherentAtomSize;
+       const VkDeviceSize                                      m_minAtomSize;
+       TotalMemoryTracker&                                     m_totalMemTracker;
 
-       VkDeviceSize                            m_usage;
-       vector<MemoryObject*>           m_objects;
+       VkDeviceSize                                            m_usage;
+       vector<MemoryObject*>                           m_objects;
 };
 
 // Heap is full if there is not enough memory to allocate minimal memory object.
@@ -1430,7 +1430,7 @@ public:
                : TestInstance                          (context)
                , m_memoryObjectSysMemSize      (getMemoryObjectSystemSize(context))
                , m_memoryMappingSysMemSize     (getMemoryMappingSystemSize())
-               , m_memoryLimits                        (getMemoryLimits(context.getTestContext().getPlatform().getVulkanPlatform()))
+               , m_memoryLimits                        (tcu::getMemoryLimits(context.getTestContext().getPlatform()))
                , m_rng                                         (seed)
                , m_opNdx                                       (0)
        {
@@ -1634,7 +1634,7 @@ public:
 private:
        const size_t                                            m_memoryObjectSysMemSize;
        const size_t                                            m_memoryMappingSysMemSize;
-       const PlatformMemoryLimits                      m_memoryLimits;
+       const tcu::PlatformMemoryLimits         m_memoryLimits;
 
        de::Random                                                      m_rng;
        size_t                                                          m_opNdx;
index a13b8df..3d0627e 100644 (file)
@@ -899,8 +899,8 @@ tcu::TestStatus testWithSizeReduction (Context& context, const CaseDef& caseDef)
        VkDeviceSize                                    neededMemory            = static_cast<VkDeviceSize>(static_cast<float>(colorSize + depthStencilSize) * additionalMemory) + reserveForChecking;
        VkDeviceSize                                    maxMemory                       = getMaxDeviceHeapSize(context, caseDef) >> 2;
 
-       vk::PlatformMemoryLimits                memoryLimits;
-       context.getTestContext().getPlatform().getVulkanPlatform().getMemoryLimits(memoryLimits);
+       tcu::PlatformMemoryLimits               memoryLimits;
+       context.getTestContext().getPlatform().getMemoryLimits(memoryLimits);
        maxMemory = std::min(maxMemory, VkDeviceSize(memoryLimits.totalSystemMemory));
 
        const VkDeviceSize                              deviceMemoryBudget      = std::min(neededMemory, maxMemory);
index 9797bfb..63052c9 100644 (file)
@@ -217,9 +217,9 @@ PrettySize<SizeType> prettySize (SizeType value, int precision = 2)
 tcu::TestStatus logPlatformMemoryLimits (Context& context)
 {
        TestLog&                                        log                     = context.getTestContext().getLog();
-       vk::PlatformMemoryLimits        limits;
+       tcu::PlatformMemoryLimits       limits;
 
-       context.getTestContext().getPlatform().getVulkanPlatform().getMemoryLimits(limits);
+       context.getTestContext().getPlatform().getMemoryLimits(limits);
 
        log << TestLog::Message << "totalSystemMemory = " << prettySize(limits.totalSystemMemory) << " (" << limits.totalSystemMemory << ")\n"
                                                        << "totalDeviceLocalMemory = " << prettySize(limits.totalDeviceLocalMemory) << " (" << limits.totalDeviceLocalMemory << ")\n"
index 2c9344c..77cf121 100644 (file)
@@ -54,4 +54,15 @@ const vk::Platform& Platform::getVulkanPlatform (void) const
        TCU_THROW(NotSupportedError, "Vulkan is not supported");
 }
 
+void Platform::getMemoryLimits (PlatformMemoryLimits& limits) const
+{
+       // Default values. Platforms can override these values.
+       limits.totalSystemMemory                                        = 256*1024*1024;
+       limits.totalDeviceLocalMemory                           = 128*1024*1024;
+       limits.deviceMemoryAllocationGranularity        = 64*1024;
+       limits.devicePageSize                                           = 4096;
+       limits.devicePageTableEntrySize                         = 8;
+       limits.devicePageTableHierarchyLevels           = 3;
+}
+
 } // tcu
index 082cf08..3702066 100644 (file)
@@ -46,6 +46,30 @@ namespace tcu
 class CommandLine;
 class FunctionLibrary;
 
+struct PlatformMemoryLimits
+{
+       // System memory properties
+       size_t                  totalSystemMemory;                                      // #bytes of system memory (heap + HOST_LOCAL) tests must not exceed
+
+       // Device memory properties
+       std::uint64_t   totalDeviceLocalMemory;                         // #bytes of total DEVICE_LOCAL memory tests must not exceed or 0 if DEVICE_LOCAL counts against system memory
+       std::uint64_t   deviceMemoryAllocationGranularity;      // VkDeviceMemory allocation granularity (typically page size)
+
+       // Device memory page table geometry
+       std::uint64_t   devicePageSize;                                         // Page size on device (must be rounded up to the nearest POT)
+       std::uint64_t   devicePageTableEntrySize;                       // Number of bytes per page table size
+       size_t                  devicePageTableHierarchyLevels;         // Number of levels in device page table hierarchy
+
+       PlatformMemoryLimits (void)
+               : totalSystemMemory                                     (0)
+               , totalDeviceLocalMemory                        (0)
+               , deviceMemoryAllocationGranularity     (0)
+               , devicePageSize                                        (0)
+               , devicePageTableEntrySize                      (0)
+               , devicePageTableHierarchyLevels        (0)
+       {}
+};
+
 /*--------------------------------------------------------------------*//*!
  * \brief Base class for platform implementation.
  *
@@ -61,7 +85,7 @@ class FunctionLibrary;
  * point, tcuMain.cpp can be used as is. In that case you only have to
  * implement createPlatform().
  *
- * API-specific platform interfaces (glu::Platform and eglu::Platform)
+ * API-specific platform interfaces (glu::Platform, eglu::Platform and vk::Platform)
  * can be provided by implementing get<API>Platform() functions.
  *//*--------------------------------------------------------------------*/
 class Platform
@@ -112,8 +136,17 @@ public:
        virtual const eglu::Platform&   getEGLPlatform          (void) const;
 
        virtual const vk::Platform&             getVulkanPlatform       (void) const;
+
+       virtual void                                    getMemoryLimits         (PlatformMemoryLimits& limits) const;
 };
 
+inline tcu::PlatformMemoryLimits getMemoryLimits (const tcu::Platform& platform)
+{
+       tcu::PlatformMemoryLimits limits;
+       platform.getMemoryLimits(limits);
+       return limits;
+}
+
 } // tcu
 
 #endif // _TCUPLATFORM_HPP
index f671854..41fdfb2 100644 (file)
@@ -18,7 +18,7 @@
  *
  *//*!
  * \file
- * \brief Android EGL platform.
+ * \brief Android EGL and Vulkan platforms.
  *//*--------------------------------------------------------------------*/
 
 #include "tcuAndroidPlatform.hpp"
@@ -332,7 +332,7 @@ void Platform::describePlatform (std::ostream& dst) const
        tcu::Android::describePlatform(m_activity.getNativeActivity(), dst);
 }
 
-void Platform::getMemoryLimits (vk::PlatformMemoryLimits& limits) const
+void Platform::getMemoryLimits (tcu::PlatformMemoryLimits& limits) const
 {
        // Worst-case estimates
        const size_t    MiB                             = (size_t)(1<<20);
index a10cef8..64affb4 100644 (file)
@@ -47,15 +47,15 @@ public:
        virtual const glu::Platform&    getGLPlatform           (void) const { return static_cast<const glu::Platform&>(*this);         }
        virtual const eglu::Platform&   getEGLPlatform          (void) const { return static_cast<const eglu::Platform&>(*this);        }
        virtual const vk::Platform&             getVulkanPlatform       (void) const { return static_cast<const vk::Platform&>(*this);          }
+       virtual void                                    getMemoryLimits         (tcu::PlatformMemoryLimits& limits) const;
 
        WindowRegistry&                                 getWindowRegistry       (void) { return m_windowRegistry; }
 
        // Vulkan Platform API
        vk::Library*                                    createLibrary           (void) const;
        void                                                    describePlatform        (std::ostream& dst) const;
-       void                                                    getMemoryLimits         (vk::PlatformMemoryLimits& limits) const;
        vk::wsi::Display*                               createWsiDisplay        (vk::wsi::Type wsiType) const;
-       bool                                            hasDisplay              (vk::wsi::Type wsiType) const;
+       bool                                                    hasDisplay                      (vk::wsi::Type wsiType) const;
 
 private:
        NativeActivity&                                 m_activity;
index 7f96d59..b97851a 100644 (file)
@@ -320,16 +320,6 @@ void VulkanPlatform::describePlatform (std::ostream& dst) const
        dst << "CPU: " << sysInfo.machine << "\n";
 }
 
-void VulkanPlatform::getMemoryLimits (vk::PlatformMemoryLimits& limits) const
-{
-       limits.totalSystemMemory                                        = 256*1024*1024;
-       limits.totalDeviceLocalMemory                           = 128*1024*1024;
-       limits.deviceMemoryAllocationGranularity        = 64*1024;
-       limits.devicePageSize                                           = 4096;
-       limits.devicePageTableEntrySize                         = 8;
-       limits.devicePageTableHierarchyLevels           = 3;
-}
-
 } // linux
 } // tcu
 
index e19d501..1e3dbc2 100644 (file)
@@ -41,7 +41,6 @@ public:
        vk::Library*            createLibrary           (void) const;
        bool                            hasDisplay                      (vk::wsi::Type wsiType) const;
        void                            describePlatform        (std::ostream& dst) const;
-       void                            getMemoryLimits         (vk::PlatformMemoryLimits& limits) const;
 
 private :
         EventState&            m_eventState;
index 91c6c67..d3ee3cf 100644 (file)
@@ -86,7 +86,7 @@ vk::Library* Platform::createLibrary (void) const
        return vk::createNullDriver();
 }
 
-void Platform::getMemoryLimits (vk::PlatformMemoryLimits& limits) const
+void Platform::getMemoryLimits (tcu::PlatformMemoryLimits& limits) const
 {
        limits.totalSystemMemory                                        = 256*1024*1024;
        limits.totalDeviceLocalMemory                           = 0;
index 7034653..45376cd 100644 (file)
@@ -43,10 +43,10 @@ public:
        virtual const glu::Platform&    getGLPlatform           (void) const { return static_cast<const glu::Platform&>(*this); }
        virtual const eglu::Platform&   getEGLPlatform          (void) const { return static_cast<const eglu::Platform&>(*this); }
        virtual const vk::Platform&             getVulkanPlatform       (void) const { return static_cast<const vk::Platform&>(*this);  }
+       virtual void                                    getMemoryLimits         (tcu::PlatformMemoryLimits& limits) const;
 
 private:
        virtual vk::Library*                    createLibrary           (void) const;
-       void                                                    getMemoryLimits         (vk::PlatformMemoryLimits& limits) const;
 };
 
 } // null
index 80965fc..5c5e788 100644 (file)
@@ -73,20 +73,6 @@ public:
        {
                return new VulkanLibrary();
        }
-       // FINISHME: Query actual memory limits.
-       //
-       // These hard-coded memory limits were copied from tcuX11Platform.cpp,
-       // and they work well enough for Intel platforms.
-       void getMemoryLimits (vk::PlatformMemoryLimits& limits) const
-       {
-               limits.totalSystemMemory                                        = 256*1024*1024;
-               limits.totalDeviceLocalMemory                           = 128*1024*1024;
-               limits.deviceMemoryAllocationGranularity        = 64*1024;
-               limits.devicePageSize                                           = 4096;
-               limits.devicePageTableEntrySize                         = 8;
-               limits.devicePageTableHierarchyLevels           = 3;
-       }
-
 };
 
 } // nullws
index 6f591a1..91d58f9 100644 (file)
@@ -136,16 +136,6 @@ void VulkanPlatform::describePlatform (std::ostream& dst) const
        dst << "CPU: " << sysInfo.machine << "\n";
 }
 
-void VulkanPlatform::getMemoryLimits (vk::PlatformMemoryLimits& limits) const
-{
-       limits.totalSystemMemory                                        = 256*1024*1024;
-       limits.totalDeviceLocalMemory                           = 128*1024*1024;
-       limits.deviceMemoryAllocationGranularity        = 64*1024;
-       limits.devicePageSize                                           = 4096;
-       limits.devicePageTableEntrySize                         = 8;
-       limits.devicePageTableHierarchyLevels           = 3;
-}
-
 } // osx
 } // tcu
 
index 5044d5b..da89622 100644 (file)
@@ -40,7 +40,6 @@ public:
        vk::Library*            createLibrary           (void) const;
        bool                            hasDisplay              (vk::wsi::Type wsiType) const;
        void                            describePlatform        (std::ostream& dst) const;
-       void                            getMemoryLimits         (vk::PlatformMemoryLimits& limits) const;
 };
 
 
index 04f32c8..749de5e 100644 (file)
@@ -136,20 +136,6 @@ public:
                dst << "OS: " << sysInfo.sysname << " " << sysInfo.release << " " << sysInfo.version << "\n";
                dst << "CPU: " << sysInfo.machine << "\n";
        }
-
-       // FINISHME: Query actual memory limits.
-       //
-       // These hard-coded memory limits were copied from tcuX11Platform.cpp,
-       // and they work well enough for Intel platforms.
-       void getMemoryLimits (vk::PlatformMemoryLimits& limits) const
-       {
-               limits.totalSystemMemory                                        = 256*1024*1024;
-               limits.totalDeviceLocalMemory                           = 128*1024*1024;
-               limits.deviceMemoryAllocationGranularity        = 64*1024;
-               limits.devicePageSize                                           = 4096;
-               limits.devicePageTableEntrySize                         = 8;
-               limits.devicePageTableHierarchyLevels           = 3;
-       }
 };
 
 bool isEGLExtensionSupported(
index bfdc609..1be113a 100644 (file)
@@ -284,16 +284,6 @@ void VulkanPlatform::describePlatform (std::ostream& dst) const
        dst << "\n";
 }
 
-void VulkanPlatform::getMemoryLimits (vk::PlatformMemoryLimits& limits) const
-{
-       limits.totalSystemMemory                                        = 256*1024*1024;
-       limits.totalDeviceLocalMemory                           = 128*1024*1024;
-       limits.deviceMemoryAllocationGranularity        = 64*1024;
-       limits.devicePageSize                                           = 4096;
-       limits.devicePageTableEntrySize                         = 8;
-       limits.devicePageTableHierarchyLevels           = 3;
-}
-
 vk::wsi::Display* VulkanPlatform::createWsiDisplay (vk::wsi::Type wsiType) const
 {
        if (wsiType != vk::wsi::TYPE_WIN32)
index 4fb7f81..cfcc43e 100644 (file)
@@ -40,9 +40,7 @@ public:
 
        vk::Library*            createLibrary           (void) const;
        vk::wsi::Display*       createWsiDisplay        (vk::wsi::Type wsiType) const;
-       bool                            hasDisplay      (vk::wsi::Type wsiType) const;
-
-       void                            getMemoryLimits         (vk::PlatformMemoryLimits& limits) const;
+       bool                            hasDisplay                      (vk::wsi::Type wsiType) const;
        void                            describePlatform        (std::ostream& dst) const;
 
 private: