Reduce memory usage by replacing use of MVKVectorDefault
with std::vector in descriptor set bindings.
diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md
index 01303ad..d433658 100644
--- a/Docs/Whats_New.md
+++ b/Docs/Whats_New.md
@@ -25,7 +25,8 @@
- 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.
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.h b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.h
index 41ef3cb..9f03ef4 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.h
@@ -24,6 +24,7 @@
#include <MoltenVKSPIRVToMSLConverter/SPIRVToMSLConverter.h>
#include <unordered_set>
#include <unordered_map>
+#include <vector>
class MVKDescriptorPool;
class MVKDescriptorBinding;
@@ -117,7 +118,7 @@
MVKDescriptorSetLayout* _layout;
VkDescriptorSetLayoutBinding _info;
- MVKVectorDefault<MVKSampler*> _immutableSamplers;
+ std::vector<MVKSampler*> _immutableSamplers;
MVKShaderResourceBinding _mtlResourceIndexOffsets;
bool _applyToStage[kMVKShaderStageMax];
};
@@ -271,13 +272,13 @@
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;
};