summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-11-22 21:33:34 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-11-22 21:33:34 +0000
commit39852e8b8bdc08b65a1b9baabbe7e2167eae5fdb (patch)
tree8aa13b10d17eed55d60afc1f598df6a18c6e867a /Graphics/GraphicsEngine
parentCMake: few updates to support Metal backend (diff)
downloadDiligentCore-39852e8b8bdc08b65a1b9baabbe7e2167eae5fdb.tar.gz
DiligentCore-39852e8b8bdc08b65a1b9baabbe7e2167eae5fdb.zip
Removed autorelease pool from unit tests: Metal backend now catches all autoreleased objects automatically
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/BlendState.h3
-rw-r--r--Graphics/GraphicsEngine/interface/GraphicsTypes.h19
2 files changed, 22 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngine/interface/BlendState.h b/Graphics/GraphicsEngine/interface/BlendState.h
index 2dd843ec..50feb22c 100644
--- a/Graphics/GraphicsEngine/interface/BlendState.h
+++ b/Graphics/GraphicsEngine/interface/BlendState.h
@@ -171,6 +171,9 @@ DILIGENT_TYPED_ENUM(BLEND_OPERATION, Int8)
/// writable components of the render target
DILIGENT_TYPED_ENUM(COLOR_MASK, Int8)
{
+ /// Do not store any components.
+ COLOR_MASK_NONE = 0,
+
/// Allow data to be stored in the red component.
COLOR_MASK_RED = 1,
diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
index d85540ac..41fd8210 100644
--- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h
+++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
@@ -2258,6 +2258,25 @@ struct EngineMtlCreateInfo DILIGENT_DERIVE(EngineCreateInfo)
/// resource manager and then suballocate from this chunk in a lock-free
/// fashion. DynamicHeapPageSize defines the size of this chunk.
Uint32 DynamicHeapPageSize DEFAULT_INITIALIZER(4 << 20);
+
+
+ /// Indicates if device contexts should automatically manage autorelease pools.
+
+ /// Metal API creates a lot of autoreleased objects. By default, the engine
+ /// will catch all these objects by pushing autorelease pools where necessary.
+ /// When UseAutoreleasePoolsInContexts is set to false, the engine will not use
+ /// autorelease pools in device contexts and the application will be responsible
+ /// for ensuring that all context commands are issued from within an autorelease
+ /// pool to avoid memory leaks.
+ ///
+ /// \note Autorelease pool is pushed by the first command of the device context
+ /// that needs it and popped by IDeviceContext::FinishFrame().
+ /// The method must always be called from the same thread that
+ /// issued the context commands.
+ ///
+ /// Creating device objects will not leak memory even when
+ /// UseAutoreleasePoolsInContexts is set to false.
+ bool UseAutoreleasePoolsInContexts DEFAULT_INITIALIZER(true);
};
typedef struct EngineMtlCreateInfo EngineMtlCreateInfo;