Plan recorded OpenGL command streams

This commit is contained in:
2026-06-02 20:48:49 +02:00
parent ce33eaaef2
commit 9a4c595f64
5 changed files with 242 additions and 4 deletions

View File

@@ -3,7 +3,10 @@
#include "renderer_api/recording_renderer.h"
#include "renderer_gl/opengl_capabilities.h"
#include <cstddef>
#include <cstdint>
#include <span>
#include <vector>
namespace pp::renderer::gl {
@@ -42,8 +45,26 @@ struct OpenGlPlannedCommand {
bool supported = false;
};
struct OpenGlCommandPlan {
static constexpr std::size_t npos = static_cast<std::size_t>(-1);
std::vector<OpenGlPlannedCommand> commands;
std::uint32_t render_pass_count = 0;
std::uint32_t draw_command_count = 0;
std::uint32_t passthrough_command_count = 0;
std::uint32_t trace_command_count = 0;
std::uint32_t unsupported_command_count = 0;
std::uint32_t render_pass_order_error_count = 0;
std::size_t first_unsupported_command = npos;
std::size_t first_render_pass_order_error = npos;
bool ended_in_render_pass = false;
bool supported = true;
};
[[nodiscard]] const char* planned_command_kind_name(OpenGlPlannedCommandKind kind) noexcept;
[[nodiscard]] OpenGlPlannedCommand plan_recorded_render_command(
pp::renderer::RecordedRenderCommand command) noexcept;
[[nodiscard]] OpenGlCommandPlan plan_recorded_render_commands(
std::span<const pp::renderer::RecordedRenderCommand> commands);
}