Files
panopainter/src/renderer_gl/opengl_capabilities.h

37 lines
922 B
C++

#pragma once
#include <cstdint>
#include <span>
#include <string_view>
namespace pp::renderer::gl {
struct OpenGlRuntime {
bool desktop_gl = false;
bool gles = false;
bool web = false;
};
struct OpenGlCapabilities {
bool framebuffer_fetch = false;
bool map_buffer_alignment = false;
bool float32_textures = false;
bool float32_linear = false;
bool float16_textures = false;
};
struct OpenGlPixelFormat {
std::uint32_t internal_format = 0;
std::uint32_t pixel_format = 0;
std::uint32_t channel_count = 0;
};
[[nodiscard]] OpenGlCapabilities detect_opengl_capabilities(
std::span<const std::string_view> extensions,
OpenGlRuntime runtime) noexcept;
[[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;
}