Extract preview main live sample wrapping

This commit is contained in:
2026-06-14 00:05:33 +02:00
parent 2053c55bd6
commit 6670f6e186
4 changed files with 36 additions and 12 deletions

View File

@@ -745,13 +745,11 @@ NodeStrokePreview::make_stroke_draw_immediate_main_live_pass_request(
frame.flow = glm::max(frame.flow, m_min_flow);
},
.setup_sample_shader = [&](auto& frame) {
pp::panopainter::use_legacy_stroke_shader();
pp::panopainter::apply_legacy_stroke_sample_uniforms(
pp::panopainter::LegacyStrokeSampleUniforms {
.color = frame.col,
.alpha = frame.flow,
.opacity = frame.opacity,
});
execute_stroke_draw_immediate_main_live_sample_pass(
brush,
copy_stroke_destination,
frame,
size);
},
.draw_sample = [&](auto& frame) {
/*auto rect =*/ stroke_draw_samples(frame.shapes, m_tex, copy_stroke_destination);
@@ -762,10 +760,7 @@ NodeStrokePreview::make_stroke_draw_immediate_main_live_pass_request(
size,
stroke_preview_composite_slots::kStroke);
},
.finish_main_pass = [&] {
set_active_texture_unit(stroke_preview_live_slots::kMixer);
m_rtt_mixer.unbindTexture();
},
.finish_main_pass = [&] { set_active_texture_unit(stroke_preview_live_slots::kMixer); m_rtt_mixer.unbindTexture(); },
};
}
@@ -878,6 +873,24 @@ NodeStrokePreview::make_stroke_draw_immediate_pass_sequence_request(
};
}
void NodeStrokePreview::execute_stroke_draw_immediate_main_live_sample_pass(
const Brush& brush,
bool copy_stroke_destination,
const StrokeFrame& frame,
const glm::vec2& size)
{
(void)brush;
(void)copy_stroke_destination;
(void)size;
pp::panopainter::use_legacy_stroke_shader();
pp::panopainter::apply_legacy_stroke_sample_uniforms(
pp::panopainter::LegacyStrokeSampleUniforms {
.color = frame.col,
.alpha = frame.flow,
.opacity = frame.opacity,
});
}
pp::panopainter::LegacyNodeStrokePreviewMixExecutionRequest
NodeStrokePreview::make_stroke_draw_mix_execution_request(
const pp::panopainter::LegacyNodeStrokePreviewMixPassPlan& mix_pass,

View File

@@ -59,6 +59,11 @@ public:
bool copy_stroke_destination,
float zoom,
const glm::vec2& size);
void execute_stroke_draw_immediate_main_live_sample_pass(
const Brush& brush,
bool copy_stroke_destination,
const StrokeFrame& frame,
const glm::vec2& size);
void execute_stroke_draw_immediate_dual_pass(
const Brush& brush,
const pp::panopainter::LegacyNodeStrokePreviewPassOrchestrationPlan& pass_orchestration,