Clean retained stroke extraction build
This commit is contained in:
@@ -93,6 +93,30 @@ struct StrokePreviewCompositePassInputs {
|
||||
Sampler& linear_sampler;
|
||||
Sampler& repeat_sampler;
|
||||
std::function<void()> draw_composite;
|
||||
|
||||
StrokePreviewCompositePassInputs(
|
||||
glm::vec2 resolution_in,
|
||||
glm::vec2 pattern_scale_in,
|
||||
const Brush& brush_in,
|
||||
const pp::paint_renderer::CanvasStrokeCompositePassPlan& composite_pass_in,
|
||||
Texture2D& background_texture_in,
|
||||
Texture2D& stroke_texture_in,
|
||||
Texture2D& dual_texture_in,
|
||||
Sampler& linear_sampler_in,
|
||||
Sampler& repeat_sampler_in,
|
||||
std::function<void()> draw_composite_in)
|
||||
: resolution(resolution_in)
|
||||
, pattern_scale(pattern_scale_in)
|
||||
, brush(brush_in)
|
||||
, composite_pass(composite_pass_in)
|
||||
, background_texture(background_texture_in)
|
||||
, stroke_texture(stroke_texture_in)
|
||||
, dual_texture(dual_texture_in)
|
||||
, linear_sampler(linear_sampler_in)
|
||||
, repeat_sampler(repeat_sampler_in)
|
||||
, draw_composite(std::move(draw_composite_in))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
pp::panopainter::LegacyNodeStrokePreviewMixPassRequest make_stroke_preview_mix_pass_request(
|
||||
@@ -384,6 +408,8 @@ std::array<pp::paint_renderer::CanvasStrokePoint, 4> make_stroke_preview_sample_
|
||||
};
|
||||
}
|
||||
|
||||
void upload_stroke_preview_brush_vertices(DynamicShape& brush_shape, std::span<const vertex_t> vertices);
|
||||
|
||||
pp::panopainter::LegacyStrokeSampleExecutionRequest make_stroke_preview_sample_request(
|
||||
std::array<vertex_t, 4>& vertices,
|
||||
const std::array<pp::paint_renderer::CanvasStrokePoint, 4>& sample_points,
|
||||
@@ -768,6 +794,8 @@ void NodeStrokePreview::draw_stroke_immediate()
|
||||
|
||||
const bool sequence_ok = pp::panopainter::execute_legacy_node_stroke_preview_pass_sequence(
|
||||
make_stroke_draw_immediate_pass_sequence_request(
|
||||
m_stroke,
|
||||
m_dual_stroke,
|
||||
*b,
|
||||
pass_orchestration,
|
||||
dual_brush,
|
||||
@@ -784,6 +812,7 @@ void NodeStrokePreview::draw_stroke_immediate()
|
||||
|
||||
NodeStrokePreview::StrokeMainLivePassRequest
|
||||
NodeStrokePreview::make_stroke_draw_immediate_main_live_pass_request(
|
||||
Stroke& stroke,
|
||||
const Brush& brush,
|
||||
const pp::panopainter::LegacyNodeStrokePreviewPassOrchestrationPlan& pass_orchestration,
|
||||
bool copy_stroke_destination,
|
||||
@@ -810,7 +839,7 @@ NodeStrokePreview::make_stroke_draw_immediate_main_live_pass_request(
|
||||
m_rtt.clear();
|
||||
},
|
||||
.compute_frames = [&] {
|
||||
return stroke_draw_compute(m_stroke, zoom);
|
||||
return stroke_draw_compute(stroke, zoom);
|
||||
},
|
||||
.before_frame = [&](auto& frame) {
|
||||
if (brush.m_tip_mix > 0.f)
|
||||
@@ -844,6 +873,7 @@ NodeStrokePreview::make_stroke_draw_immediate_main_live_pass_request(
|
||||
}
|
||||
|
||||
void NodeStrokePreview::execute_stroke_draw_immediate_dual_pass(
|
||||
Stroke& dual_stroke,
|
||||
const Brush& brush,
|
||||
const pp::panopainter::LegacyNodeStrokePreviewPassOrchestrationPlan& pass_orchestration,
|
||||
std::shared_ptr<Brush> dual_brush,
|
||||
@@ -858,7 +888,7 @@ void NodeStrokePreview::execute_stroke_draw_immediate_dual_pass(
|
||||
m_rtt.clear();
|
||||
},
|
||||
[&] {
|
||||
return stroke_draw_compute(m_dual_stroke, zoom);
|
||||
return stroke_draw_compute(dual_stroke, zoom);
|
||||
},
|
||||
[](auto& frame) {
|
||||
frame.col = { 0, 0, 0, 1 };
|
||||
@@ -885,6 +915,8 @@ void NodeStrokePreview::execute_stroke_draw_immediate_dual_pass(
|
||||
|
||||
pp::panopainter::LegacyNodeStrokePreviewPassSequenceRequest
|
||||
NodeStrokePreview::make_stroke_draw_immediate_pass_sequence_request(
|
||||
Stroke& stroke,
|
||||
Stroke& dual_stroke,
|
||||
const Brush& brush,
|
||||
const pp::panopainter::LegacyNodeStrokePreviewPassOrchestrationPlan& pass_orchestration,
|
||||
std::shared_ptr<Brush> dual_brush,
|
||||
@@ -901,6 +933,7 @@ NodeStrokePreview::make_stroke_draw_immediate_pass_sequence_request(
|
||||
},
|
||||
.execute_dual_pass = [&] {
|
||||
execute_stroke_draw_immediate_dual_pass(
|
||||
dual_stroke,
|
||||
brush,
|
||||
pass_orchestration,
|
||||
dual_brush,
|
||||
@@ -922,6 +955,7 @@ NodeStrokePreview::make_stroke_draw_immediate_pass_sequence_request(
|
||||
[[maybe_unused]] const bool main_live_ok =
|
||||
pp::panopainter::execute_legacy_node_stroke_preview_main_live_pass(
|
||||
make_stroke_draw_immediate_main_live_pass_request(
|
||||
stroke,
|
||||
brush,
|
||||
pass_orchestration,
|
||||
copy_stroke_destination,
|
||||
@@ -930,21 +964,21 @@ NodeStrokePreview::make_stroke_draw_immediate_pass_sequence_request(
|
||||
},
|
||||
.finish_main_pass = [&] {},
|
||||
.execute_final_composite = [&] {
|
||||
std::function<void()> draw_composite = [&] {
|
||||
m_plane.draw_fill();
|
||||
};
|
||||
execute_stroke_preview_final_composite_and_copy(
|
||||
StrokePreviewCompositePassInputs {
|
||||
.resolution = size,
|
||||
.pattern_scale = brush.m_pattern_scale,
|
||||
.brush = brush,
|
||||
.composite_pass = material.composite_pass,
|
||||
.background_texture = m_tex_background,
|
||||
.stroke_texture = m_tex,
|
||||
.dual_texture = m_tex_dual,
|
||||
.linear_sampler = m_sampler_linear,
|
||||
.repeat_sampler = m_sampler_linear_repeat,
|
||||
.draw_composite = [&] {
|
||||
m_plane.draw_fill();
|
||||
},
|
||||
},
|
||||
StrokePreviewCompositePassInputs(
|
||||
size,
|
||||
glm::vec2(brush.m_pattern_scale),
|
||||
brush,
|
||||
material.composite_pass,
|
||||
m_tex_background,
|
||||
m_tex,
|
||||
m_tex_dual,
|
||||
m_sampler_linear,
|
||||
m_sampler_linear_repeat,
|
||||
std::move(draw_composite)),
|
||||
m_tex_preview,
|
||||
size);
|
||||
},
|
||||
@@ -983,7 +1017,7 @@ NodeStrokePreview::make_stroke_draw_mix_execution_request(
|
||||
*m_brush,
|
||||
m_sampler_linear,
|
||||
m_tex_background,
|
||||
m_rtt,
|
||||
m_tex,
|
||||
m_tex_dual,
|
||||
gl,
|
||||
bb_min,
|
||||
|
||||
Reference in New Issue
Block a user