策略抽离

This commit is contained in:
2026-08-02 16:02:15 +08:00
parent dda25f9038
commit ffaca5b05f
55 changed files with 1431 additions and 886 deletions
+17 -3
View File
@@ -2,17 +2,31 @@
#include "../architecture/Render_Config.h"
#include "../architecture/global.h"
#include "../base/Task.h"
#include <cstdint>
#include <functional>
#include <memory>
#include <taskflow/taskflow.hpp>
namespace renderive {
struct Render_Task_Graph_Node {
std::uint32_t index = UINT32_MAX;
explicit operator bool() const noexcept {
return index != UINT32_MAX;
}
};
class LIB_DECL Render_Task_Graph {
public:
explicit Render_Task_Graph(void* impl) noexcept;
[[nodiscard]] Render_Task_Graph_Node emplace(Task work);
void precede(Render_Task_Graph_Node before, Render_Task_Graph_Node after);
private:
void* impl{};
};
struct Render_Executor_Task {
using Taskflow_Builder = std::function<void(tf::Taskflow&, tf::Task, tf::Task)>;
using Graph_Builder = std::function<void(Render_Task_Graph&, Render_Task_Graph_Node, Render_Task_Graph_Node)>;
Plot_Execution_Id plot_id{};
std::uint64_t frame_id{};
Render_Task_Kind kind = Render_Task_Kind::Primitive;
Task work;
Taskflow_Builder build_taskflow;
Graph_Builder build_graph;
Task completion;
std::shared_ptr<Frame_Worker_Stats> frame_stat;
std::uint32_t logical_task_count{1};