Prepare renderer snapshots before legacy exports
This commit is contained in:
@@ -275,6 +275,11 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p
|
|||||||
in `rendererUpload` JSON. It is covered by
|
in `rendererUpload` JSON. It is covered by
|
||||||
`pano_cli_plan_canvas_document_snapshot_smoke` plus the payload-bearing
|
`pano_cli_plan_canvas_document_snapshot_smoke` plus the payload-bearing
|
||||||
snapshot smoke.
|
snapshot smoke.
|
||||||
|
- Live equirectangular, layer, animation-frame, and cube-face export adapters
|
||||||
|
now prepare and log the same payload-bearing canvas document snapshot plus
|
||||||
|
renderer-neutral active-frame upload report before delegating to retained
|
||||||
|
`Canvas` export execution. Depth and video export remain on the older retained
|
||||||
|
path.
|
||||||
- `pano_cli save-document-project` writes that pure document export to a PPI
|
- `pano_cli save-document-project` writes that pure document export to a PPI
|
||||||
file and is covered by `pano_cli_save_document_project_roundtrip_smoke`,
|
file and is covered by `pano_cli_save_document_project_roundtrip_smoke`,
|
||||||
which inspects and loads the generated file.
|
which inspects and loads the generated file.
|
||||||
@@ -1110,7 +1115,10 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p
|
|||||||
layers, animation-frame, depth, and cube-face export calls. It preserves
|
layers, animation-frame, depth, and cube-face export calls. It preserves
|
||||||
platform-specific export messages, directory creation, picker-selected stem
|
platform-specific export messages, directory creation, picker-selected stem
|
||||||
exports, Web prepared-file handoff, and legacy `Canvas` export execution while
|
exports, Web prepared-file handoff, and legacy `Canvas` export execution while
|
||||||
retained renderer/document/platform ownership is tracked by `DEBT-0043`. It
|
retained renderer/document/platform ownership is tracked by `DEBT-0043`.
|
||||||
|
Equirectangular, layer, animation-frame, and cube-face execution now prepare
|
||||||
|
the document snapshot plus renderer-upload readiness report before those
|
||||||
|
retained calls; depth export remains on the older retained path. It
|
||||||
also bridges timelapse and animation MP4 export picker-selected paths while
|
also bridges timelapse and animation MP4 export picker-selected paths while
|
||||||
preserving desktop worker-thread timelapse behavior, mobile/Web save
|
preserving desktop worker-thread timelapse behavior, mobile/Web save
|
||||||
callbacks, `App::rec_export`, animation `Canvas::export_anim_mp4`, and
|
callbacks, `App::rec_export`, animation `Canvas::export_anim_mp4`, and
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ and validation command.
|
|||||||
| Capability | Current Area | Target Owner | Required Tests |
|
| Capability | Current Area | Target Owner | Required Tests |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| PNG/JPEG import | `Image`, `Canvas` import paths | `pp_assets`, `pp_document` | Fixture import, malformed file |
|
| PNG/JPEG import | `Image`, `Canvas` import paths | `pp_assets`, `pp_document` | Fixture import, malformed file |
|
||||||
| PNG/JPEG export | `Canvas`, `Image`, export dialogs | `pp_assets`, `pp_paint_renderer`, `pp_app_core` | Golden output tolerance, export start/target planning tests |
|
| PNG/JPEG export | `Canvas`, `Image`, export dialogs | `pp_assets`, `pp_paint_renderer`, `pp_app_core` | Golden output tolerance, export start/target planning tests, live export-adapter document snapshot readiness |
|
||||||
| Equirectangular import/export | `Canvas`, shaders, RTT, export dialogs | `pp_paint_renderer`, `pp_app_core` | Tiny cube/equirect golden, app-core file target tests |
|
| Equirectangular import/export | `Canvas`, shaders, RTT, export dialogs | `pp_paint_renderer`, `pp_app_core` | Tiny cube/equirect golden, app-core file target tests, live export-adapter renderer-upload readiness |
|
||||||
| Cube face export | `Canvas` | `pp_paint_renderer` | Pure six-face document frame composite, renderer texture-upload bridge, payload-complete canvas-snapshot renderer-upload automation, OpenGL command-plan coverage, six-face golden set |
|
| Cube face export | `Canvas` | `pp_paint_renderer` | Pure six-face document frame composite, renderer texture-upload bridge, payload-complete canvas-snapshot renderer-upload automation, live export-adapter renderer-upload readiness, OpenGL command-plan coverage, six-face golden set |
|
||||||
| Depth export | `Canvas`, grid tools | `pp_paint_renderer` | Float/readback validation |
|
| Depth export | `Canvas`, grid tools | `pp_paint_renderer` | Float/readback validation |
|
||||||
|
|
||||||
## Brush And Painting
|
## Brush And Painting
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -680,6 +680,10 @@ document-frame compositor and renderer-neutral recording upload path, reporting
|
|||||||
texture, transition, byte, payload, and command counts. Live save writer
|
texture, transition, byte, payload, and command counts. Live save writer
|
||||||
replacement, export adoption, and renderer-owned readback remain under
|
replacement, export adoption, and renderer-owned readback remain under
|
||||||
`DEBT-0010`/`DEBT-0013`/`DEBT-0036`.
|
`DEBT-0010`/`DEBT-0013`/`DEBT-0036`.
|
||||||
|
Live equirectangular, layer, animation-frame, and cube-face export adapters now
|
||||||
|
prepare the same payload-bearing document snapshot and renderer-neutral upload
|
||||||
|
report before delegating to retained `Canvas` export execution, so export
|
||||||
|
workflows consume the boundary without changing file output yet.
|
||||||
`pano_cli plan-image-import` exposes app-core planning for File > Import image
|
`pano_cli plan-image-import` exposes app-core planning for File > Import image
|
||||||
route decisions, including wide equirectangular images, legacy vertical cube
|
route decisions, including wide equirectangular images, legacy vertical cube
|
||||||
strips, regular transform-placement images, and invalid image dimensions; live
|
strips, regular transform-placement images, and invalid image dimensions; live
|
||||||
@@ -2226,6 +2230,10 @@ Results:
|
|||||||
frame through `pp_paint_renderer::upload_document_frame_faces` and the
|
frame through `pp_paint_renderer::upload_document_frame_faces` and the
|
||||||
`RecordingRenderDevice`, emitting `rendererUpload` JSON with texture,
|
`RecordingRenderDevice`, emitting `rendererUpload` JSON with texture,
|
||||||
transition, command, byte, and active-frame payload counts.
|
transition, command, byte, and active-frame payload counts.
|
||||||
|
- Live equirectangular, layer, animation-frame, and cube-face export bridges now
|
||||||
|
capture the payload-bearing canvas document snapshot and run the
|
||||||
|
renderer-neutral upload report before retained `Canvas` export execution;
|
||||||
|
failures are logged and retained export still continues to preserve behavior.
|
||||||
- `pp_app_core_document_import_tests` passed, covering wide equirectangular,
|
- `pp_app_core_document_import_tests` passed, covering wide equirectangular,
|
||||||
legacy vertical cube strip, regular transform-placement, and invalid-dimension
|
legacy vertical cube strip, regular transform-placement, and invalid-dimension
|
||||||
import route decisions, equirectangular service dispatch, transform import
|
import route decisions, equirectangular service dispatch, transform import
|
||||||
@@ -2509,6 +2517,10 @@ Results:
|
|||||||
snapshot through the pure document-frame compositor and renderer-neutral
|
snapshot through the pure document-frame compositor and renderer-neutral
|
||||||
texture upload stream, so agents can validate document/canvas payloads moving
|
texture upload stream, so agents can validate document/canvas payloads moving
|
||||||
into renderer commands before live canvas export/save writer replacement.
|
into renderer commands before live canvas export/save writer replacement.
|
||||||
|
- Live image/collection/cube export adapters now prepare and log the same
|
||||||
|
document/canvas plus renderer-upload readiness before retained `Canvas`
|
||||||
|
export calls. Depth and video export remain on their prior retained paths;
|
||||||
|
actual image/cube writer replacement remains tracked under export debt.
|
||||||
- Snapshot creation now rejects invalid embedded RGBA8 face payloads before
|
- Snapshot creation now rejects invalid embedded RGBA8 face payloads before
|
||||||
document export or history can persist malformed state.
|
document export or history can persist malformed state.
|
||||||
- Package-smoke wrappers validate the Windows CMake app executable/runtime
|
- Package-smoke wrappers validate the Windows CMake app executable/runtime
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
#include "legacy_document_export_services.h"
|
#include "legacy_document_export_services.h"
|
||||||
|
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
|
#include "legacy_document_canvas_services.h"
|
||||||
|
#include "paint_renderer/compositor.h"
|
||||||
|
#include "renderer_api/recording_renderer.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
@@ -19,6 +22,76 @@ void show_export_success_dialog(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pp::foundation::Status prepare_legacy_document_export_snapshot(App& app, const char* context)
|
||||||
|
{
|
||||||
|
auto snapshot = capture_legacy_canvas_document_payload_snapshot(app);
|
||||||
|
if (!snapshot) {
|
||||||
|
LOG("%s document export snapshot failed: %s", context, snapshot.status().message);
|
||||||
|
return snapshot.status();
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto report = pp::app::make_document_canvas_save_snapshot_report(snapshot.value());
|
||||||
|
LOG(
|
||||||
|
"%s document export snapshot: %ux%u layers=%zu frames=%zu capturedFaces=%zu pendingFaces=%zu ppiReady=%s",
|
||||||
|
context,
|
||||||
|
report.width,
|
||||||
|
report.height,
|
||||||
|
report.layer_count,
|
||||||
|
report.frame_count,
|
||||||
|
report.captured_face_payloads,
|
||||||
|
report.pending_face_payloads,
|
||||||
|
report.can_export_ppi ? "true" : "false");
|
||||||
|
|
||||||
|
if (!report.can_export_ppi) {
|
||||||
|
return pp::foundation::Status::success();
|
||||||
|
}
|
||||||
|
|
||||||
|
pp::renderer::RecordingRenderDevice render_device;
|
||||||
|
const auto uploaded = pp::paint_renderer::upload_document_frame_faces(
|
||||||
|
render_device,
|
||||||
|
pp::paint_renderer::DocumentFrameUploadRequest {
|
||||||
|
.document = &snapshot.value().document,
|
||||||
|
.frame_index = snapshot.value().document.active_frame_index(),
|
||||||
|
.clear_color = {},
|
||||||
|
});
|
||||||
|
if (!uploaded) {
|
||||||
|
LOG("%s document export renderer upload failed: %s", context, uploaded.status().message);
|
||||||
|
return uploaded.status();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::size_t upload_commands = 0;
|
||||||
|
std::size_t transition_commands = 0;
|
||||||
|
const auto commands = render_device.commands();
|
||||||
|
for (const auto& command : commands) {
|
||||||
|
if (command.kind == pp::renderer::RecordedRenderCommandKind::upload_texture) {
|
||||||
|
++upload_commands;
|
||||||
|
}
|
||||||
|
if (command.kind == pp::renderer::RecordedRenderCommandKind::transition_texture) {
|
||||||
|
++transition_commands;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG(
|
||||||
|
"%s document export renderer upload: textures=%zu bytes=%llu transitions=%zu facePayloads=%zu commands=%zu uploadCommands=%zu transitionCommands=%zu",
|
||||||
|
context,
|
||||||
|
uploaded.value().texture_count,
|
||||||
|
static_cast<unsigned long long>(uploaded.value().uploaded_bytes),
|
||||||
|
uploaded.value().transition_count,
|
||||||
|
uploaded.value().composite.face_payload_count,
|
||||||
|
commands.size(),
|
||||||
|
upload_commands,
|
||||||
|
transition_commands);
|
||||||
|
return pp::foundation::Status::success();
|
||||||
|
}
|
||||||
|
|
||||||
|
void prepare_legacy_document_export_snapshot_or_continue(App& app, const char* context)
|
||||||
|
{
|
||||||
|
const auto status = prepare_legacy_document_export_snapshot(app, context);
|
||||||
|
if (!status.ok()) {
|
||||||
|
LOG("%s document export snapshot bridge retained legacy export after failure: %s", context, status.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class LegacyDocumentExportServices final : public pp::app::DocumentExportServices {
|
class LegacyDocumentExportServices final : public pp::app::DocumentExportServices {
|
||||||
public:
|
public:
|
||||||
explicit LegacyDocumentExportServices(App& app) noexcept
|
explicit LegacyDocumentExportServices(App& app) noexcept
|
||||||
@@ -34,6 +107,7 @@ public:
|
|||||||
void export_equirectangular(const pp::app::DocumentExportFileTarget& target) override
|
void export_equirectangular(const pp::app::DocumentExportFileTarget& target) override
|
||||||
{
|
{
|
||||||
auto* app = &app_;
|
auto* app = &app_;
|
||||||
|
prepare_legacy_document_export_snapshot_or_continue(app_, "export-equirectangular");
|
||||||
app_.canvas->m_canvas->export_equirectangular(target.path, [app, target] {
|
app_.canvas->m_canvas->export_equirectangular(target.path, [app, target] {
|
||||||
#if __WEB__
|
#if __WEB__
|
||||||
app->ui_task([app, target] {
|
app->ui_task([app, target] {
|
||||||
@@ -54,6 +128,7 @@ public:
|
|||||||
void export_layers_to_stem(const pp::app::DocumentExportStemTarget& target) override
|
void export_layers_to_stem(const pp::app::DocumentExportStemTarget& target) override
|
||||||
{
|
{
|
||||||
auto* app = &app_;
|
auto* app = &app_;
|
||||||
|
prepare_legacy_document_export_snapshot_or_continue(app_, "export-layers");
|
||||||
app_.canvas->m_canvas->export_layers(target.stem_path, [app, target] {
|
app_.canvas->m_canvas->export_layers(target.stem_path, [app, target] {
|
||||||
show_export_success_dialog(
|
show_export_success_dialog(
|
||||||
*app,
|
*app,
|
||||||
@@ -67,6 +142,7 @@ public:
|
|||||||
void export_layers_to_collection(const pp::app::DocumentExportCollectionTarget& target) override
|
void export_layers_to_collection(const pp::app::DocumentExportCollectionTarget& target) override
|
||||||
{
|
{
|
||||||
auto* app = &app_;
|
auto* app = &app_;
|
||||||
|
prepare_legacy_document_export_snapshot_or_continue(app_, "export-layers");
|
||||||
app_.canvas->m_canvas->export_layers(target.stem_path, [app] {
|
app_.canvas->m_canvas->export_layers(target.stem_path, [app] {
|
||||||
show_export_success_dialog(
|
show_export_success_dialog(
|
||||||
*app,
|
*app,
|
||||||
@@ -79,6 +155,7 @@ public:
|
|||||||
void export_animation_frames_to_stem(const pp::app::DocumentExportStemTarget& target) override
|
void export_animation_frames_to_stem(const pp::app::DocumentExportStemTarget& target) override
|
||||||
{
|
{
|
||||||
auto* app = &app_;
|
auto* app = &app_;
|
||||||
|
prepare_legacy_document_export_snapshot_or_continue(app_, "export-animation-frames");
|
||||||
app_.canvas->m_canvas->export_anim_frames(target.stem_path, [app, target] {
|
app_.canvas->m_canvas->export_anim_frames(target.stem_path, [app, target] {
|
||||||
show_export_success_dialog(
|
show_export_success_dialog(
|
||||||
*app,
|
*app,
|
||||||
@@ -92,6 +169,7 @@ public:
|
|||||||
void export_animation_frames_to_collection(const pp::app::DocumentExportCollectionTarget& target) override
|
void export_animation_frames_to_collection(const pp::app::DocumentExportCollectionTarget& target) override
|
||||||
{
|
{
|
||||||
auto* app = &app_;
|
auto* app = &app_;
|
||||||
|
prepare_legacy_document_export_snapshot_or_continue(app_, "export-animation-frames");
|
||||||
app_.canvas->m_canvas->export_anim_frames(target.stem_path, [app] {
|
app_.canvas->m_canvas->export_anim_frames(target.stem_path, [app] {
|
||||||
show_export_success_dialog(
|
show_export_success_dialog(
|
||||||
*app,
|
*app,
|
||||||
@@ -117,6 +195,7 @@ public:
|
|||||||
void export_cube_faces(std::string_view document_name) override
|
void export_cube_faces(std::string_view document_name) override
|
||||||
{
|
{
|
||||||
auto* app = &app_;
|
auto* app = &app_;
|
||||||
|
prepare_legacy_document_export_snapshot_or_continue(app_, "export-cube-faces");
|
||||||
app_.canvas->m_canvas->export_cube_faces(std::string(document_name), [app] {
|
app_.canvas->m_canvas->export_cube_faces(std::string(document_name), [app] {
|
||||||
show_export_success_dialog(
|
show_export_success_dialog(
|
||||||
*app,
|
*app,
|
||||||
|
|||||||
Reference in New Issue
Block a user