From 0cb37acdadbe609f3e0d31c990f47c4ef9c8dd31 Mon Sep 17 00:00:00 2001 From: Egor Date: Sat, 3 Nov 2018 00:40:12 -0700 Subject: Fixed multiple linux build issues in Vk backend --- .../include/DeviceContextNextGenBase.h | 2 +- Graphics/GraphicsEngineNextGenBase/include/DynamicHeap.h | 8 ++++++-- .../include/RenderDeviceNextGenBase.h | 12 +++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) (limited to 'Graphics/GraphicsEngineNextGenBase') diff --git a/Graphics/GraphicsEngineNextGenBase/include/DeviceContextNextGenBase.h b/Graphics/GraphicsEngineNextGenBase/include/DeviceContextNextGenBase.h index aaf1a615..8e3e6fa1 100644 --- a/Graphics/GraphicsEngineNextGenBase/include/DeviceContextNextGenBase.h +++ b/Graphics/GraphicsEngineNextGenBase/include/DeviceContextNextGenBase.h @@ -64,7 +64,7 @@ protected: template void EndFrame(RenderDeviceImplType& RenderDeviceImpl) { - if (m_bIsDeferred) + if (this->m_bIsDeferred) { // For deferred context, reset submitted cmd queue mask m_SubmittedBuffersCmdQueueMask = 0; diff --git a/Graphics/GraphicsEngineNextGenBase/include/DynamicHeap.h b/Graphics/GraphicsEngineNextGenBase/include/DynamicHeap.h index 7f19dea6..16fcd8b0 100644 --- a/Graphics/GraphicsEngineNextGenBase/include/DynamicHeap.h +++ b/Graphics/GraphicsEngineNextGenBase/include/DynamicHeap.h @@ -98,7 +98,11 @@ public: MasterBlockListBasedManager(IMemoryAllocator& Allocator, Uint32 Size) : m_AllocationsMgr(Size, Allocator) - {} + { +#ifdef DEVELOPMENT + m_MasterBlockCounter = 0; +#endif + } MasterBlockListBasedManager (const MasterBlockListBasedManager&) = delete; MasterBlockListBasedManager ( MasterBlockListBasedManager&&) = delete; @@ -176,7 +180,7 @@ private: VariableSizeAllocationsManager m_AllocationsMgr; #ifdef DEVELOPMENT - std::atomic_int32_t m_MasterBlockCounter = 0; + std::atomic_int32_t m_MasterBlockCounter; #endif }; diff --git a/Graphics/GraphicsEngineNextGenBase/include/RenderDeviceNextGenBase.h b/Graphics/GraphicsEngineNextGenBase/include/RenderDeviceNextGenBase.h index 0af65ece..a271a882 100644 --- a/Graphics/GraphicsEngineNextGenBase/include/RenderDeviceNextGenBase.h +++ b/Graphics/GraphicsEngineNextGenBase/include/RenderDeviceNextGenBase.h @@ -71,9 +71,9 @@ public: FenceSize), m_CmdQueueCount(CmdQueueCount) { - m_CommandQueues = reinterpret_cast(ALLOCATE(m_RawMemAllocator, "Raw memory for the device command/release queues", sizeof(CommandQueue)*m_CmdQueueCount)); + m_CommandQueues = reinterpret_cast(ALLOCATE(this->m_RawMemAllocator, "Raw memory for the device command/release queues", sizeof(CommandQueue)*m_CmdQueueCount)); for(size_t q=0; q < m_CmdQueueCount; ++q) - new(m_CommandQueues+q)CommandQueue(RefCntAutoPtr(Queues[q]), m_RawMemAllocator); + new(m_CommandQueues+q)CommandQueue(RefCntAutoPtr(Queues[q]), this->m_RawMemAllocator); } ~RenderDeviceNextGenBase() @@ -282,7 +282,7 @@ protected: DEV_CHECK_ERR(Queue.ReleaseQueue.GetPendingReleaseResourceCount() == 0, "All resources must be released before destroying a command queue"); Queue.~CommandQueue(); } - m_RawMemAllocator.Free(m_CommandQueues); + this->m_RawMemAllocator.Free(m_CommandQueues); m_CommandQueues = nullptr; } } @@ -292,7 +292,9 @@ protected: CommandQueue(RefCntAutoPtr _CmdQueue, IMemoryAllocator& Allocator)noexcept : CmdQueue (std::move(_CmdQueue)), ReleaseQueue(Allocator) - {} + { + NextCmdBufferNumber = 0; + } CommandQueue (const CommandQueue& rhs) = delete; CommandQueue ( CommandQueue&& rhs) = delete; @@ -300,7 +302,7 @@ protected: CommandQueue& operator = ( CommandQueue&& rhs) = delete; std::mutex Mtx; - Atomics::Int64 NextCmdBufferNumber = 0; + Atomics::AtomicInt64 NextCmdBufferNumber; RefCntAutoPtr CmdQueue; ResourceReleaseQueue ReleaseQueue; }; -- cgit v1.2.3