summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-12-01 18:42:38 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-12-01 18:42:38 +0000
commit97a72224ba1788ade4890b3f737f150b240610e1 (patch)
treed0dc4e3e2290ccd7368d97e49ba597b8dac19b80 /Graphics/GraphicsEngine
parentUpdated SetRenderTargets() in Vk backend to only transitin states. CommitRend... (diff)
downloadDiligentCore-97a72224ba1788ade4890b3f737f150b240610e1.tar.gz
DiligentCore-97a72224ba1788ade4890b3f737f150b240610e1.zip
Added explicit state transition mode to ClearRenderTarget() command
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/DeviceContext.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h
index 236d5e51..7c95e5c5 100644
--- a/Graphics/GraphicsEngine/interface/DeviceContext.h
+++ b/Graphics/GraphicsEngine/interface/DeviceContext.h
@@ -294,6 +294,26 @@ enum SET_RENDER_TARGETS_FLAGS
};
DEFINE_FLAG_ENUM_OPERATORS(SET_RENDER_TARGETS_FLAGS)
+/// Defines state transitions performed by IDeviceContext::ClearRenderTarget() command
+enum CLEAR_RENDER_TARGET_STATE_TRANSITION_MODE
+{
+ /// Perform no state transitions
+ CLEAR_RENDER_TARGET_NO_TRANSITION = 0,
+
+ /// Transition the render target to the required state.
+ /// \remarks In D3D12 backend, the render target must always be transitioned to
+ /// Diligent::RESOURCE_STATE_RENDER_TARGET state. In Vulkan backend
+ /// however this depends on whether the render pass has been started.
+ /// To clear render target outside of render pass, it must be in
+ /// Diligent::RESOURCE_STATE_COPY_DEST state. Inside a render pass it
+ /// must be in Diligent::RESOURCE_STATE_RENDER_TARGET state.
+ CLEAR_RENDER_TARGET_TRANSITION_STATE,
+
+ /// Do not perform transition, but verify that the state is correct.
+ /// This flag only has effect in debug and development builds. No validation
+ /// is performed in release build.
+ CLEAR_RENDER_TARGET_VERIFY_STATE
+};
/// Describes the viewport.
@@ -599,7 +619,7 @@ public:
/// If nullptr is provided, the default array {0,0,0,0} will be used.
/// \remarks The full extent of the view is always cleared. Viewport and scissor settings are not applied.
/// \note The render target view must be bound to the pipeline for clear operation to be performed.
- virtual void ClearRenderTarget(ITextureView* pView, const float* RGBA = nullptr) = 0;
+ virtual void ClearRenderTarget(ITextureView* pView, const float* RGBA, CLEAR_RENDER_TARGET_STATE_TRANSITION_MODE StateTransitionMode) = 0;
/// Finishes recording commands and generates a command list