Map renderer blend tokens to OpenGL

This commit is contained in:
2026-06-02 18:21:52 +02:00
parent 1065183e75
commit b6c66f3e41
5 changed files with 103 additions and 2 deletions

View File

@@ -34,6 +34,11 @@ struct OpenGlTextureParameter {
std::uint32_t value = 0;
};
struct OpenGlEnumMapping {
std::uint32_t value = 0;
bool supported = false;
};
struct OpenGlReadbackFormat {
std::uint32_t pixel_format = 0;
std::uint32_t component_type = 0;
@@ -137,6 +142,10 @@ struct OpenGlWindowsWglContextConfig {
[[nodiscard]] std::uint32_t one_minus_source_alpha_blend_factor() noexcept;
[[nodiscard]] std::uint32_t add_blend_equation() noexcept;
[[nodiscard]] std::uint32_t max_blend_equation() noexcept;
[[nodiscard]] OpenGlEnumMapping blend_factor_for_renderer_factor(
pp::renderer::BlendFactor factor) noexcept;
[[nodiscard]] OpenGlEnumMapping blend_equation_for_renderer_op(
pp::renderer::BlendOp op) noexcept;
[[nodiscard]] std::uint32_t rgba8_internal_format() noexcept;
[[nodiscard]] std::uint32_t rgba16f_internal_format() noexcept;
[[nodiscard]] std::uint32_t rgba32f_internal_format() noexcept;