Plan recorded renderer commands for OpenGL
This commit is contained in:
49
src/renderer_gl/command_plan.h
Normal file
49
src/renderer_gl/command_plan.h
Normal 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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user