Extract Canvas draw_merge layer texture helper
This commit is contained in:
@@ -1518,19 +1518,28 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array<bool, 6> faces /*= SI
|
||||
}
|
||||
else
|
||||
{
|
||||
m_cam_fov < 20.f ? m_sampler_nearest.bind(0) : m_sampler.bind(0);
|
||||
pp::panopainter::setup_legacy_canvas_draw_merge_texture_alpha_shader(
|
||||
pp::panopainter::execute_legacy_canvas_draw_merge_layer_texture(
|
||||
pp::panopainter::LegacyCanvasDrawMergeTextureAlphaUniforms {
|
||||
.mvp = ortho,
|
||||
.texture_slot = 0,
|
||||
.alpha = m_layers[layer_index]->m_opacity,
|
||||
.highlight = m_layers[layer_index]->m_hightlight,
|
||||
},
|
||||
pp::panopainter::LegacyCanvasDrawMergeLayerTextureExecution {
|
||||
.bind_sampler = [&] {
|
||||
m_cam_fov < 20.f ? m_sampler_nearest.bind(0) : m_sampler.bind(0);
|
||||
},
|
||||
.bind_layer_texture = [&] {
|
||||
set_active_texture_unit(0);
|
||||
m_layers[layer_index]->rtt(plane_index).bindTexture();
|
||||
},
|
||||
.draw = [&] {
|
||||
m_plane.draw_fill();
|
||||
},
|
||||
.unbind_layer_texture = [&] {
|
||||
m_layers[layer_index]->rtt(plane_index).unbindTexture();
|
||||
},
|
||||
});
|
||||
|
||||
set_active_texture_unit(0);
|
||||
m_layers[layer_index]->rtt(plane_index).bindTexture();
|
||||
m_plane.draw_fill();
|
||||
m_layers[layer_index]->rtt(plane_index).unbindTexture();
|
||||
}
|
||||
|
||||
if (use_blend)
|
||||
|
||||
Reference in New Issue
Block a user