diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-12-01 04:20:46 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-12-01 04:20:46 +0000 |
| commit | 1303ae5da64c35a56768edecdf60d57f7a2fe628 (patch) | |
| tree | b240850db3f521a636bdd71435a9aafda99a89c5 /Graphics/GraphicsEngineOpenGL | |
| parent | Improved type safety of different flag types (diff) | |
| download | DiligentCore-1303ae5da64c35a56768edecdf60d57f7a2fe628.tar.gz DiligentCore-1303ae5da64c35a56768edecdf60d57f7a2fe628.zip | |
Added explicit state transition flags to SetRenderTargets method
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
6 files changed, 6 insertions, 6 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h index fe4afb36..abd57cfa 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h @@ -66,7 +66,7 @@ public: virtual void SetScissorRects( Uint32 NumRects, const Rect *pRects, Uint32 RTWidth, Uint32 RTHeight )override final; - virtual void SetRenderTargets( Uint32 NumRenderTargets, ITextureView *ppRenderTargets[], ITextureView *pDepthStencil )override final; + virtual void SetRenderTargets( Uint32 NumRenderTargets, ITextureView *ppRenderTargets[], ITextureView *pDepthStencil, SET_RENDER_TARGETS_FLAGS Flags )override final; virtual void Draw( DrawAttribs &DrawAttribs )override final; diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index 872e9f0f..70041b20 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -329,7 +329,7 @@ namespace Diligent SetViewports(1, nullptr, 0, 0); } - void DeviceContextGLImpl::SetRenderTargets( Uint32 NumRenderTargets, ITextureView *ppRenderTargets[], ITextureView *pDepthStencil ) + void DeviceContextGLImpl::SetRenderTargets( Uint32 NumRenderTargets, ITextureView *ppRenderTargets[], ITextureView *pDepthStencil, SET_RENDER_TARGETS_FLAGS Flags ) { if( TDeviceContextBase::SetRenderTargets( NumRenderTargets, ppRenderTargets, pDepthStencil ) ) CommitRenderTargets(); diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp index cc959951..ea53ee57 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp @@ -128,7 +128,7 @@ void EngineFactoryOpenGLImpl::CreateDeviceAndSwapChainGL(const EngineGLAttribs& pDeviceContextOpenGL->SetSwapChain(pSwapChainGL); // Bind default framebuffer and viewport - pDeviceContextOpenGL->SetRenderTargets( 0, nullptr, nullptr ); + pDeviceContextOpenGL->SetRenderTargets( 0, nullptr, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL ); pDeviceContextOpenGL->SetViewports( 1, nullptr, 0, 0 ); } catch( const std::runtime_error & ) diff --git a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp index e58bcd89..2d46e3c0 100644 --- a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp @@ -105,7 +105,7 @@ void SwapChainGLImpl::Resize( Uint32 NewWidth, Uint32 NewHeight ) if( bIsDefaultFBBound ) { // Update framebuffer size and viewport - pImmediateCtxGL->SetRenderTargets(0, nullptr, nullptr); + pImmediateCtxGL->SetRenderTargets(0, nullptr, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL); pImmediateCtxGL->SetViewports( 1, nullptr, 0, 0 ); } } diff --git a/Graphics/GraphicsEngineOpenGL/src/TexRegionRender.cpp b/Graphics/GraphicsEngineOpenGL/src/TexRegionRender.cpp index 92ea6703..4670873c 100644 --- a/Graphics/GraphicsEngineOpenGL/src/TexRegionRender.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/TexRegionRender.cpp @@ -162,7 +162,7 @@ namespace Diligent void TexRegionRender::RestoreStates( DeviceContextGLImpl *pCtxGL ) { - pCtxGL->SetRenderTargets( m_NumRenderTargets, m_pOrigRTVs, m_pOrigDSV ); + pCtxGL->SetRenderTargets( m_NumRenderTargets, m_pOrigRTVs, m_pOrigDSV, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL ); for( Uint32 rt = 0; rt < _countof( m_pOrigRTVs ); ++rt ) { if( m_pOrigRTVs[rt] ) diff --git a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp index 29ccab1a..2ccd76bf 100644 --- a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp @@ -468,7 +468,7 @@ void TextureBaseGL :: CopyData(DeviceContextGLImpl *pDeviceCtxGL, ); ITextureView *pRTVs[] = { &RTV }; - pDeviceCtxGL->SetRenderTargets( _countof( pRTVs ), pRTVs, nullptr ); + pDeviceCtxGL->SetRenderTargets( _countof( pRTVs ), pRTVs, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL ); // No need to set up the viewport as SetRenderTargets() does that |
