6#include <Common/assertion.h>
35 virtual void doWork() = 0;
37 std::atomic_uint32_t m_totalWork;
38 std::atomic_uint32_t m_workDone;
39 std::atomic_uint32_t m_elapsedMs;
51 m_totalWork(other.m_totalWork.load(
std::memory_order_relaxed)),
52 m_workDone (other.m_workDone.load(
std::memory_order_relaxed)),
53 m_elapsedMs(other.m_elapsedMs.load(
std::memory_order_relaxed))
60 PH_ASSERT_LE(totalWork, std::numeric_limits<std::uint32_t>::max());
62 m_totalWork.store(
static_cast<std::uint32_t
>(totalWork), std::memory_order_relaxed);
67 PH_ASSERT_LE(workDone, std::numeric_limits<std::uint32_t>::max());
69 m_workDone.store(
static_cast<std::uint32_t
>(workDone), std::memory_order_relaxed);
74 m_workDone.fetch_add(1, std::memory_order_relaxed);
79 PH_ASSERT_LE(elapsedMs, std::numeric_limits<std::uint32_t>::max());
81 m_elapsedMs.store(
static_cast<std::uint32_t
>(elapsedMs), std::memory_order_relaxed);
87 m_totalWork.load(std::memory_order_relaxed),
88 m_workDone.load(std::memory_order_relaxed),
89 m_elapsedMs.load(std::memory_order_relaxed));
94 m_totalWork = rhs.m_totalWork.load(std::memory_order_relaxed);
95 m_workDone = rhs.m_workDone.load(std::memory_order_relaxed);
96 m_elapsedMs = rhs.m_elapsedMs.load(std::memory_order_relaxed);
Definition RenderProgress.h:12
Definition RenderWork.h:16
void incrementWorkDone()
Definition RenderWork.h:72
RenderWork()
Definition RenderWork.h:44
RenderProgress asyncGetProgress() const
Definition RenderWork.h:84
void work()
Definition RenderWork.cpp:8
void setWorkDone(std::size_t workDone)
Definition RenderWork.h:65
RenderWork & operator=(const RenderWork &rhs)
Definition RenderWork.h:92
void setElapsedMs(std::size_t elapsedMs)
Definition RenderWork.h:77
void setTotalWork(std::size_t totalWork)
Definition RenderWork.h:58
The root for all renderer implementations.
Definition EEngineProject.h:6