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>
Thu, 1 Sep 2022 21:43:19 +0000 (21:43 +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 a115032682ad9b6845e438fd5ff7887056f29467..ccead4cc6134995f55918b4f6717daaa953ae7e2 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 = "64f5eea1e492de4664b39115ad82d330e019464b"
+SHA1 = "0eb3b7e9d717bda5b9ccc1e32f6dfdc4a12b8b2e"
 
 PACKAGES = [
        GitRepo(
index c3ffc5ea87168c9ebfe814e06b333f2cf6eb33c6..222392f356cbad0f89a14ceb8a75b2f8ae33dbb8 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 f12423c9cf41be1c8fa194ff64b10fcc71efad07..fdd33e4aff19ce902b0ab57f9137a004023be82d 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 fb314f4517eceb509f304b932c24c43de7949f7f..ab6003340525cfece8199dcf2813aff0babcfd30 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 0f5a6d715d04c6ce90564ad3d69e8a46f59850aa..cc7c543bbbdf869770473ceaa2b450d1e41a36fe 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 09b54e23cfc1f6f2effdae5c5de50fb70c900101..4515c0218b99b833fc33d41286efcab105fdace6 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 8f870ede47eec73c711ffb41f50be1ffc518ef0a..151f8bdedc82e3229462eca3a1f46c589309edd2 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 a13b8df5a300e4b70cab0fbddcb6f59c4f1469f7..3d0627e3702ba40988d7b0a2964a6e4a1de9900a 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 9797bfbc0179ab1cb992dc529058a249dfcb4842..63052c948a5d886e1cb4eb8c147005416552b285 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 2c9344c78564aa03eace2c1406a4761c35541170..77cf121c19531ff189be1319515c5ebb506552f1 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 082cf08ac903663ea435561781ecd2962c180471..3702066e6786ccfa745abc13e1996655f92b519f 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 b9a4c716fc1601abc7bc89d3ec0cc529b09dfd53..57a4a2553dc635389d3074b9d40cba2691d0a64d 100644 (file)
@@ -18,7 +18,7 @@
  *
  *//*!
  * \file
- * \brief Android EGL platform.
+ * \brief Android EGL and Vulkan platforms.
  *//*--------------------------------------------------------------------*/
 
 #include "tcuAndroidPlatform.hpp"
@@ -334,7 +334,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 a10cef86230cb7a5fc3bf1aeaf26b536e74474f8..64affb463eab98a6c7fb6d1191afba5c74a7335d 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 a4dffc2a2cafd45d6edfe44a21645c921187c266..46082cd1e9dc5c7f2913974bdfea69878a91a95d 100644 (file)
@@ -324,16 +324,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 e19d501911bf8aa8d0ed04a74a44f9c3d3ee6384..1e3dbc2b2d719905029bd507e82713b074f364c0 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 91c6c6769ecc558226f0dc30d152588d281319b3..d3ee3cf79ad0cde7b49960bf2692c785d972b892 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 7034653abf42e1c0121de455ec4c841784ff56b6..45376cd56fcab24e9f51f646e3635c9e724ce50c 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 80965fce22981698e6734a9d64755f78ab772ebc..5c5e788bb756eb17cf02984de88c6a83e56bdc13 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 6f591a1843e209c2274d0f1a3e637a6a74ce58b6..91d58f9af04b477d82a337ab670419cd0f9bb7c8 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 5044d5b6cf014b380ef2801cf6bf844b00c0df7a..da89622ad0cba93e9d33341ffa84cf686df70658 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 63d3f5d2cb3d9580567cde63d8460fbaf3c7d0a9..8eac8d49789982ba27bc83f10d37b897e912c05a 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 cf31dda0b70a3a29b6be1fa871e4600affc1e0fb..fb2c3407e9bdf39364c02ace8c9c7028b49be4c3 100644 (file)
@@ -286,16 +286,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 4fb7f815627703a509f82e098cf742076cbc5107..cfcc43e97e12c35b676655025a449895b3022051 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: