Share retained runtime GL dispatch
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "app.h"
|
||||
#include "legacy_gl_runtime_dispatch.h"
|
||||
#include "renderer_api/shader_catalog.h"
|
||||
#include "renderer_gl/opengl_capabilities.h"
|
||||
#include "shader.h"
|
||||
@@ -16,19 +17,6 @@ void apply_shader_manager_feature_state(pp::renderer::gl::OpenGlFeatureState fea
|
||||
ShaderManager::set_render_device_features(feature_state.features);
|
||||
}
|
||||
|
||||
void query_gl_integer(std::uint32_t name, std::int32_t* value) noexcept
|
||||
{
|
||||
GLint queried_value = 0;
|
||||
glGetIntegerv(static_cast<GLenum>(name), &queried_value);
|
||||
*value = static_cast<std::int32_t>(queried_value);
|
||||
}
|
||||
|
||||
const char* query_gl_string_indexed(std::uint32_t name, std::uint32_t index) noexcept
|
||||
{
|
||||
return reinterpret_cast<const char*>(
|
||||
glGetStringi(static_cast<GLenum>(name), static_cast<GLuint>(index)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void App::initShaders()
|
||||
@@ -40,10 +28,7 @@ void App::initShaders()
|
||||
|
||||
render_task([] {
|
||||
const auto detection_result = pp::renderer::gl::query_opengl_capability_detection(
|
||||
pp::renderer::gl::OpenGlExtensionQueryDispatch {
|
||||
.get_integer = query_gl_integer,
|
||||
.get_string_indexed = query_gl_string_indexed,
|
||||
},
|
||||
pp::legacy::gl_runtime::extension_query_dispatch(),
|
||||
pp::renderer::gl::opengl_runtime_for_current_build());
|
||||
if (!detection_result.ok()) {
|
||||
LOG("OpenGL capability detection failed: %s", detection_result.status().message);
|
||||
|
||||
Reference in New Issue
Block a user