summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-09-09 00:05:37 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-09-09 00:05:37 +0000
commit3e3a327fe4be8852400709f6b3c8677f10f075d8 (patch)
tree592193d248342b4a54a6d6b02d84c65f835d2e9d /Graphics/GraphicsEngineOpenGL
parentD3D12 backend: fixed issue with fences not being signaled if there is no comm... (diff)
downloadDiligentCore-3e3a327fe4be8852400709f6b3c8677f10f075d8.tar.gz
DiligentCore-3e3a327fe4be8852400709f6b3c8677f10f075d8.zip
Renamed IDeviceContext::Wait to IDeviceContext::WaitForFence (updated API version to 240027). Added FlushContext parameter to the methods
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp4
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/FenceGLImpl.cpp4
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp2
5 files changed, 7 insertions, 7 deletions
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<std::pair<Uint64, GLObjectWrappers::GLSyncObj> > 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<FenceGLImpl>(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<GLuint64>::max());
+ auto res = glClientWaitSync(val_fence.second, FlushCommands ? GL_SYNC_FLUSH_COMMANDS_BIT : 0, std::numeric_limits<GLuint64>::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<GLint>(LastBlock.ArraySize));
- VERIFY(SBIndex == LastBlock.SBIndex + Ind, "Storage block indices are expected to be continuous");
+ VERIFY(static_cast<GLuint>(SBIndex) == LastBlock.SBIndex + Ind, "Storage block indices are expected to be continuous");
LastBlock.ArraySize = ArraySize;
continue;
}