diff options
Diffstat (limited to 'Graphics/GraphicsTools')
| -rw-r--r-- | Graphics/GraphicsTools/include/ScreenCapture.h | 1 | ||||
| -rw-r--r-- | Graphics/GraphicsTools/src/ScreenCapture.cpp | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Graphics/GraphicsTools/include/ScreenCapture.h b/Graphics/GraphicsTools/include/ScreenCapture.h index b49eedab..019bfa2a 100644 --- a/Graphics/GraphicsTools/include/ScreenCapture.h +++ b/Graphics/GraphicsTools/include/ScreenCapture.h @@ -54,6 +54,7 @@ public: }; CaptureInfo GetCapture(); + bool HasCapture(); void RecycleStagingTexture(RefCntAutoPtr<ITexture>&& pTexture); diff --git a/Graphics/GraphicsTools/src/ScreenCapture.cpp b/Graphics/GraphicsTools/src/ScreenCapture.cpp index bcd87495..10455531 100644 --- a/Graphics/GraphicsTools/src/ScreenCapture.cpp +++ b/Graphics/GraphicsTools/src/ScreenCapture.cpp @@ -104,6 +104,21 @@ ScreenCapture::CaptureInfo ScreenCapture::GetCapture() return Capture; } +bool ScreenCapture::HasCapture() +{ + std::lock_guard<std::mutex> Lock{m_PendingTexturesMtx}; + if (!m_PendingTextures.empty()) + { + const auto& OldestCapture = m_PendingTextures.front(); + auto CompletedFenceValue = m_pFence->GetCompletedValue(); + return OldestCapture.Fence <= CompletedFenceValue; + } + else + { + return false; + } +} + void ScreenCapture::RecycleStagingTexture(RefCntAutoPtr<ITexture>&& pTexture) { std::lock_guard<std::mutex> Lock{m_AvailableTexturesMtx}; |
