diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-11-18 21:07:09 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-11-18 21:07:09 +0000 |
| commit | a55206ac29c47ca2765040a7339468f7b6a530c7 (patch) | |
| tree | 85ab32d391623c16bee8e19ad1cbb4f722f2f8d8 /Graphics/GraphicsEngineOpenGL | |
| parent | Updated comment (diff) | |
| download | DiligentCore-a55206ac29c47ca2765040a7339468f7b6a530c7.tar.gz DiligentCore-a55206ac29c47ca2765040a7339468f7b6a530c7.zip | |
Added explicit resource state transitions to the API; implemented in D3D12
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
5 files changed, 37 insertions, 22 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h index 34e126e3..6727bfb2 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h @@ -80,6 +80,8 @@ public: virtual void FinishFrame()override final; + virtual void TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers)override final; + virtual void FinishCommandList(class ICommandList **ppCommandList)override final; virtual void ExecuteCommandList(class ICommandList *pCommandList)override final; diff --git a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h index 941c066b..4824d23e 100644 --- a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h @@ -76,9 +76,9 @@ public: virtual void CreateFence(const FenceDesc& Desc, IFence** ppFence)override final; - virtual void CreateTextureFromGLHandle(Uint32 GLHandle, const TextureDesc &TexDesc, ITexture **ppTexture)override final; + virtual void CreateTextureFromGLHandle(Uint32 GLHandle, const TextureDesc &TexDesc, RESOURCE_STATE InitialState, ITexture **ppTexture)override final; - virtual void CreateBufferFromGLHandle(Uint32 GLHandle, const BufferDesc &BuffDesc, IBuffer **ppBuffer)override final; + virtual void CreateBufferFromGLHandle(Uint32 GLHandle, const BufferDesc &BuffDesc, RESOURCE_STATE InitialState, IBuffer **ppBuffer)override final; virtual void ReleaseStaleResources(bool ForceRelease = false)override final {} diff --git a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h index 605d866f..5dbe5129 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h @@ -43,31 +43,39 @@ public: /// Creates a texture from OpenGL handle - /// \param [in] GLHandle - OpenGL texture handle - /// \param [in] TexDesc - Texture description. The engine can automatically - /// set texture width, height, depth, mip levels count, and format. - /// Remaining fields should be set up by the app. - /// \param [out] ppTexture - Address of the memory location where the pointer to the - /// texture interface will be stored. - /// The function calls AddRef(), so that the new object will contain - /// one refernce. + /// \param [in] GLHandle - OpenGL texture handle + /// \param [in] TexDesc - Texture description. The engine can automatically + /// set texture width, height, depth, mip levels count, and format. + /// Remaining fields should be set up by the app. + /// \param [in] InitialState - Initial texture state. See Diligent::RESOURCE_STATE. + /// \param [out] ppTexture - Address of the memory location where the pointer to the + /// texture interface will be stored. + /// The function calls AddRef(), so that the new object will contain + /// one refernce. /// \note Diligent engine texture object does not take ownership of the GL resource, /// and the application must not destroy it while it is in use by the engine. - virtual void CreateTextureFromGLHandle(Uint32 GLHandle, const TextureDesc &TexDesc, ITexture **ppTexture) = 0; + virtual void CreateTextureFromGLHandle(Uint32 GLHandle, + const TextureDesc& TexDesc, + RESOURCE_STATE InitialState, + ITexture** ppTexture) = 0; /// Creates a buffer from OpenGL handle - /// \param [in] GLHandle - OpenGL buffer handle - /// \param [in] BuffDesc - Buffer description. The engine can automatically - /// recover buffer size, but the rest of the fields need to - /// be set by the client. - /// \param [out] ppBuffer - Address of the memory location where the pointer to the - /// texture interface will be stored. - /// The function calls AddRef(), so that the new object will contain - /// one refernce. + /// \param [in] GLHandle - OpenGL buffer handle + /// \param [in] BuffDesc - Buffer description. The engine can automatically + /// recover buffer size, but the rest of the fields need to + /// be set by the client. + /// \param [in] InitialState - Initial buffer state. See Diligent::RESOURCE_STATE. + /// \param [out] ppBuffer - Address of the memory location where the pointer to the + /// texture interface will be stored. + /// The function calls AddRef(), so that the new object will contain + /// one refernce. /// \note Diligent engine buffer object does not take ownership of the GL resource, /// and the application must not destroy it while it is in use by the engine. - virtual void CreateBufferFromGLHandle(Uint32 GLHandle, const BufferDesc &BuffDesc, IBuffer **ppBuffer) = 0; + virtual void CreateBufferFromGLHandle(Uint32 GLHandle, + const BufferDesc& BuffDesc, + RESOURCE_STATE InitialState, + IBuffer** ppBuffer) = 0; }; } diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index 00c31a42..946f8ee9 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -1010,4 +1010,9 @@ namespace Diligent m_ContextState.SetCurrentGLContext(NativeGLContext); return true; } + + void DeviceContextGLImpl::TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers) + { + + } } diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp index f10a4277..3adbb081 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp @@ -121,7 +121,7 @@ void RenderDeviceGLImpl :: CreateBuffer(const BufferDesc& BuffDesc, const Buffer CreateBuffer(BuffDesc, BuffData, ppBuffer, false); } -void RenderDeviceGLImpl :: CreateBufferFromGLHandle(Uint32 GLHandle, const BufferDesc& BuffDesc, IBuffer **ppBuffer) +void RenderDeviceGLImpl :: CreateBufferFromGLHandle(Uint32 GLHandle, const BufferDesc& BuffDesc, RESOURCE_STATE InitialState, IBuffer **ppBuffer) { VERIFY(GLHandle, "GL buffer handle must not be null"); CreateDeviceObject( "buffer", BuffDesc, ppBuffer, @@ -222,7 +222,7 @@ void RenderDeviceGLImpl::CreateTexture(const TextureDesc& TexDesc, const Texture CreateTexture(TexDesc, Data, ppTexture, false); } -void RenderDeviceGLImpl::CreateTextureFromGLHandle(Uint32 GLHandle, const TextureDesc& TexDesc, ITexture **ppTexture) +void RenderDeviceGLImpl::CreateTextureFromGLHandle(Uint32 GLHandle, const TextureDesc& TexDesc, RESOURCE_STATE InitialState, ITexture **ppTexture) { VERIFY(GLHandle, "GL texture handle must not be null"); CreateDeviceObject( "texture", TexDesc, ppTexture, |
