From d06553e2b4700aa026acd4445a598eadf10dfb35 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 8 Sep 2019 17:42:51 -0700 Subject: Added IDeviceContext::WaitForIdle() method (updated API version to 240028) --- Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h | 6 ++++-- Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp | 6 ++++++ Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h index 7b1931b1..601976ee 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h @@ -95,8 +95,6 @@ public: virtual void ClearRenderTarget(ITextureView* pView, const float* RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final; - virtual void Flush()override final; - virtual void UpdateBuffer(IBuffer* pBuffer, Uint32 Offset, Uint32 Size, @@ -152,6 +150,10 @@ public: virtual void WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext)override final; + virtual void WaitForIdle()override final; + + virtual void Flush()override final; + virtual bool UpdateCurrentGLContext()override final; void BindProgramResources(Uint32& NewMemoryBarriers, IShaderResourceBinding* pResBinding); diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index 23836746..94537d40 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -1082,6 +1082,12 @@ namespace Diligent pFenceGLImpl->Wait(Value, FlushContext); } + void DeviceContextGLImpl::WaitForIdle() + { + VERIFY(!m_bIsDeferred, "Only immediate contexts can be idled"); + glFinish(); + } + bool DeviceContextGLImpl::UpdateCurrentGLContext() { auto* pRenderDeviceGL = m_pDevice.RawPtr(); diff --git a/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp b/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp index 1850255d..a8f55e27 100644 --- a/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp @@ -583,7 +583,7 @@ namespace Diligent if ( strcmp(LastBlock.Name, Name.data()) == 0) { ArraySize = std::max(ArraySize, static_cast(LastBlock.ArraySize)); - VERIFY(static_cast(SBIndex) == LastBlock.SBIndex + Ind, "Storage block indices are expected to be continuous"); + VERIFY(static_cast(SBIndex) == LastBlock.SBIndex + Ind, "Storage block indices are expected to be continuous"); LastBlock.ArraySize = ArraySize; continue; } -- cgit v1.2.3