Plan recorded renderer commands for OpenGL

This commit is contained in:
2026-06-02 20:45:03 +02:00
parent cc33fbdde2
commit ce33eaaef2
8 changed files with 441 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
#pragma once
#include "renderer_api/recording_renderer.h"
#include "renderer_gl/opengl_capabilities.h"
#include <cstdint>
namespace pp::renderer::gl {
enum class OpenGlPlannedCommandKind : std::uint8_t {
unknown,
begin_render_pass,
set_viewport,
set_scissor,
set_blend_state,
set_depth_state,
bind_texture,
bind_sampler,
bind_mesh,
draw,
blit_render_target,
end_render_pass,
trace,
passthrough,
};
struct OpenGlPlannedCommand {
OpenGlPlannedCommandKind kind = OpenGlPlannedCommandKind::unknown;
std::uint32_t clear_mask = 0;
OpenGlClearValues clear_values;
OpenGlViewportRect viewport;
OpenGlScissorRect scissor;
OpenGlBlendState blend;
OpenGlDepthState depth;
OpenGlSamplerState sampler;
OpenGlRendererTextureFormat texture_format;
OpenGlEnumMapping blit_filter;
std::uint32_t primitive_mode = 0;
std::uint32_t draw_vertex_count = 0;
std::uint32_t draw_index_count = 0;
bool requires_render_pass = false;
bool supported = false;
};
[[nodiscard]] const char* planned_command_kind_name(OpenGlPlannedCommandKind kind) noexcept;
[[nodiscard]] OpenGlPlannedCommand plan_recorded_render_command(
pp::renderer::RecordedRenderCommand command) noexcept;
}