Move extension query mapping to renderer gl
This commit is contained in:
@@ -4,6 +4,20 @@
|
||||
#include "renderer_gl/opengl_capabilities.h"
|
||||
#include "shader.h"
|
||||
|
||||
namespace {
|
||||
|
||||
[[nodiscard]] GLenum extension_count_query() noexcept
|
||||
{
|
||||
return static_cast<GLenum>(pp::renderer::gl::extension_count_query());
|
||||
}
|
||||
|
||||
[[nodiscard]] GLenum extension_string_name() noexcept
|
||||
{
|
||||
return static_cast<GLenum>(pp::renderer::gl::extension_string_name());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void App::initShaders()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
@@ -13,14 +27,14 @@ void App::initShaders()
|
||||
|
||||
render_task([] {
|
||||
GLint n_exts;
|
||||
glGetIntegerv(GL_NUM_EXTENSIONS, &n_exts);
|
||||
glGetIntegerv(extension_count_query(), &n_exts);
|
||||
std::vector<std::string> extension_storage;
|
||||
std::vector<std::string_view> extension_views;
|
||||
extension_storage.reserve(n_exts);
|
||||
extension_views.reserve(n_exts);
|
||||
for (int i = 0; i < n_exts; i++)
|
||||
{
|
||||
extension_storage.emplace_back((const char*)glGetStringi(GL_EXTENSIONS, i));
|
||||
extension_storage.emplace_back((const char*)glGetStringi(extension_string_name(), i));
|
||||
extension_views.push_back(extension_storage.back());
|
||||
LOG("EXT: %s", extension_storage.back().c_str());
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ constexpr std::uint32_t gl_vertex_shader = 0x8B31U;
|
||||
constexpr std::uint32_t gl_compile_status = 0x8B81U;
|
||||
constexpr std::uint32_t gl_link_status = 0x8B82U;
|
||||
constexpr std::uint32_t gl_active_uniforms = 0x8B86U;
|
||||
constexpr std::uint32_t gl_extensions = 0x1F03U;
|
||||
constexpr std::uint32_t gl_num_extensions = 0x821DU;
|
||||
constexpr std::uint32_t gl_version = 0x1F02U;
|
||||
constexpr std::uint32_t gl_vendor = 0x1F00U;
|
||||
constexpr std::uint32_t gl_renderer = 0x1F01U;
|
||||
@@ -140,6 +142,16 @@ OpenGlCapabilities detect_opengl_capabilities(
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
std::uint32_t extension_count_query() noexcept
|
||||
{
|
||||
return gl_num_extensions;
|
||||
}
|
||||
|
||||
std::uint32_t extension_string_name() noexcept
|
||||
{
|
||||
return gl_extensions;
|
||||
}
|
||||
|
||||
std::uint32_t texture_upload_type_for_internal_format(std::uint32_t internal_format) noexcept
|
||||
{
|
||||
switch (internal_format) {
|
||||
|
||||
@@ -42,6 +42,8 @@ struct OpenGlReadbackFormat {
|
||||
std::span<const std::string_view> extensions,
|
||||
OpenGlRuntime runtime) noexcept;
|
||||
|
||||
[[nodiscard]] std::uint32_t extension_count_query() noexcept;
|
||||
[[nodiscard]] std::uint32_t extension_string_name() noexcept;
|
||||
[[nodiscard]] std::uint32_t texture_upload_type_for_internal_format(std::uint32_t internal_format) noexcept;
|
||||
[[nodiscard]] std::uint32_t unsigned_byte_component_type() noexcept;
|
||||
[[nodiscard]] std::uint32_t rgba_pixel_format() noexcept;
|
||||
|
||||
Reference in New Issue
Block a user