107 lines
2.9 KiB
C++
107 lines
2.9 KiB
C++
#pragma once
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
namespace renderive {
|
|
using Plot_Execution_Id = std::uint64_t;
|
|
|
|
enum class Render_Task_Kind : std::uint8_t {
|
|
Frame,
|
|
Curve,
|
|
Waterfall,
|
|
Primitive,
|
|
Compose,
|
|
Performance
|
|
};
|
|
|
|
struct Render_Runtime_Config {
|
|
std::size_t worker_count{};
|
|
};
|
|
|
|
struct Render_Executor_Snapshot {
|
|
std::size_t worker_count{};
|
|
std::size_t active_workers{};
|
|
std::size_t idle_workers{};
|
|
std::size_t active_frame_jobs{};
|
|
std::size_t queued_frame_jobs{};
|
|
std::uint64_t submitted_tasks{};
|
|
std::uint64_t started_tasks{};
|
|
std::uint64_t completed_tasks{};
|
|
std::uint64_t rejected_frame_jobs{};
|
|
std::uint64_t dropped_frame_attempts{};
|
|
std::uint64_t peak_concurrency{};
|
|
std::uint64_t average_queue_wait_ns{};
|
|
std::uint64_t p95_queue_wait_ns{};
|
|
std::uint64_t average_task_duration_ns{};
|
|
std::uint64_t p95_task_duration_ns{};
|
|
std::uint64_t curve_tasks{};
|
|
std::uint64_t waterfall_tasks{};
|
|
std::uint64_t primitive_tasks{};
|
|
std::uint64_t compose_tasks{};
|
|
std::uint64_t performance_tasks{};
|
|
};
|
|
|
|
struct Frame_Worker_Stat {
|
|
Render_Executor_Snapshot executor_at_submit;
|
|
Render_Executor_Snapshot executor_at_finish;
|
|
std::uint32_t task_count{};
|
|
std::uint32_t peak_parallelism{};
|
|
std::uint64_t queue_wait_total_ns{};
|
|
std::uint64_t queue_wait_max_ns{};
|
|
std::uint64_t worker_run_total_ns{};
|
|
std::uint64_t parallel_stage_wall_ns{};
|
|
std::uint64_t rejected_task_count{};
|
|
};
|
|
|
|
enum class Refresh_Limit_Source : std::uint8_t {
|
|
Unknown,
|
|
Render,
|
|
Paint,
|
|
User
|
|
};
|
|
|
|
enum Frame_Role : std::uint8_t {
|
|
Frame_Rendering,
|
|
Frame_Middle,
|
|
Frame_Painting
|
|
};
|
|
|
|
enum class Frame_Outcome : std::uint8_t {
|
|
Presented,
|
|
Superseded,
|
|
Render_Acquire_Dropped,
|
|
Publish_Dropped,
|
|
Paint_Acquire_Dropped,
|
|
Worker_Budget_Dropped,
|
|
Cancelled
|
|
};
|
|
/// @brief Rendering cache strategy for a renderable subtree.
|
|
enum class Renderable_Cache_Mode : std::uint8_t {
|
|
/// @brief Draw directly into the target painter each frame.
|
|
Direct,
|
|
/// @brief Rebuild a local image cache when state changes, then compose it.
|
|
Local_Pixel
|
|
};
|
|
/// @brief Internal state triple-buffer role.
|
|
enum State_Role : std::uint8_t {
|
|
/// @brief Editable configuration state.
|
|
State_Edit,
|
|
/// @brief Committed state ready for the render thread.
|
|
State_Ready,
|
|
/// @brief State currently used by the render thread.
|
|
State_Render
|
|
};
|
|
/// @brief Internal input triple-buffer role.
|
|
enum Input_Role : std::uint8_t {
|
|
/// @brief Input buffer receiving caller submissions.
|
|
Input_Edit,
|
|
/// @brief Input buffer ready for render-thread consumption.
|
|
Input_Ready,
|
|
/// @brief Input buffer currently consumed by the render thread.
|
|
Input_Render
|
|
};
|
|
/// @brief Internal color-frame triple-buffer role.
|
|
inline bool buffer_version_newer(std::uint64_t a, std::uint64_t b) {
|
|
return static_cast<std::int64_t>(a - b) > 0;
|
|
}
|
|
} // namespace renderive
|