Route remaining shader setup through helpers

This commit is contained in:
2026-06-13 06:22:39 +02:00
parent 05b721bce6
commit 493282264d
9 changed files with 132 additions and 64 deletions

View File

@@ -1,6 +1,7 @@
#include "pch.h"
#include "canvas_layer.h"
#include "app.h"
#include "legacy_canvas_draw_merge_services.h"
#include "legacy_ui_gl_dispatch.h"
#include "log.h"
#include "renderer_gl/opengl_capabilities.h"
@@ -145,9 +146,8 @@ Texture2D Layer::gen_equirect(glm::ivec2 size /*= { 0, 0 }*/)
set_layer_active_texture_unit(0U);
bind_layer_texture_cube(cube.m_cubetex_id);
ShaderManager::use(kShader::Equirect);
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f));
ShaderManager::u_int(kShaderUniform::Tex, 0);
pp::panopainter::setup_legacy_canvas_draw_merge_equirect_shader(
{.mvp = glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f), .texture_slot = 0});
Canvas::I->m_sampler.bind(0);
Canvas::I->m_plane.draw_fill();
@@ -187,9 +187,8 @@ PBO Layer::gen_equirect_pbo(glm::ivec2 size /*= { 0, 0 }*/)
set_layer_active_texture_unit(0U);
bind_layer_texture_cube(cube.m_cubetex_id);
ShaderManager::use(kShader::Equirect);
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f));
ShaderManager::u_int(kShaderUniform::Tex, 0);
pp::panopainter::setup_legacy_canvas_draw_merge_equirect_shader(
{.mvp = glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f), .texture_slot = 0});
Canvas::I->m_sampler.bind(0);
Canvas::I->m_plane.draw_fill();