Move framebuffer blit mapping to renderer gl

This commit is contained in:
2026-06-02 06:25:14 +02:00
parent 36fea6b870
commit 9ce49ef19c
6 changed files with 55 additions and 16 deletions

View File

@@ -32,6 +32,7 @@ constexpr std::uint32_t gl_framebuffer_incomplete_read_buffer = 0x8CDCU;
constexpr std::uint32_t gl_framebuffer_unsupported = 0x8CDDU;
constexpr std::uint32_t gl_framebuffer_undefined = 0x8219U;
constexpr std::uint32_t gl_framebuffer_incomplete_multisample = 0x8D56U;
constexpr std::uint32_t gl_color_buffer_bit = 0x00004000U;
constexpr std::uint32_t gl_texture_cube_map_positive_x = 0x8515U;
constexpr std::uint32_t gl_texture_cube_map_negative_x = 0x8516U;
constexpr std::uint32_t gl_texture_cube_map_positive_y = 0x8517U;
@@ -39,6 +40,7 @@ constexpr std::uint32_t gl_texture_cube_map_negative_y = 0x8518U;
constexpr std::uint32_t gl_texture_cube_map_positive_z = 0x8519U;
constexpr std::uint32_t gl_texture_cube_map_negative_z = 0x851AU;
constexpr std::uint32_t gl_linear = 0x2601U;
constexpr std::uint32_t gl_nearest = 0x2600U;
constexpr std::uint32_t gl_texture_mag_filter = 0x2800U;
constexpr std::uint32_t gl_texture_min_filter = 0x2801U;
constexpr std::uint32_t gl_texture_wrap_s = 0x2802U;
@@ -145,6 +147,16 @@ const char* framebuffer_status_name(std::uint32_t status) noexcept
}
}
std::uint32_t framebuffer_color_buffer_mask() noexcept
{
return gl_color_buffer_bit;
}
std::uint32_t framebuffer_blit_filter(bool linear) noexcept
{
return linear ? gl_linear : gl_nearest;
}
std::uint32_t index_type_for_index_size(std::uint32_t index_size_bytes) noexcept
{
switch (index_size_bytes) {

View File

@@ -39,6 +39,8 @@ struct OpenGlTextureParameter {
[[nodiscard]] std::uint32_t texture_upload_type_for_internal_format(std::uint32_t internal_format) noexcept;
[[nodiscard]] OpenGlPixelFormat texture_format_for_channel_count(std::uint32_t channel_count) noexcept;
[[nodiscard]] const char* framebuffer_status_name(std::uint32_t status) noexcept;
[[nodiscard]] std::uint32_t framebuffer_color_buffer_mask() noexcept;
[[nodiscard]] std::uint32_t framebuffer_blit_filter(bool linear) noexcept;
[[nodiscard]] std::uint32_t index_type_for_index_size(std::uint32_t index_size_bytes) noexcept;
[[nodiscard]] std::uint32_t primitive_mode_for_fill_count(std::uint32_t vertex_or_index_count) noexcept;
[[nodiscard]] std::uint32_t primitive_mode_for_stroke_count(std::uint32_t vertex_or_index_count) noexcept;