diff --git a/docs/modernization/build-inventory.md b/docs/modernization/build-inventory.md index 122d630..3e6e206 100644 --- a/docs/modernization/build-inventory.md +++ b/docs/modernization/build-inventory.md @@ -447,9 +447,10 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p RGBA8 region-update helper that uses the tested texture-update dispatch for canvas undo, layer restore, and flood-fill texture writes. 2D framebuffer-to-texture copies used by retained canvas, transform, - layer-conversion, panorama UI, and brush-preview paths now execute through a - tested `pp_renderer_gl` dispatch via `copy_framebuffer_to_texture_2d`; the - retained cube-map framebuffer copy remains tracked by `DEBT-0036`. It also + layer-conversion, panorama UI, brush-preview, and CanvasLayer cube-face paths + now execute through a tested `pp_renderer_gl` dispatch via the target-aware + retained framebuffer-copy utility bridge. That bridge remains retained until + renderer services own copy execution under `DEBT-0036`. It also validates renderer API primitive-topology to OpenGL draw-mode mapping, Shape index-type, fill/stroke primitive-mode, buffer target, static upload usage, and vertex attribute component/normalization mapping used by @@ -522,8 +523,9 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p clear, clear-color query/restore, and RGBA8 read/write pixel mapping. Their active-texture, cube-texture binding, viewport, blend capability, clear-color, and color-buffer clear adapter endpoints now share - `legacy_ui_gl_dispatch`; the retained cube-face framebuffer-to-texture copy - remains tracked by DEBT-0036. + `legacy_ui_gl_dispatch`; the cube-face framebuffer-to-texture copy now uses + the shared retained target-aware utility bridge and remains tracked by + DEBT-0036. `NodePanelGrid` heightmap preview and lightmap baking also consume backend-owned texture readback formats, sampler filters, depth/blend state, depth clears, viewport queries, color-mask booleans, active texture units, @@ -565,8 +567,8 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p `CanvasLayer` cube/equirect generation and frame clears also share the bridge for active texture, cube texture binding, viewport execution, blend capability execution, clear-color query/restore, and color-buffer clear - adapter endpoints, while its cube-face framebuffer-to-texture copy remains a - retained local copy bridge. + adapter endpoints, while its cube-face framebuffer-to-texture copy uses the + shared retained target-aware utility bridge. `NodePanelGrid` heightmap draw and bake setup also shares it for active texture, depth/blend capability query/apply, viewport query/execution, depth clears, and color-write-mask adapter endpoints. diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 371c19f..f89af06 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -340,8 +340,14 @@ agent or engineer to remove them without reconstructing context from chat. `legacy_ui_gl_dispatch` for active-texture selection, cube texture binding, viewport execution, blend capability execution, clear-color query/restore, and color-buffer clear adapter endpoints. The cube-face framebuffer-to-texture - copy remains the retained local copy bridge until the renderer boundary owns - cube copy commands. + copy remained open until it could use the shared retained framebuffer-copy + utility bridge. +- 2026-06-05: DEBT-0036 was narrowed again. `CanvasLayer` cube-face + framebuffer-to-texture copies now use the shared retained + `copy_framebuffer_to_texture_target` utility bridge backed by tested + `pp_renderer_gl` dispatch, so `src/canvas_layer.cpp` no longer owns a local + raw `glCopyTexSubImage2D` adapter. The bridge remains retained until renderer + services own cube and 2D copy execution. ## Open Debt @@ -380,7 +386,7 @@ agent or engineer to remove them without reconstructing context from chat. | DEBT-0033 | Open | Modernization | Tools menu planning and direct command execution dispatch now consume pure `pp_app_core` through `App::init_menu_tools`, `pano_cli plan-tools-menu`, `pano_cli plan-tools-panel`, `pano_cli plan-canvas-camera-reset`, `pano_cli plan-canvas-view-density`, `pano_cli plan-canvas-view-cursor-mode`, and the `ToolsMenuServices` boundary, direct command execution is centralized in `src/legacy_app_shell_services.*`, SonarPen availability/startup now routes through `PlatformServices`, and reset-camera, viewport-density, and cursor-mode execution now share `src/legacy_canvas_view_services.*`, but live adapters still construct legacy `NodePanelFloating` panels, mutate legacy panel nodes, clear `CanvasModeGrid`, open legacy shortcuts UI, mutate retained `Canvas` camera/density/cursor state, write retained `Settings`, and rely on the legacy platform adapter for the retained iOS SonarPen bridge | Preserve current Tools menu and canvas-view behavior while UI shell actions move toward app/UI/platform/canvas services | `pp_app_core_tools_menu_tests`; `pp_app_core_canvas_view_tests`; `pp_platform_api_tests`; `pano_cli plan-tools-menu --command shortcuts`; `pano_cli plan-tools-panel --panel layers`; `pano_cli plan-tools-panel --panel animation --already-visible`; `pano_cli plan-canvas-camera-reset`; `pano_cli plan-canvas-view-density --density 1.5`; `pano_cli plan-canvas-view-cursor-mode --mode 3`; `ctest --preset desktop-fast --build-config Debug` | Tools panel creation, submenu routing, grid clear, camera reset, viewport density, cursor mode, shortcuts dialog, and SonarPen dispatch are owned by injected app/UI/platform/canvas services with `App::init_menu_tools` and options callbacks acting only as UI adapters and no legacy Tools/canvas-view adapter | | DEBT-0034 | Open | Modernization | About menu command planning and execution dispatch now consume pure `pp_app_core` through `App::init_menu_about`, `pano_cli plan-about-menu`, and the `AboutMenuServices` boundary, and live execution is centralized in `src/legacy_app_shell_services.*`, but the bridge still opens legacy About/manual/what's-new dialogs, invokes the injected crash hook, and runs the legacy Canvas stroke performance test directly | Preserve About menu behavior while dialogs and diagnostics move toward app/UI/platform services | `pp_app_core_about_menu_tests`; `pano_cli plan-about-menu --command news --version-major 2 --version-minor 5 --version-fix 7`; `pano_cli plan-about-menu --command performance --no-canvas`; `ctest --preset desktop-fast --build-config Debug` | About/manual/what's-new dialog dispatch, crash-test dispatch, and performance-test execution are owned by injected app/UI/platform services with `App::init_menu_about` acting only as a UI adapter and no legacy About adapter | | DEBT-0035 | Open | Modernization | Main toolbar/status command planning and execution dispatch now consume pure `pp_app_core` through `App::init_toolbar_main`, `pano_cli plan-main-toolbar`, and the `MainToolbarServices` boundary; toolbar test-message dialog metadata now lives in `pp_app_core` through `plan_main_toolbar_message_dialog`, retained message-box creation routes through `src/legacy_app_dialog_services.*`, history/canvas commands now hand off through `HistoryUiServices` and `DocumentCanvasClearServices`, and live execution is centralized in `src/legacy_app_shell_services.*`, but the bridge still opens legacy open/save/settings dialogs, stores raw compatibility pointers, and delegates to legacy history/canvas adapters | Preserve reachable toolbar/status behavior while app shell commands move toward app/document/UI services | `pp_app_core_main_toolbar_tests`; `pano_cli plan-main-toolbar --command undo --undo-count 2`; `pano_cli plan-main-toolbar --command message-box`; `pano_cli plan-main-toolbar --command clear-canvas --no-canvas`; `ctest --preset desktop-fast --build-config Debug` | Open/save/settings/message-box routing, undo/redo/clear-history execution, and canvas-clear execution are owned by injected app/document/UI services with `App::init_toolbar_main` acting only as a UI adapter and no legacy toolbar adapter | -| DEBT-0036 | Open | Modernization | `pp_renderer_api`, `pp_paint_renderer`, `pano_cli plan-paint-feedback`, and `pano_cli plan-stroke-composite` can choose backend-neutral complex paint feedback strategies for fixed-function blending, framebuffer-fetch-capable renderers, or ping-pong render targets. OpenGL extension detection now stores `pp::renderer::RenderDeviceFeatures` through `ShaderManager`, using `pp_renderer_gl::query_opengl_capability_detection`, `detect_opengl_feature_state`, and `render_device_features` as the backend conversion point; that feature snapshot now includes float32-linear filtering, so canvas stroke texture format selection, renderer diagnostics, grid lightmap render planning, and grid bake target selection no longer read `ShaderManager::ext_*` flags directly. `pp_paint_renderer::plan_canvas_blend_gate` owns the compatibility mapping from persisted layer/brush blend indices to the extracted stroke-composite planner, and live `Canvas::draw_merge` plus `NodeCanvas` panorama rendering both call it with the stored renderer-neutral feature set for their existing shader-blend gates and destination-copy versus framebuffer-fetch decisions. `pp_paint_renderer::plan_canvas_stroke_feedback` also owns the current destination-feedback decision, and live `Canvas::stroke_draw`, thumbnail layer blending, and `NodeStrokePreview` brush-preview rendering use it for framebuffer-fetch versus destination-copy decisions. The retained `copy_framebuffer_to_texture_2d` utility bridge now routes 2D framebuffer-to-texture copies through tested `pp_renderer_gl` dispatch, retained `RTT::create`/`RTT::destroy` render-target texture parameter setup, optional depth renderbuffer allocation, framebuffer allocation/attachment/status checks, binding restore, and resource deletion now route through tested `pp_renderer_gl` dispatch, retained RTT clear, masked clear with color-write-mask restore, texture bind/unbind, and RGBA8 dirty-region texture writes now route through tested `pp_renderer_gl` dispatch, retained Canvas, NodeCanvas, and NodeStrokePreview texture-unit switches now route through tested active-texture dispatch, retained Canvas, NodeCanvas, NodeStrokePreview, and desktop HMD viewport/scissor/capability execution now route through tested `pp_renderer_gl` dispatch adapters, retained NodeCanvas, CanvasMode, and NodePanelGrid capability-state snapshots now route through tested `pp_renderer_gl` query dispatch, CanvasLayer cube/equirect generation plus frame clears now share `legacy_ui_gl_dispatch` for active-texture selection, cube texture binding, viewport execution, blend capability execution, clear-color query/restore, and color-buffer clear adapter endpoints backed by tested `pp_renderer_gl` dispatch helpers, while the cube-face framebuffer-to-texture copy remains a retained local adapter tracked by DEBT-0036, `NodePanelGrid` live heightmap draw and bake setup now route depth/blend state, depth clears, color-write-mask toggles, active texture selection, bake viewport execution, sun-overlay viewport query, and desktop texture-resize readback through tested `pp_renderer_gl` dispatch adapters; its active-texture, depth/blend capability query/apply, viewport query/execution, depth-clear, and color-write-mask adapter endpoints now share `legacy_ui_gl_dispatch`, retained CanvasMode overlay/mask/transform paths now route active texture, depth/blend state, transform/cut viewport execution, paint-mode blend/depth state snapshots, and canvas-tip pick framebuffer readback through tested `pp_renderer_gl` dispatch adapters; their active-texture, capability query/apply, viewport, read-framebuffer query, and RGBA8 pixel-readback adapter endpoints now share `legacy_ui_gl_dispatch`, retained simple UI draw paths now share `legacy_ui_gl_dispatch` for blend-state execution, fallback 2D texture unbinds, `NodeViewport` viewport query/restore, color-buffer clears, and clear-color restore, retained `NodeCanvas` plus `NodeStrokePreview` draw-state paths now share `legacy_ui_gl_dispatch` for active-texture selection, fallback texture unbind, viewport/scissor execution, viewport and clear-color queries, color-buffer clears, clear-color restore, and capability query/apply adapter endpoints backed by tested `pp_renderer_gl` dispatch helpers, and retained `Canvas` plus `CanvasLayer` stroke/object/thumbnail/frame-clear draw-state paths now route saved viewport or clear-color query and restore through the same tested helpers, but actual live stroke rasterization, dual-brush compositing, pattern feedback math, thumbnail layer compositing, brush-preview compositing, grid lightmap/heightmap mesh rendering, and the retained `ShaderManager::ext_*` compatibility fields still use legacy OpenGL canvas/UI execution | Preserve current painting behavior while the renderer boundary matures for OpenGL parity and later Vulkan/Metal experiments | `pp_renderer_api_tests`; `pp_renderer_gl_capabilities_tests`; `pp_paint_renderer_compositor_tests`; `pano_cli plan-paint-feedback --framebuffer-fetch --explicit-transitions --render-only`; `pano_cli plan-paint-feedback --texture-copy`; `pano_cli plan-stroke-composite --stroke-blend 10 --framebuffer-fetch --explicit-transitions --render-only`; `pano_cli plan-stroke-composite --layer-blend 4 --dual-blend --texture-copy`; `ctest --preset desktop-fast --build-config Debug`; `cmake --build --preset windows-msvc-default --config Debug --target PanoPainter` | Live stroke/layer compositing chooses its feedback path through `pp_paint_renderer` and renderer services, with OpenGL golden parity and Vulkan/Metal lab tests covering framebuffer-fetch and ping-pong behavior | +| DEBT-0036 | Open | Modernization | `pp_renderer_api`, `pp_paint_renderer`, `pano_cli plan-paint-feedback`, and `pano_cli plan-stroke-composite` can choose backend-neutral complex paint feedback strategies for fixed-function blending, framebuffer-fetch-capable renderers, or ping-pong render targets. OpenGL extension detection now stores `pp::renderer::RenderDeviceFeatures` through `ShaderManager`, using `pp_renderer_gl::query_opengl_capability_detection`, `detect_opengl_feature_state`, and `render_device_features` as the backend conversion point; that feature snapshot now includes float32-linear filtering, so canvas stroke texture format selection, renderer diagnostics, grid lightmap render planning, and grid bake target selection no longer read `ShaderManager::ext_*` flags directly. `pp_paint_renderer::plan_canvas_blend_gate` owns the compatibility mapping from persisted layer/brush blend indices to the extracted stroke-composite planner, and live `Canvas::draw_merge` plus `NodeCanvas` panorama rendering both call it with the stored renderer-neutral feature set for their existing shader-blend gates and destination-copy versus framebuffer-fetch decisions. `pp_paint_renderer::plan_canvas_stroke_feedback` also owns the current destination-feedback decision, and live `Canvas::stroke_draw`, thumbnail layer blending, and `NodeStrokePreview` brush-preview rendering use it for framebuffer-fetch versus destination-copy decisions. The retained `copy_framebuffer_to_texture_2d` utility bridge now routes 2D framebuffer-to-texture copies through tested `pp_renderer_gl` dispatch, retained `RTT::create`/`RTT::destroy` render-target texture parameter setup, optional depth renderbuffer allocation, framebuffer allocation/attachment/status checks, binding restore, and resource deletion now route through tested `pp_renderer_gl` dispatch, retained RTT clear, masked clear with color-write-mask restore, texture bind/unbind, and RGBA8 dirty-region texture writes now route through tested `pp_renderer_gl` dispatch, retained Canvas, NodeCanvas, and NodeStrokePreview texture-unit switches now route through tested active-texture dispatch, retained Canvas, NodeCanvas, NodeStrokePreview, and desktop HMD viewport/scissor/capability execution now route through tested `pp_renderer_gl` dispatch adapters, retained NodeCanvas, CanvasMode, and NodePanelGrid capability-state snapshots now route through tested `pp_renderer_gl` query dispatch, CanvasLayer cube/equirect generation plus frame clears now share `legacy_ui_gl_dispatch` for active-texture selection, cube texture binding, viewport execution, blend capability execution, clear-color query/restore, and color-buffer clear adapter endpoints backed by tested `pp_renderer_gl` dispatch helpers, while the cube-face framebuffer-to-texture copy now uses the shared retained `copy_framebuffer_to_texture_target` utility bridge backed by tested `pp_renderer_gl` dispatch and remains tracked by DEBT-0036 until renderer services own copy execution, `NodePanelGrid` live heightmap draw and bake setup now route depth/blend state, depth clears, color-write-mask toggles, active texture selection, bake viewport execution, sun-overlay viewport query, and desktop texture-resize readback through tested `pp_renderer_gl` dispatch adapters; its active-texture, depth/blend capability query/apply, viewport query/execution, depth-clear, and color-write-mask adapter endpoints now share `legacy_ui_gl_dispatch`, retained CanvasMode overlay/mask/transform paths now route active texture, depth/blend state, transform/cut viewport execution, paint-mode blend/depth state snapshots, and canvas-tip pick framebuffer readback through tested `pp_renderer_gl` dispatch adapters; their active-texture, capability query/apply, viewport, read-framebuffer query, and RGBA8 pixel-readback adapter endpoints now share `legacy_ui_gl_dispatch`, retained simple UI draw paths now share `legacy_ui_gl_dispatch` for blend-state execution, fallback 2D texture unbinds, `NodeViewport` viewport query/restore, color-buffer clears, and clear-color restore, retained `NodeCanvas` plus `NodeStrokePreview` draw-state paths now share `legacy_ui_gl_dispatch` for active-texture selection, fallback texture unbind, viewport/scissor execution, viewport and clear-color queries, color-buffer clears, clear-color restore, and capability query/apply adapter endpoints backed by tested `pp_renderer_gl` dispatch helpers, and retained `Canvas` plus `CanvasLayer` stroke/object/thumbnail/frame-clear draw-state paths now route saved viewport or clear-color query and restore through the same tested helpers, but actual live stroke rasterization, dual-brush compositing, pattern feedback math, thumbnail layer compositing, brush-preview compositing, grid lightmap/heightmap mesh rendering, and the retained `ShaderManager::ext_*` compatibility fields still use legacy OpenGL canvas/UI execution | Preserve current painting behavior while the renderer boundary matures for OpenGL parity and later Vulkan/Metal experiments | `pp_renderer_api_tests`; `pp_renderer_gl_capabilities_tests`; `pp_paint_renderer_compositor_tests`; `pano_cli plan-paint-feedback --framebuffer-fetch --explicit-transitions --render-only`; `pano_cli plan-paint-feedback --texture-copy`; `pano_cli plan-stroke-composite --stroke-blend 10 --framebuffer-fetch --explicit-transitions --render-only`; `pano_cli plan-stroke-composite --layer-blend 4 --dual-blend --texture-copy`; `ctest --preset desktop-fast --build-config Debug`; `cmake --build --preset windows-msvc-default --config Debug --target PanoPainter` | Live stroke/layer compositing chooses its feedback path through `pp_paint_renderer` and renderer services, with OpenGL golden parity and Vulkan/Metal lab tests covering framebuffer-fetch and ping-pong behavior | | DEBT-0037 | Open | Modernization | Recording lifecycle/export planning, export progress-dialog metadata, and execution dispatch now consume pure `pp_app_core` through `App::rec_start`, `App::rec_stop`, `App::rec_clear`, `App::rec_export`, `pano_cli plan-recording-session`, and the `RecordingServices` boundary; live execution is centralized in `src/legacy_recording_services.*`, retained MP4 export progress bar creation routes through `src/legacy_app_dialog_services.*`, and retained `PBO` allocation/readback/map/unmap/delete operations now route through tested `pp_renderer_gl` dispatch, but the bridge still owns legacy recording thread startup/shutdown, platform recorded-file cleanup, progress lifetime, retained `App::rec_loop` readback call sites, and `MP4Encoder::write_mp4` execution | Preserve current timelapse/MP4 behavior while recording moves toward app/document/renderer/video services | `pp_app_core_document_recording_tests`; `pp_renderer_gl_capabilities_tests`; `pano_cli plan-recording-session --running --frame-count 12`; `pano_cli plan-recording-session --platform-deletes-recorded-files`; `ctest --preset desktop-fast --build-config Debug` | Recording thread lifecycle, frame readback scheduling, platform cleanup, progress reporting, and MP4 writing are owned by injected app/renderer/video services with `App` methods acting only as adapters | | DEBT-0038 | Open | Modernization | Cloud upload/browse/bulk planning, cloud prompt/progress metadata, and execution dispatch now consume pure `pp_app_core` through `App::cloud_upload`, `App::cloud_upload_all`, `App::cloud_browse`, `pano_cli plan-cloud-upload`, `pano_cli plan-cloud-upload-all`, `pano_cli plan-cloud-browse`, `pano_cli plan-cloud-transfer`, and the `CloudServices` boundary; live execution is centralized in `src/legacy_cloud_services.*`, the app-owned `upload`/`download` CURL helpers now consume `pp_app_core` cloud transfer request/progress planning and the platform TLS-verification bypass policy before retained CURL setup, upload warning/publish/success prompts, upload/bulk progress dialog titles, download-progress prompt metadata, and formatted download progress text come from tested app-core plans, retained cloud prompt/progress creation routes through `src/legacy_app_dialog_services.*` via `App::message_box`/`App::show_progress` or direct bridge calls, and retained `Asset::open_url`, `LogRemote::net_init`, and `NodeDialogCloud::load_thumbs_thread` curl sites consume the `pp_platform_api` default TLS policy helper instead of spelling Android branches locally, but the bridge still uses legacy save-before-upload, app-owned curl helpers instead of an injected network service, upload form construction, response/error handling, retained prompt/progress lifetime, OpenGL context guarding, `NodeDialogCloud`, `Canvas` project open, layer refresh, and `ActionManager` reset | Preserve current cloud behavior while cloud/network/document import flows move toward app/document/platform services | `pp_app_core_document_cloud_tests`; `pp_platform_api_tests`; `pano_cli plan-cloud-upload --new-document --unsaved`; `pano_cli plan-cloud-browse --selected-file demo.ppi`; `pano_cli plan-cloud-upload-all --file-count 3`; `pano_cli plan-cloud-transfer --direction download --progress --disable-tls-verification`; `ctest --preset desktop-fast --build-config Debug` | Cloud upload/download, TLS policy, save-before-upload, progress reporting, cloud browse dialog, downloaded project opening, layer refresh, OpenGL context ownership, and action-history reset are owned by injected app/document/network/platform/renderer services with `App` methods acting only as adapters | | DEBT-0039 | Open | Modernization | Document-open planning and execution dispatch now consume pure `pp_app_core` through `App::open_document`, `pano_cli plan-open-route`, `DocumentOpenServices`, and `src/legacy_document_open_services.*`, but the bridge still opens ABR/PPBR import prompts before delegating import execution to `src/legacy_brush_package_import_services.*`, applies unsaved-project discard prompts, calls legacy project-open execution, refreshes layer UI, updates the app title, and clears legacy history directly | Preserve current file-open/import behavior while document loading and brush import move toward app/document/asset/UI services | `pp_app_core_document_route_tests`; `pp_app_core_document_session_tests`; `pano_cli plan-open-route --path D:/Paint/Scenes/demo.ppi --unsaved`; `pano_cli plan-open-route --path D:/Paint/Brushes/clouds.ABR --unsaved`; `ctest --preset desktop-fast --build-config Debug` | Brush import prompting, project-open execution, unsaved-project discard prompting, layer refresh, title updates, and history clearing are owned by injected app/document/asset/UI services with `App::open_document` acting only as an adapter | diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index c53d360..8706b4d 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -1153,10 +1153,11 @@ also live in `pp_renderer_gl`. Depth renderbuffer allocation/storage/delete and framebuffer depth attach/detach sequences used by retained `RTT` and canvas object-drawing helpers now execute through tested `pp_renderer_gl` dispatch contracts. 2D framebuffer-to-texture -copies used by canvas, transform, layer-conversion, panorama UI, and brush -preview paths now route through a tested `pp_renderer_gl` copy dispatch via the -retained `copy_framebuffer_to_texture_2d` utility bridge; the remaining cube-map -copy is tracked under `DEBT-0036`. RTT render-target clear, masked color clear +copies used by canvas, transform, layer-conversion, panorama UI, brush preview, +and CanvasLayer cube-face generation paths now route through a tested +`pp_renderer_gl` copy dispatch via the retained target-aware framebuffer-copy +utility bridge. The copy bridge remains retained until renderer services own +cube and 2D framebuffer copy commands under `DEBT-0036`. RTT render-target clear, masked color clear with color-write-mask restore, and texture bind/unbind dispatch now execute through `pp_renderer_gl`; renderer API render-pass color/depth/stencil clear-mask and clear-value mapping, and color-write-mask query tokens also live @@ -1232,8 +1233,9 @@ viewport execution, cube texture binding, color-buffer clears, clear-color query/restore, and RGBA8 read/write pixel mapping to `pp_renderer_gl`. Its active-texture, cube-texture binding, viewport, blend capability, clear-color, and color-buffer clear adapter endpoints now share `legacy_ui_gl_dispatch`; -the retained cube-face framebuffer-to-texture copy remains tracked under -DEBT-0036 until a renderer-owned cube copy command replaces it. +the cube-face framebuffer-to-texture copy now uses the shared retained +target-aware utility bridge and remains tracked under DEBT-0036 until a +renderer-owned cube copy command replaces it. `NodePanelGrid` heightmap preview and lightmap baking now delegate texture readback formats, sampler filters, depth/blend state, depth clears, viewport queries, color-mask booleans, active texture units, and float render-target @@ -2501,8 +2503,9 @@ Results: `legacy_ui_gl_dispatch` for active-texture selection, cube texture binding, viewport execution, blend capability execution, clear-color query/restore, and color-buffer clear adapter endpoints backed by tested renderer GL - backend dispatch contracts. The cube-face framebuffer-to-texture copy remains - the retained local copy bridge tracked by DEBT-0036. + backend dispatch contracts. The cube-face framebuffer-to-texture copy now + uses the shared retained target-aware utility bridge and remains tracked by + DEBT-0036 until renderer services own copy execution. - `NodePanelGrid` live heightmap drawing and bake setup now route depth/blend state, depth clears, color-write-mask toggles, active texture selection, and bake viewport execution through tested renderer GL backend dispatch diff --git a/src/canvas_layer.cpp b/src/canvas_layer.cpp index 1246b87..5b981b9 100644 --- a/src/canvas_layer.cpp +++ b/src/canvas_layer.cpp @@ -13,27 +13,6 @@ uint32_t Layer::s_count = 0; namespace { -void copy_opengl_tex_sub_image_2d( - std::uint32_t target, - std::int32_t level, - std::int32_t destination_x, - std::int32_t destination_y, - std::int32_t source_x, - std::int32_t source_y, - std::int32_t width, - std::int32_t height) noexcept -{ - glCopyTexSubImage2D( - static_cast(target), - static_cast(level), - static_cast(destination_x), - static_cast(destination_y), - static_cast(source_x), - static_cast(source_y), - static_cast(width), - static_cast(height)); -} - void apply_layer_viewport(std::int32_t x, std::int32_t y, std::int32_t width, std::int32_t height) { pp::legacy::ui_gl::apply_viewport(x, y, width, height, "Layer"); @@ -63,21 +42,14 @@ void copy_layer_framebuffer_to_texture( std::int32_t width, std::int32_t height) { - const auto status = pp::renderer::gl::copy_opengl_framebuffer_to_texture_2d( - pp::renderer::gl::OpenGlTexture2DFramebufferCopy { - .texture_target = texture_target, - .destination_x = destination_x, - .destination_y = destination_y, - .source_x = source_x, - .source_y = source_y, - .width = width, - .height = height, - }, - pp::renderer::gl::OpenGlTexture2DFramebufferCopyDispatch { - .copy_tex_sub_image_2d = copy_opengl_tex_sub_image_2d, - }); - if (!status.ok()) - LOG("Layer framebuffer-to-texture copy dispatch failed because: %s", status.message); + copy_framebuffer_to_texture_target( + texture_target, + destination_x, + destination_y, + source_x, + source_y, + width, + height); } void clear_layer_color_buffer(const glm::vec4& color) diff --git a/src/util.cpp b/src/util.cpp index b523cc2..9ae0b33 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -740,7 +740,8 @@ void check_OpenGLError(const char* stmt, const char* fname, int line) } } -bool copy_framebuffer_to_texture_2d( +bool copy_framebuffer_to_texture_target( + uint32_t texture_target, int destination_x, int destination_y, int source_x, @@ -751,6 +752,7 @@ bool copy_framebuffer_to_texture_2d( { const auto status = pp::renderer::gl::copy_opengl_framebuffer_to_texture_2d( pp::renderer::gl::OpenGlTexture2DFramebufferCopy { + .texture_target = texture_target, .level = level, .destination_x = destination_x, .destination_y = destination_y, @@ -769,6 +771,26 @@ bool copy_framebuffer_to_texture_2d( return true; } +bool copy_framebuffer_to_texture_2d( + int destination_x, + int destination_y, + int source_x, + int source_y, + int width, + int height, + int level) noexcept +{ + return copy_framebuffer_to_texture_target( + pp::renderer::gl::texture_2d_target(), + destination_x, + destination_y, + source_x, + source_y, + width, + height, + level); +} + size_t curl_data_handler(void *contents, size_t size, size_t nmemb, void *userp) { auto buffer = reinterpret_cast(userp); diff --git a/src/util.h b/src/util.h index 658c75a..e1baa0f 100644 --- a/src/util.h +++ b/src/util.h @@ -201,6 +201,15 @@ std::string str_replace(const std::string& string, const std::string& search, co size_t curl_data_handler(void *contents, size_t size, size_t nmemb, void *userp); size_t curl_data_write(void *ptr, size_t size, size_t nmemb, FILE *stream); void check_OpenGLError(const char* stmt, const char* fname, int line); +bool copy_framebuffer_to_texture_target( + uint32_t texture_target, + int destination_x, + int destination_y, + int source_x, + int source_y, + int width, + int height, + int level = 0) noexcept; bool copy_framebuffer_to_texture_2d( int destination_x, int destination_y,