Files
Renderive/Core/execution/Render_Executor.h
T
2026-08-02 00:06:33 +08:00

40 lines
1.0 KiB
C++

#pragma once
#include "../architecture/Render_Config.h"
#include "../architecture/global.h"
#include "../base/Task.h"
#include <memory>
namespace renderive {
struct Render_Executor_Task {
Plot_Execution_Id plot_id{};
std::uint64_t frame_id{};
Render_Task_Kind kind = Render_Task_Kind::Primitive;
Task work;
Task completion;
std::shared_ptr<Frame_Worker_Stat> frame_stat;
bool frame_job{};
};
class Render_Executor_Private;
class LIB_DECL Render_Executor {
public:
explicit Render_Executor(Render_Runtime_Config config = {});
Render_Executor(const Render_Executor&) = delete;
Render_Executor& operator=(const Render_Executor&) = delete;
~Render_Executor();
bool try_submit(Render_Executor_Task task);
void shutdown();
[[nodiscard]] Render_Executor_Snapshot snapshot() const;
[[nodiscard]] std::size_t worker_count() const;
private:
std::unique_ptr<Render_Executor_Private> d;
};
std::size_t resolve_render_worker_count(std::size_t configured_count);
} // namespace renderive