Route draw merge blend setup through helper

This commit is contained in:
2026-06-13 05:12:06 +02:00
parent ea1557f7ea
commit 14a6fc2e57
3 changed files with 20 additions and 6 deletions

View File

@@ -1411,15 +1411,18 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array<bool, 6> faces /*= SI
m_sampler.bind(0);
m_sampler.bind(2);
ShaderManager::use(kShader::TextureBlend);
ShaderManager::u_int(kShaderUniform::Tex, 0);
ShaderManager::u_int(kShaderUniform::BlendMode, m_layers[layer_index]->m_blend_mode);
ShaderManager::u_float(kShaderUniform::Alpha, 1.f);
ShaderManager::u_mat4(kShaderUniform::MVP, ortho);
pp::panopainter::setup_legacy_canvas_draw_merge_texture_blend_shader(
pp::panopainter::LegacyCanvasDrawMergeTextureBlendUniforms {
.mvp = ortho,
.texture_slot = 0,
.destination_texture_slot = 2,
.use_destination_texture = copy_blend_destination,
.blend_mode = m_layers[layer_index]->m_blend_mode,
.alpha = 1.f,
});
if (copy_blend_destination)
{
m_sampler.bind(2);
ShaderManager::u_int(kShaderUniform::TexBG, 2);
}
set_active_texture_unit(0);