From 3e3a327fe4be8852400709f6b3c8677f10f075d8 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 8 Sep 2019 17:05:37 -0700 Subject: Renamed IDeviceContext::Wait to IDeviceContext::WaitForFence (updated API version to 240027). Added FlushContext parameter to the methods --- Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h | 2 +- Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h | 2 +- Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp | 4 ++-- Graphics/GraphicsEngineOpenGL/src/FenceGLImpl.cpp | 4 ++-- Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h index 3d64ad3f..7b1931b1 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h @@ -150,7 +150,7 @@ public: virtual void SignalFence(IFence* pFence, Uint64 Value)override final; - virtual void Wait(IFence* pFence, Uint64 Value)override final; + virtual void WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext)override final; virtual bool UpdateCurrentGLContext()override final; diff --git a/Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h index bade8fd1..76ace185 100644 --- a/Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h @@ -59,7 +59,7 @@ public: m_PendingFences.emplace_back(Value, std::move(Fence)); } - void Wait(Uint64 Value); + void Wait(Uint64 Value, bool FlushCommands); private: std::deque > m_PendingFences; diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index ec77379d..23836746 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -1075,11 +1075,11 @@ namespace Diligent pFenceGLImpl->AddPendingFence(std::move(GLFence), Value); } - void DeviceContextGLImpl::Wait(IFence* pFence, Uint64 Value) + void DeviceContextGLImpl::WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext) { VERIFY(!m_bIsDeferred, "Fence can only be waited from immediate context"); auto* pFenceGLImpl = ValidatedCast(pFence); - pFenceGLImpl->Wait(Value); + pFenceGLImpl->Wait(Value, FlushContext); } bool DeviceContextGLImpl::UpdateCurrentGLContext() diff --git a/Graphics/GraphicsEngineOpenGL/src/FenceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/FenceGLImpl.cpp index 7e39aa2f..d2b53d20 100644 --- a/Graphics/GraphicsEngineOpenGL/src/FenceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/FenceGLImpl.cpp @@ -64,7 +64,7 @@ Uint64 FenceGLImpl :: GetCompletedValue() return m_LastCompletedFenceValue; } -void FenceGLImpl :: Wait(Uint64 Value) +void FenceGLImpl :: Wait(Uint64 Value, bool FlushCommands) { while (!m_PendingFences.empty()) { @@ -72,7 +72,7 @@ void FenceGLImpl :: Wait(Uint64 Value) if (val_fence.first > Value) break; - auto res = glClientWaitSync(val_fence.second, GL_SYNC_FLUSH_COMMANDS_BIT, std::numeric_limits::max()); + auto res = glClientWaitSync(val_fence.second, FlushCommands ? GL_SYNC_FLUSH_COMMANDS_BIT : 0, std::numeric_limits::max()); VERIFY_EXPR(res == GL_ALREADY_SIGNALED || res == GL_CONDITION_SATISFIED); if (val_fence.first > m_LastCompletedFenceValue) diff --git a/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp b/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp index 5fc43abd..1850255d 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(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