Fix memory leaks when compiling shaders and pipelines without default OS autorelease pool.
Wrap MVKMetalCompiler compiling execution in an @autoreleasepool.
This commit is contained in:
parent
c6f5a09004
commit
1d628baca4
@ -24,6 +24,7 @@ Released TBD
|
|||||||
- Add request for feedback from people who reject **MoltenVK** to `README.md` document.
|
- Add request for feedback from people who reject **MoltenVK** to `README.md` document.
|
||||||
- Allow `MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS` build setting to be overridden.
|
- 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 of system classes during `VkInstance` and `VkQueue` creation.
|
||||||
|
- Fix memory leaks when compiling shaders and pipelines without default OS autorelease pool.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ void MVKMetalCompiler::compile(unique_lock<mutex>& lock, dispatch_block_t block)
|
|||||||
MVKDevice* mvkDev = _owner->getDevice();
|
MVKDevice* mvkDev = _owner->getDevice();
|
||||||
_startTime = mvkDev->getPerformanceTimestamp();
|
_startTime = mvkDev->getPerformanceTimestamp();
|
||||||
|
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ @autoreleasepool { block(); } });
|
||||||
|
|
||||||
// Limit timeout to avoid overflow since wait_for() uses wait_until()
|
// Limit timeout to avoid overflow since wait_for() uses wait_until()
|
||||||
chrono::nanoseconds nanoTimeout(min(mvkDev->_pMVKConfig->metalCompileTimeout, kMVKUndefinedLargeUInt64));
|
chrono::nanoseconds nanoTimeout(min(mvkDev->_pMVKConfig->metalCompileTimeout, kMVKUndefinedLargeUInt64));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user