Extract preview final composite orchestration
This commit is contained in:
@@ -2659,6 +2659,58 @@ void legacy_node_stroke_preview_main_pass_texture_dispatch_preserves_order(pp::t
|
||||
});
|
||||
}
|
||||
|
||||
void legacy_node_stroke_preview_final_composite_and_copy_helpers_preserve_order(pp::tests::Harness& h)
|
||||
{
|
||||
std::vector<std::string> steps;
|
||||
const bool composite_ok = pp::panopainter::execute_legacy_node_stroke_preview_final_composite(
|
||||
pp::panopainter::LegacyNodeStrokePreviewFinalCompositeRequest {
|
||||
.resolution = glm::vec2(64.0F, 32.0F),
|
||||
.pattern_scale = glm::vec2(0.25F, -0.5F),
|
||||
.brush = reinterpret_cast<const Brush*>(1),
|
||||
.composite_pass = reinterpret_cast<const pp::paint_renderer::CanvasStrokeCompositePassPlan*>(1),
|
||||
.setup_composite_shader = [&] {
|
||||
steps.emplace_back("setup");
|
||||
},
|
||||
.bind_composite_samplers = [&] {
|
||||
steps.emplace_back("bind_samplers");
|
||||
},
|
||||
.bind_composite_inputs = [&] {
|
||||
steps.emplace_back("bind_inputs");
|
||||
},
|
||||
.draw_composite = [&] {
|
||||
steps.emplace_back("draw");
|
||||
},
|
||||
});
|
||||
PP_EXPECT(h, composite_ok);
|
||||
PP_EXPECT(h, steps == std::vector<std::string> {
|
||||
"setup",
|
||||
"bind_samplers",
|
||||
"bind_inputs",
|
||||
"draw",
|
||||
});
|
||||
|
||||
steps.clear();
|
||||
const bool copy_ok = pp::panopainter::copy_legacy_node_stroke_preview_result(
|
||||
pp::panopainter::LegacyNodeStrokePreviewCopyResultRequest {
|
||||
.preview_texture = reinterpret_cast<Texture2D*>(1),
|
||||
.size = glm::vec2(32.0F, 16.0F),
|
||||
.copy_framebuffer_to_texture = [&](int src_x, int src_y, int dst_x, int dst_y, int width, int height) {
|
||||
steps.emplace_back(
|
||||
"copy:" +
|
||||
std::to_string(src_x) + "," +
|
||||
std::to_string(src_y) + "," +
|
||||
std::to_string(dst_x) + "," +
|
||||
std::to_string(dst_y) + "," +
|
||||
std::to_string(width) + "," +
|
||||
std::to_string(height));
|
||||
},
|
||||
});
|
||||
PP_EXPECT(h, copy_ok);
|
||||
PP_EXPECT(h, steps == std::vector<std::string> {
|
||||
"copy:0,0,0,0,32,16",
|
||||
});
|
||||
}
|
||||
|
||||
void legacy_node_stroke_preview_stroke_setup_plan_preserves_curve_and_dual_inputs(pp::tests::Harness& h)
|
||||
{
|
||||
const auto plan = pp::panopainter::plan_legacy_node_stroke_preview_stroke_setup(
|
||||
@@ -3255,6 +3307,9 @@ int main()
|
||||
harness.run(
|
||||
"legacy_node_stroke_preview_main_pass_texture_dispatch_preserves_order",
|
||||
legacy_node_stroke_preview_main_pass_texture_dispatch_preserves_order);
|
||||
harness.run(
|
||||
"legacy_node_stroke_preview_final_composite_and_copy_helpers_preserve_order",
|
||||
legacy_node_stroke_preview_final_composite_and_copy_helpers_preserve_order);
|
||||
harness.run(
|
||||
"legacy_node_stroke_preview_stroke_setup_plan_preserves_curve_and_dual_inputs",
|
||||
legacy_node_stroke_preview_stroke_setup_plan_preserves_curve_and_dual_inputs);
|
||||
|
||||
Reference in New Issue
Block a user