diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-12-03 04:08:06 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-12-03 04:08:06 +0000 |
| commit | 57d21b1b34187df0ff1a3d31b85285fa2e21c9e5 (patch) | |
| tree | e48bb2aa8af6f9c01044f7d4a5cf6b479cb067cb /Graphics/GraphicsEngineVulkan | |
| parent | Few minor updates to VariableSizeAllocationsManager (diff) | |
| download | DiligentCore-57d21b1b34187df0ff1a3d31b85285fa2e21c9e5.tar.gz DiligentCore-57d21b1b34187df0ff1a3d31b85285fa2e21c9e5.zip | |
Added IDeviceContext::GetFrameNumber() method (API )
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
4 files changed, 4 insertions, 6 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp index 7f027c12..093ab8d9 100644 --- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp +++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp @@ -347,8 +347,6 @@ public: virtual void ResetRenderTargets() override final; - Int64 GetContextFrameNumber() const { return m_ContextFrameNumber; } - GenerateMipsVkHelper& GetGenerateMipsHelper() { return *m_GenerateMipsHelper; } QueryManagerVk* GetQueryManager() { return m_QueryMgr.get(); } diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp b/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp index 6a03cd50..0aa286a4 100644 --- a/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp +++ b/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp @@ -97,7 +97,7 @@ struct VulkanDynamicAllocation size_t AlignedOffset = 0; // Offset from the start of the buffer size_t Size = 0; // Reserved size of this allocation #ifdef DILIGENT_DEVELOPMENT - Int64 dvpFrameNumber = 0; + Uint64 dvpFrameNumber = 0; #endif }; diff --git a/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp index 3e61a756..0d41ec33 100644 --- a/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp @@ -460,9 +460,9 @@ VkAccessFlags BufferVkImpl::GetAccessFlags() const #ifdef DILIGENT_DEVELOPMENT void BufferVkImpl::DvpVerifyDynamicAllocation(DeviceContextVkImpl* pCtx) const { - auto ContextId = pCtx->GetContextId(); + const auto ContextId = pCtx->GetContextId(); const auto& DynAlloc = m_DynamicAllocations[ContextId]; - auto CurrentFrame = pCtx->GetContextFrameNumber(); + const auto CurrentFrame = pCtx->GetFrameNumber(); DEV_CHECK_ERR(DynAlloc.pDynamicMemMgr != nullptr, "Dynamic buffer '", m_Desc.Name, "' has not been mapped before its first use. Context Id: ", ContextId, ". Note: memory for dynamic buffers is allocated when a buffer is mapped."); DEV_CHECK_ERR(DynAlloc.dvpFrameNumber == CurrentFrame, "Dynamic allocation of dynamic buffer '", m_Desc.Name, "' in frame ", CurrentFrame, " is out-of-date. Note: contents of all dynamic resources is discarded at the end of every frame. A buffer must be mapped before its first use in any frame."); } diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index f2b70ff7..3520fa40 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -2444,7 +2444,7 @@ VulkanDynamicAllocation DeviceContextVkImpl::AllocateDynamicSpace(Uint32 SizeInB { auto DynAlloc = m_DynamicHeap.Allocate(SizeInBytes, Alignment); #ifdef DILIGENT_DEVELOPMENT - DynAlloc.dvpFrameNumber = m_ContextFrameNumber; + DynAlloc.dvpFrameNumber = GetFrameNumber(); #endif return DynAlloc; } |
