Route VR texture state through GL dispatch

This commit is contained in:
2026-06-04 23:54:15 +02:00
parent 3cd1d46025
commit c514ac99aa
4 changed files with 30 additions and 9 deletions

View File

@@ -11,12 +11,30 @@ namespace {
void set_active_texture_unit(std::uint32_t unit_index)
{
glActiveTexture(pp::renderer::gl::active_texture_unit(unit_index));
const auto status = pp::renderer::gl::activate_opengl_texture_unit(
unit_index,
pp::renderer::gl::OpenGlActiveTextureDispatch {
.active_texture = [](std::uint32_t texture_unit) noexcept
{
glActiveTexture(static_cast<GLenum>(texture_unit));
},
});
if (!status.ok())
LOG("OpenGL VR active texture dispatch failed: %s", status.message);
}
void unbind_texture_2d()
{
glBindTexture(pp::renderer::gl::texture_2d_target(), 0);
const auto status = pp::renderer::gl::bind_opengl_texture_2d(
0U,
pp::renderer::gl::OpenGlTexture2DBindDispatch {
.bind_texture = [](std::uint32_t target, std::uint32_t texture) noexcept
{
glBindTexture(static_cast<GLenum>(target), static_cast<GLuint>(texture));
},
});
if (!status.ok())
LOG("OpenGL VR texture unbind dispatch failed: %s", status.message);
}
void enable_opengl_state(std::uint32_t state) noexcept