Share retained stroke face framebuffer helper

This commit is contained in:
2026-06-13 10:22:56 +02:00
parent bc624ceb8d
commit 084f58573f
5 changed files with 72 additions and 20 deletions

View File

@@ -689,7 +689,7 @@ void Canvas::stroke_draw()
std::array<bool, 6> box_dirty = SIXPLETTE(false);
const std::array<bool, 6> include_main_dirty = SIXPLETTE(true);
glm::vec4 pad_color;
pp::panopainter::execute_legacy_canvas_stroke_live_pass_with_dirty_tracking(
pp::panopainter::execute_legacy_canvas_stroke_live_pass_with_face_framebuffers(
frames,
stroke_extent,
std::span<glm::vec4>(m_dirty_box),
@@ -705,7 +705,6 @@ void Canvas::stroke_draw()
[&](auto&, int i, auto&) {
m_dirty_face[i] = true;
box_dirty[i] = true;
m_tmp[i].bindFramebuffer();
},
[&](auto& f, int i, auto& P) {
pp::panopainter::use_legacy_stroke_shader();
@@ -717,9 +716,7 @@ void Canvas::stroke_draw()
});
return stroke_draw_samples(i, P, copy_stroke_destination);
},
[&](auto&, int i, auto&, glm::vec4) {
m_tmp[i].unbindFramebuffer();
});
m_tmp);
set_active_texture_unit(3);
m_mixer.unbindTexture();
@@ -740,14 +737,7 @@ void Canvas::stroke_draw()
.color = pad_color,
.uses_destination_feedback = copy_stroke_destination,
});
const std::array<pp::panopainter::LegacyCanvasStrokePadFace, 6> pad_faces = {
pp::panopainter::LegacyCanvasStrokePadFace { .index = 0, .dirty = box_dirty[0], .pass_dirty_box = box_face[0] },
pp::panopainter::LegacyCanvasStrokePadFace { .index = 1, .dirty = box_dirty[1], .pass_dirty_box = box_face[1] },
pp::panopainter::LegacyCanvasStrokePadFace { .index = 2, .dirty = box_dirty[2], .pass_dirty_box = box_face[2] },
pp::panopainter::LegacyCanvasStrokePadFace { .index = 3, .dirty = box_dirty[3], .pass_dirty_box = box_face[3] },
pp::panopainter::LegacyCanvasStrokePadFace { .index = 4, .dirty = box_dirty[4], .pass_dirty_box = box_face[4] },
pp::panopainter::LegacyCanvasStrokePadFace { .index = 5, .dirty = box_dirty[5], .pass_dirty_box = box_face[5] },
};
const auto pad_faces = pp::panopainter::make_legacy_canvas_stroke_pad_faces(box_dirty, box_face);
[[maybe_unused]] const auto pad_result = pp::panopainter::execute_legacy_canvas_stroke_pad_faces(
pp::panopainter::LegacyCanvasStrokePadExecutionRequest {
.context = "Canvas::stroke_draw",
@@ -802,7 +792,7 @@ void Canvas::stroke_draw()
auto frames_dual = stroke_draw_compute(*m_dual_stroke);
const std::array<bool, 6> include_dual_dirty =
SIXPLETTE(stroke_material.composite_pass.dual_blend_mode == 0);
pp::panopainter::execute_legacy_canvas_stroke_live_pass_with_dirty_tracking(
pp::panopainter::execute_legacy_canvas_stroke_live_pass_with_face_framebuffers(
frames_dual,
stroke_extent,
std::span<glm::vec4>(m_dirty_box),
@@ -816,15 +806,11 @@ void Canvas::stroke_draw()
.opacity = f.opacity,
});
},
[&](auto&, int i, auto&) {
m_tmp_dual[i].bindFramebuffer();
},
[](auto&, int, auto&) {},
[&](auto&, int i, auto& P) {
return stroke_draw_samples(i, P, copy_stroke_destination);
},
[&](auto&, int i, auto&, glm::vec4) {
m_tmp_dual[i].unbindFramebuffer();
},
m_tmp_dual,
true);
set_active_texture_unit(0);