summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-12-04 04:52:34 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-12-04 04:52:34 +0000
commitfefe45978623a7f8dd7e0496fe4877e64d875e2c (patch)
treee7ad50bdffe89a0f471bdec365d9f27698e393d7 /Graphics/GraphicsEngineD3D11
parentRemoved DRAW_FLAG_TRANSITION_VERTEX_BUFFERS, DRAW_FLAG_TRANSITION_INDEX_BUFFE... (diff)
downloadDiligentCore-fefe45978623a7f8dd7e0496fe4877e64d875e2c.tar.gz
DiligentCore-fefe45978623a7f8dd7e0496fe4877e64d875e2c.zip
Replaced SET_RENDER_TARGETS_FLAGS with RESOURCE_STATE_TRANSITION_MODE.
Removed CLEAR_DEPTH_STENCIL_TRANSITION_STATE_FLAG and CLEAR_DEPTH_STENCIL_VERIFY_STATE_FLAG
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rwxr-xr-xGraphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h14
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp19
-rw-r--r--Graphics/GraphicsEngineD3D11/src/RenderDeviceFactoryD3D11.cpp2
-rw-r--r--Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp2
4 files changed, 24 insertions, 13 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
index 445891fa..d351155c 100755
--- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
@@ -86,16 +86,20 @@ public:
virtual void SetScissorRects(Uint32 NumRects, const Rect* pRects, Uint32 RTWidth, Uint32 RTHeight)override final;
- virtual void SetRenderTargets(Uint32 NumRenderTargets,
- ITextureView* ppRenderTargets[],
- ITextureView* pDepthStencil,
- SET_RENDER_TARGETS_FLAGS Flags)override final;
+ virtual void SetRenderTargets(Uint32 NumRenderTargets,
+ ITextureView* ppRenderTargets[],
+ ITextureView* pDepthStencil,
+ RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final;
virtual void Draw(DrawAttribs& DrawAttribs)override final;
virtual void DispatchCompute(const DispatchComputeAttribs& DispatchAttrs)override final;
- virtual void ClearDepthStencil(ITextureView* pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, Uint8 Stencil)override final;
+ virtual void ClearDepthStencil(ITextureView* pView,
+ CLEAR_DEPTH_STENCIL_FLAGS ClearFlags,
+ float fDepth,
+ Uint8 Stencil,
+ RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final;
virtual void ClearRenderTarget(ITextureView* pView, const float* RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final;
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index ae00279c..01443e9d 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -861,7 +861,11 @@ namespace Diligent
m_pd3d11DeviceContext->Dispatch( DispatchAttrs.ThreadGroupCountX, DispatchAttrs.ThreadGroupCountY, DispatchAttrs.ThreadGroupCountZ );
}
- void DeviceContextD3D11Impl::ClearDepthStencil( ITextureView* pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, Uint8 Stencil )
+ void DeviceContextD3D11Impl::ClearDepthStencil(ITextureView* pView,
+ CLEAR_DEPTH_STENCIL_FLAGS ClearFlags,
+ float fDepth,
+ Uint8 Stencil,
+ RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)
{
if (pView == nullptr)
{
@@ -1554,7 +1558,10 @@ namespace Diligent
m_pd3d11DeviceContext->OMSetRenderTargets(0, nullptr, nullptr);
}
- void DeviceContextD3D11Impl::SetRenderTargets( Uint32 NumRenderTargets, ITextureView* ppRenderTargets[], ITextureView* pDepthStencil, SET_RENDER_TARGETS_FLAGS Flags )
+ void DeviceContextD3D11Impl::SetRenderTargets(Uint32 NumRenderTargets,
+ ITextureView* ppRenderTargets[],
+ ITextureView* pDepthStencil,
+ RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)
{
if (TDeviceContextBase::SetRenderTargets( NumRenderTargets, ppRenderTargets, pDepthStencil))
{
@@ -1563,14 +1570,14 @@ namespace Diligent
if (ppRenderTargets[RT])
{
auto* pTex = ValidatedCast<TextureBaseD3D11>(ppRenderTargets[RT]->GetTexture());
- if (Flags & SET_RENDER_TARGETS_FLAG_TRANSITION_COLOR)
+ if (StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_TRANSITION)
{
UnbindTextureFromInput( pTex, pTex->GetD3D11Texture() );
if (pTex->IsInKnownState())
pTex->SetState(RESOURCE_STATE_RENDER_TARGET);
}
#ifdef DEVELOPMENT
- else if (Flags & SET_RENDER_TARGETS_FLAG_VERIFY_STATES)
+ else if (StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY)
{
DvpVerifyTextureState(*pTex, RESOURCE_STATE_RENDER_TARGET, "Setting render targets (DeviceContextD3D11Impl::SetRenderTargets)");
}
@@ -1581,14 +1588,14 @@ namespace Diligent
if (pDepthStencil)
{
auto* pTex = ValidatedCast<TextureBaseD3D11>(pDepthStencil->GetTexture());
- if (Flags & SET_RENDER_TARGETS_FLAG_TRANSITION_DEPTH)
+ if (StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_TRANSITION)
{
UnbindTextureFromInput( pTex, pTex->GetD3D11Texture() );
if (pTex->IsInKnownState())
pTex->SetState(RESOURCE_STATE_DEPTH_WRITE);
}
#ifdef DEVELOPMENT
- else if(Flags & SET_RENDER_TARGETS_FLAG_VERIFY_STATES)
+ else if(StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY)
{
DvpVerifyTextureState(*pTex, RESOURCE_STATE_DEPTH_WRITE, "Setting depth-stencil buffer (DeviceContextD3D11Impl::SetRenderTargets)");
}
diff --git a/Graphics/GraphicsEngineD3D11/src/RenderDeviceFactoryD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/RenderDeviceFactoryD3D11.cpp
index ca7c9e9e..019e1885 100644
--- a/Graphics/GraphicsEngineD3D11/src/RenderDeviceFactoryD3D11.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/RenderDeviceFactoryD3D11.cpp
@@ -324,7 +324,7 @@ void EngineFactoryD3D11Impl::CreateSwapChainD3D11( IRenderDevice* pDe
pDeviceContextD3D11->SetSwapChain(pSwapChainD3D11);
// Bind default render target
- pDeviceContextD3D11->SetRenderTargets( 0, nullptr, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL );
+ pDeviceContextD3D11->SetRenderTargets( 0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION );
// Set default viewport
pDeviceContextD3D11->SetViewports( 1, nullptr, 0, 0 );
diff --git a/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp
index 20379c42..720b155f 100644
--- a/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp
@@ -182,7 +182,7 @@ void SwapChainD3D11Impl::UpdateSwapChain(bool CreateNew)
if (bIsDefaultFBBound)
{
// Set default render target and viewport
- pImmediateCtxD3D11->SetRenderTargets(0, nullptr, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL);
+ pImmediateCtxD3D11->SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
pImmediateCtxD3D11->SetViewports(1, nullptr, 0, 0);
}
}