From e9360a819f9838b5792eae49df4e0142d176d7c4 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 8 Sep 2020 14:56:21 +0100 Subject: [PATCH] Don't pre-allocate such large wrapped pools * The cost of searching a few more pools to check allocations isn't so bad especially if we can move IsAlloc() off the hot path. Better that than allocating 100MB in pools. --- renderdoc/common/wrapped_pool.h | 129 +++++++------------ renderdoc/driver/d3d11/d3d11_context.h | 4 +- renderdoc/driver/d3d11/d3d11_device.h | 3 +- renderdoc/driver/d3d11/d3d11_resources.h | 25 +--- renderdoc/driver/d3d12/d3d12_command_list.h | 4 +- renderdoc/driver/d3d12/d3d12_command_queue.h | 3 +- renderdoc/driver/d3d12/d3d12_device.h | 3 +- renderdoc/driver/d3d12/d3d12_resources.h | 20 +-- renderdoc/driver/dxgi/dxgi_wrapped.h | 3 +- renderdoc/driver/vulkan/vk_resources.h | 44 ++----- 10 files changed, 74 insertions(+), 164 deletions(-) diff --git a/renderdoc/common/wrapped_pool.h b/renderdoc/common/wrapped_pool.h index 98dbbcd15..3d5914044 100644 --- a/renderdoc/common/wrapped_pool.h +++ b/renderdoc/common/wrapped_pool.h @@ -27,20 +27,10 @@ #include #include +#include "api/replay/stringise.h" #include "common.h" #include "threading.h" -#define INCLUDE_TYPE_NAMES RDOC_DEVEL - -#if ENABLED(INCLUDE_TYPE_NAMES) -template -class GetTypeName -{ -public: - static const char *Name(); -}; -#endif - template class FriendMaker { @@ -49,7 +39,7 @@ public: }; // allocate each class in its own pool so we can identify the type by the pointer -template +template class WrappingPool { public: @@ -70,21 +60,8 @@ public: return ret; } -// warn when we need to allocate an additional pool -#if ENABLED(INCLUDE_TYPE_NAMES) - RDCWARN("Ran out of free slots in %s pool!", GetTypeName::Name()); -#else - RDCWARN("Ran out of free slots in pool 0x%p!", &m_ImmediatePool.items[0]); -#endif - // allocate a new additional pool and use that to allocate from - m_AdditionalPools.push_back(new ItemPool()); - -#if ENABLED(INCLUDE_TYPE_NAMES) - RDCDEBUG("WrappingPool[%d]<%s>: %p -> %p", (uint32_t)m_AdditionalPools.size() - 1, - GetTypeName::Name(), &m_AdditionalPools.back()->items[0], - &m_AdditionalPools.back()->items[AllocCount - 1]); -#endif + m_AdditionalPools.push_back(new ItemPool(m_AdditionalPools.size() + 1)); return m_AdditionalPools.back()->Allocate(); } @@ -135,31 +112,14 @@ public: } } -// this is an error - deleting an object that we don't recognise -#if ENABLED(INCLUDE_TYPE_NAMES) - RDCERR("Resource being deleted through wrong pool - 0x%p not a member of %s", p, - GetTypeName::Name()); -#else - RDCERR("Resource being deleted through wrong pool - 0x%p not a member of 0x%p", p, - &m_ImmediatePool.items[0]); -#endif + // this is an error - deleting an object that we don't recognise + RDCERR("Resource being deleted through wrong pool - 0x%p not a member of this pool", p); } - static const size_t AllocCount = PoolCount; - static const size_t AllocMaxByteSize = MaxPoolByteSize; static const size_t AllocByteSize; private: - WrappingPool() - { -#if ENABLED(INCLUDE_TYPE_NAMES) - // hack - print in kB because float printing relies on statics that might not be initialised - // yet in loading order. Ugly :( - RDCDEBUG("WrappingPool<%s> %d in %dkB: %p -> %p", GetTypeName::Name(), PoolCount, - (PoolCount * AllocByteSize) / 1024, &m_ImmediatePool.items[0], - &m_ImmediatePool.items[AllocCount - 1]); -#endif - } + WrappingPool() : m_ImmediatePool(0) {} ~WrappingPool() { for(size_t i = 0; i < m_AdditionalPools.size(); i++) @@ -172,15 +132,38 @@ private: struct ItemPool { - ItemPool() + ItemPool(size_t poolIndex) { - items = (WrapType *)(new uint8_t[AllocCount * AllocByteSize]); - freeStack = new int[AllocCount]; - for(int i = 0; i < (int)AllocCount; ++i) + const size_t itemSize = sizeof(WrapType); + + size_t size; + // first immediate pool is small - 1kB or enough for 4 objects (for every large objects like + // devices/queues where we don't expect many) + if(poolIndex == 0) + { + size = RDCMAX(itemSize * 4, (size_t)1024); + } + else if(poolIndex == 1) + { + // second pool is larger at 16kB, but still could be spillover from a very small immediate + // pool. + size = 16 * 1024; + } + else + { + // after that we jump up but don't get too crazy, allocate 512kB at a time + size = 512 * 1024; + } + + count = size / itemSize; + + items = (WrapType *)(new uint8_t[count * itemSize]); + freeStack = new int[count]; + for(int i = 0; i < (int)count; ++i) { freeStack[i] = i; } - freeStackHead = AllocCount; + freeStackHead = count; } ~ItemPool() { @@ -189,6 +172,8 @@ private: } void *Allocate() { + const size_t itemSize = sizeof(WrapType); + if(freeStackHead == 0) { return NULL; @@ -197,7 +182,7 @@ private: void *ret = items + freeStack[freeStackHead]; #if ENABLED(RDOC_DEVEL) - memset(ret, 0xb0, AllocByteSize); + memset(ret, 0xb0, itemSize); #endif return ret; @@ -205,15 +190,7 @@ private: void Deallocate(void *p) { - RDCASSERT(IsAlloc(p)); - -#if ENABLED(RDOC_DEVEL) - if(!IsAlloc(p)) - { - RDCERR("Resource being deleted through wrong pool - 0x%p not a memory of 0x%p", p, &items[0]); - return; - } -#endif + const size_t itemSize = sizeof(WrapType); int idx = (int)((WrapType *)p - &items[0]); @@ -222,14 +199,15 @@ private: #if ENABLED(RDOC_DEVEL) if(DebugClear) - memset(p, 0xfe, AllocByteSize); + memset(p, 0xfe, itemSize); #endif } - bool IsAlloc(const void *p) const { return p >= &items[0] && p < &items[PoolCount]; } + bool IsAlloc(const void *p) const { return p >= &items[0] && p < &items[count]; } WrapType *items; + size_t count; int *freeStack; - int freeStackHead; + size_t freeStackHead; }; ItemPool m_ImmediatePool; @@ -244,23 +222,6 @@ private: void *operator new(size_t sz) { return m_Pool.Allocate(); } \ void operator delete(void *p) { m_Pool.Deallocate(p); } \ static bool IsAlloc(const void *p) { return m_Pool.IsAlloc(p); } -#if ENABLED(INCLUDE_TYPE_NAMES) -#define DECL_TYPENAME(a) \ - template <> \ - const char *GetTypeName::Name() \ - { \ - return #a; \ - } -#else -#define DECL_TYPENAME(a) -#endif - -#define WRAPPED_POOL_INST(a) \ - a::PoolType a::m_Pool; \ - template <> \ - const size_t a::PoolType::AllocByteSize = sizeof(a); \ - RDCCOMPILE_ASSERT(a::PoolType::AllocCount * sizeof(a) <= a::PoolType::AllocMaxByteSize, \ - "Pool is bigger than max pool size cap for " STRINGIZE(a)); \ - RDCCOMPILE_ASSERT(a::PoolType::AllocCount > 2, \ - "Pool isn't greater than 2 in size. Bad parameters?"); \ - DECL_TYPENAME(a); +#define WRAPPED_POOL_INST(a) \ + a::PoolType a::m_Pool; \ + DECLARE_STRINGISE_TYPE(a); diff --git a/renderdoc/driver/d3d11/d3d11_context.h b/renderdoc/driver/d3d11/d3d11_context.h index 8f00ed2ca..7e046b0db 100644 --- a/renderdoc/driver/d3d11/d3d11_context.h +++ b/renderdoc/driver/d3d11/d3d11_context.h @@ -267,9 +267,7 @@ private: SERIALISED_ID3D11CONTEXT_MARKER_FUNCTIONS(); public: - static const int AllocPoolCount = 1024; - static const int AllocPoolMaxByteSize = 3 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11DeviceContext, AllocPoolCount, AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11DeviceContext); WrappedID3D11DeviceContext(WrappedID3D11Device *realDevice, ID3D11DeviceContext *context); virtual ~WrappedID3D11DeviceContext(); diff --git a/renderdoc/driver/d3d11/d3d11_device.h b/renderdoc/driver/d3d11/d3d11_device.h index 2b51694d6..30ceda8eb 100644 --- a/renderdoc/driver/d3d11/d3d11_device.h +++ b/renderdoc/driver/d3d11/d3d11_device.h @@ -392,8 +392,7 @@ private: rdcarray m_Drawcalls; public: - static const int AllocPoolCount = 4; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Device, AllocPoolCount); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Device); WrappedID3D11Device(ID3D11Device *realDevice, D3D11InitParams params); void SetInitParams(const D3D11InitParams ¶ms, uint64_t sectionVersion, const ReplayOptions &opts) diff --git a/renderdoc/driver/d3d11/d3d11_resources.h b/renderdoc/driver/d3d11/d3d11_resources.h index 8cabef50b..de67ccecc 100644 --- a/renderdoc/driver/d3d11/d3d11_resources.h +++ b/renderdoc/driver/d3d11/d3d11_resources.h @@ -452,9 +452,7 @@ public: static std::map m_BufferList; - static const int AllocPoolCount = 128 * 1024; - static const int AllocPoolMaxByteSize = 13 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Buffer, AllocPoolCount, AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Buffer); WrappedID3D11Buffer(ID3D11Buffer *real, uint32_t byteLength, WrappedID3D11Device *device) : WrappedResource11(real, device) @@ -567,9 +565,7 @@ class WrappedID3D11Texture2D1 : public WrappedTexture { public: - static const int AllocPoolCount = 32768; - static const int AllocPoolMaxByteSize = 4 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Texture2D1, AllocPoolCount, AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Texture2D1); WrappedID3D11Texture2D1(ID3D11Texture2D *real, WrappedID3D11Device *device, TextureDisplayType type = TEXDISPLAY_SRV_COMPATIBLE) @@ -612,9 +608,7 @@ class WrappedID3D11Texture3D1 : public WrappedTexture { public: - static const int AllocPoolCount = 16384; - static const int AllocPoolMaxByteSize = 2 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Texture3D1, AllocPoolCount, AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Texture3D1); WrappedID3D11Texture3D1(ID3D11Texture3D *real, WrappedID3D11Device *device, TextureDisplayType type = TEXDISPLAY_SRV_COMPATIBLE) @@ -855,9 +849,7 @@ class WrappedID3D11ShaderResourceView1 : public WrappedView1 { public: - static const int AllocPoolCount = 65535; - static const int AllocPoolMaxByteSize = 6 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11ShaderResourceView1, AllocPoolCount, AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11ShaderResourceView1); WrappedID3D11ShaderResourceView1(ID3D11ShaderResourceView *real, ID3D11Resource *res, WrappedID3D11Device *device) @@ -1034,10 +1026,7 @@ template class WrappedID3D11Shader : public WrappedDeviceChild11, public WrappedShader { public: - static const int AllocPoolCount = 32 * 1024; - static const int AllocPoolMaxByteSize = 3 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Shader, AllocPoolCount, - AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Shader); WrappedID3D11Shader(RealShaderType *real, ResourceId origId, const byte *code, size_t codeLen, WrappedID3D11Device *device) @@ -1083,9 +1072,7 @@ public: class WrappedID3D11Query1 : public WrappedDeviceChild11 { public: - static const int AllocPoolCount = 16 * 1024; - static const int AllocPoolMaxByteSize = 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Query1, AllocPoolCount, AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Query1); WrappedID3D11Query1(ID3D11Query *real, WrappedID3D11Device *device) : WrappedDeviceChild11(real, device) diff --git a/renderdoc/driver/d3d12/d3d12_command_list.h b/renderdoc/driver/d3d12/d3d12_command_list.h index 35d936d9a..76d02f76d 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list.h +++ b/renderdoc/driver/d3d12/d3d12_command_list.h @@ -164,9 +164,7 @@ private: static rdcstr GetChunkName(uint32_t idx); D3D12ResourceManager *GetResourceManager() { return m_pDevice->GetResourceManager(); } public: - static const int AllocPoolCount = 8192; - static const int AllocMaxByteSize = 2 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12GraphicsCommandList, AllocPoolCount, AllocMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12GraphicsCommandList); WrappedID3D12GraphicsCommandList(ID3D12GraphicsCommandList *real, WrappedID3D12Device *device, CaptureState &state); diff --git a/renderdoc/driver/d3d12/d3d12_command_queue.h b/renderdoc/driver/d3d12/d3d12_command_queue.h index e0bbb6156..780955048 100644 --- a/renderdoc/driver/d3d12/d3d12_command_queue.h +++ b/renderdoc/driver/d3d12/d3d12_command_queue.h @@ -140,8 +140,7 @@ class WrappedID3D12CommandQueue : public ID3D12CommandQueue, static rdcstr GetChunkName(uint32_t idx); D3D12ResourceManager *GetResourceManager() { return m_pDevice->GetResourceManager(); } public: - static const int AllocPoolCount = 16; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12CommandQueue, AllocPoolCount); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12CommandQueue); WrappedID3D12CommandQueue(ID3D12CommandQueue *real, WrappedID3D12Device *device, CaptureState &state); diff --git a/renderdoc/driver/d3d12/d3d12_device.h b/renderdoc/driver/d3d12/d3d12_device.h index 591504952..01c82e9c5 100644 --- a/renderdoc/driver/d3d12/d3d12_device.h +++ b/renderdoc/driver/d3d12/d3d12_device.h @@ -601,8 +601,7 @@ private: static std::map m_DeviceWrappers; public: - static const int AllocPoolCount = 4; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12Device, AllocPoolCount); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12Device); WrappedID3D12Device(ID3D12Device *realDevice, D3D12InitParams params, bool enabledDebugLayer); bool IsDebugLayerEnabled() const { return m_debugLayerEnabled; } diff --git a/renderdoc/driver/d3d12/d3d12_resources.h b/renderdoc/driver/d3d12/d3d12_resources.h index 43782d528..a7b11e729 100644 --- a/renderdoc/driver/d3d12/d3d12_resources.h +++ b/renderdoc/driver/d3d12/d3d12_resources.h @@ -329,9 +329,7 @@ public: class WrappedID3D12CommandAllocator : public WrappedDeviceChild12 { public: - static const int AllocPoolCount = 8192; - static const int AllocMaxByteSize = 192 * 8192; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12CommandAllocator, AllocPoolCount, AllocMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12CommandAllocator); ChunkAllocator alloc; bool m_Internal = false; @@ -594,9 +592,7 @@ public: class WrappedID3D12PipelineState : public WrappedDeviceChild12 { public: - static const int AllocPoolCount = 65536; - static const int AllocMaxByteSize = 5 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12PipelineState, AllocPoolCount, AllocMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12PipelineState); D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC *graphics = NULL; D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC *compute = NULL; @@ -660,9 +656,7 @@ public: class ShaderEntry : public WrappedDeviceChild12 { public: - static const int AllocPoolCount = 16384; - static const int AllocMaxByteSize = 10 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(ShaderEntry, AllocPoolCount, AllocMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(ShaderEntry); static bool m_InternalResources; @@ -859,9 +853,7 @@ class WrappedID3D12Resource1 : public WrappedDeviceChild12 { public: - static const int AllocPoolCount = 8192; - static const int AllocMaxByteSize = 2 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12RootSignature, AllocPoolCount, AllocMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12RootSignature); D3D12RootSignature sig; diff --git a/renderdoc/driver/dxgi/dxgi_wrapped.h b/renderdoc/driver/dxgi/dxgi_wrapped.h index 88e57cfa0..68cd0627b 100644 --- a/renderdoc/driver/dxgi/dxgi_wrapped.h +++ b/renderdoc/driver/dxgi/dxgi_wrapped.h @@ -1336,8 +1336,7 @@ public: WrappedIDXGIDevice4(IDXGIDevice *real, ID3DDevice *d3d); virtual ~WrappedIDXGIDevice4(); - static const int AllocPoolCount = 4; - ALLOCATE_WITH_WRAPPED_POOL(WrappedIDXGIDevice4, AllocPoolCount); + ALLOCATE_WITH_WRAPPED_POOL(WrappedIDXGIDevice4); IMPLEMENT_IDXGIOBJECT_WITH_REFCOUNTDXGIOBJECT_CUSTOMQUERY; HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); diff --git a/renderdoc/driver/vulkan/vk_resources.h b/renderdoc/driver/vulkan/vk_resources.h index 046ce0903..dc0afcf0c 100644 --- a/renderdoc/driver/vulkan/vk_resources.h +++ b/renderdoc/driver/vulkan/vk_resources.h @@ -294,9 +294,7 @@ struct WrappedVkCommandBuffer : WrappedVkDispRes { WrappedVkCommandBuffer(VkCommandBuffer obj, ResourceId objId) : WrappedVkDispRes(obj, objId) {} typedef VkCommandBuffer InnerType; - static const int AllocPoolCount = 32 * 1024; - static const int AllocPoolMaxByteSize = 2 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkCommandBuffer, AllocPoolCount, AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkCommandBuffer); typedef VkDevDispatchTable DispatchTableType; enum { @@ -321,9 +319,7 @@ struct WrappedVkDeviceMemory : WrappedVkNonDispRes { WrappedVkDeviceMemory(VkDeviceMemory obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {} typedef VkDeviceMemory InnerType; - static const int AllocPoolCount = 128 * 1024; - static const int AllocPoolMaxByteSize = 3 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkDeviceMemory, AllocPoolCount, AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkDeviceMemory); enum { TypeEnum = eResDeviceMemory, @@ -333,9 +329,7 @@ struct WrappedVkBuffer : WrappedVkNonDispRes { WrappedVkBuffer(VkBuffer obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {} typedef VkBuffer InnerType; - static const int AllocPoolCount = 128 * 1024; - static const int AllocPoolMaxByteSize = 3 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkBuffer, AllocPoolCount, AllocPoolMaxByteSize, false); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkBuffer, false); enum { TypeEnum = eResBuffer, @@ -345,9 +339,7 @@ struct WrappedVkImage : WrappedVkNonDispRes { WrappedVkImage(VkImage obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {} typedef VkImage InnerType; - static const int AllocPoolCount = 128 * 1024; - static const int AllocPoolMaxByteSize = 3 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkImage, AllocPoolCount, AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkImage); enum { TypeEnum = eResImage, @@ -387,9 +379,7 @@ struct WrappedVkBufferView : WrappedVkNonDispRes { WrappedVkBufferView(VkBufferView obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {} typedef VkBufferView InnerType; - static const int AllocPoolCount = 128 * 1024; - static const int AllocPoolMaxByteSize = 3 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkBufferView, AllocPoolCount, AllocPoolMaxByteSize, false); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkBufferView, false); enum { TypeEnum = eResBufferView, @@ -399,9 +389,7 @@ struct WrappedVkImageView : WrappedVkNonDispRes { WrappedVkImageView(VkImageView obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {} typedef VkImageView InnerType; - static const int AllocPoolCount = 128 * 1024; - static const int AllocPoolMaxByteSize = 3 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkImageView, AllocPoolCount, AllocPoolMaxByteSize, false); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkImageView, false); enum { TypeEnum = eResImageView, @@ -411,8 +399,7 @@ struct WrappedVkShaderModule : WrappedVkNonDispRes { WrappedVkShaderModule(VkShaderModule obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {} typedef VkShaderModule InnerType; - static const int AllocPoolCount = 32 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkShaderModule, AllocPoolCount); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkShaderModule); enum { TypeEnum = eResShaderModule, @@ -434,8 +421,7 @@ struct WrappedVkPipelineLayout : WrappedVkNonDispRes { } typedef VkPipelineLayout InnerType; - static const int AllocPoolCount = 32 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkPipelineLayout, AllocPoolCount); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkPipelineLayout); enum { TypeEnum = eResPipelineLayout, @@ -455,8 +441,7 @@ struct WrappedVkPipeline : WrappedVkNonDispRes { WrappedVkPipeline(VkPipeline obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {} typedef VkPipeline InnerType; - static const int AllocPoolCount = 32 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkPipeline, AllocPoolCount); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkPipeline); enum { TypeEnum = eResPipeline, @@ -469,8 +454,7 @@ struct WrappedVkDescriptorSetLayout : WrappedVkNonDispRes { } typedef VkDescriptorSetLayout InnerType; - static const int AllocPoolCount = 32 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkDescriptorSetLayout, AllocPoolCount); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkDescriptorSetLayout); enum { TypeEnum = eResDescriptorSetLayout, @@ -479,10 +463,8 @@ struct WrappedVkDescriptorSetLayout : WrappedVkNonDispRes struct WrappedVkSampler : WrappedVkNonDispRes { WrappedVkSampler(VkSampler obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {} - static const int AllocPoolCount = 8192; - static const int AllocPoolMaxByteSize = 1024 * 1024; typedef VkSampler InnerType; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkSampler, AllocPoolCount, AllocPoolMaxByteSize, false); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkSampler, false); enum { TypeEnum = eResSampler, @@ -504,9 +486,7 @@ struct WrappedVkDescriptorSet : WrappedVkNonDispRes { WrappedVkDescriptorSet(VkDescriptorSet obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {} typedef VkDescriptorSet InnerType; - static const int AllocPoolCount = 256 * 1024; - static const int AllocPoolMaxByteSize = 6 * 1024 * 1024; - ALLOCATE_WITH_WRAPPED_POOL(WrappedVkDescriptorSet, AllocPoolCount, AllocPoolMaxByteSize); + ALLOCATE_WITH_WRAPPED_POOL(WrappedVkDescriptorSet); enum { TypeEnum = eResDescriptorSet,