Reduce memory usage by replacing use of MVKVectorDefault

with std::vector in descriptor set bindings.
This commit is contained in:
Bill Hollings 2019-10-11 15:12:17 -04:00
parent 5c87700732
commit ebe38ba2ea
2 changed files with 11 additions and 9 deletions

View File

@ -25,7 +25,8 @@ Released TBD
- Allow `MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS` build setting to be overridden.
- Fix memory leaks of system classes during `VkInstance` and `VkQueue` creation.
- Fix memory leaks when compiling shaders and pipelines without default OS autorelease pool.
- Reduce memory usage by adjusting default memory allocs for many MVKVectorInline uses.
- Reduce memory usage by adjusting default memory allocs for many `MVKVectorInline` uses and
replacing use of `MVKVectorDefault` with `std::vector` in descriptor set bindings.

View File

@ -24,6 +24,7 @@
#include <MoltenVKSPIRVToMSLConverter/SPIRVToMSLConverter.h>
#include <unordered_set>
#include <unordered_map>
#include <vector>
class MVKDescriptorPool;
class MVKDescriptorBinding;
@ -117,7 +118,7 @@ protected:
MVKDescriptorSetLayout* _layout;
VkDescriptorSetLayoutBinding _info;
MVKVectorDefault<MVKSampler*> _immutableSamplers;
std::vector<MVKSampler*> _immutableSamplers;
MVKShaderResourceBinding _mtlResourceIndexOffsets;
bool _applyToStage[kMVKShaderStageMax];
};
@ -271,13 +272,13 @@ protected:
MVKDescriptorSet* _pDescSet;
MVKDescriptorSetLayoutBinding* _pBindingLayout;
MVKVectorDefault<VkDescriptorImageInfo> _imageBindings;
MVKVectorDefault<VkDescriptorBufferInfo> _bufferBindings;
MVKVectorDefault<VkBufferView> _texelBufferBindings;
MVKVectorDefault<id<MTLBuffer>> _mtlBuffers;
MVKVectorDefault<NSUInteger> _mtlBufferOffsets;
MVKVectorDefault<id<MTLTexture>> _mtlTextures;
MVKVectorDefault<id<MTLSamplerState>> _mtlSamplers;
std::vector<VkDescriptorImageInfo> _imageBindings;
std::vector<VkDescriptorBufferInfo> _bufferBindings;
std::vector<VkBufferView> _texelBufferBindings;
std::vector<id<MTLBuffer>> _mtlBuffers;
std::vector<NSUInteger> _mtlBufferOffsets;
std::vector<id<MTLTexture>> _mtlTextures;
std::vector<id<MTLSamplerState>> _mtlSamplers;
bool _hasDynamicSamplers;
};