From 14ea181ec322a0493dd4040913c17b7278bfb6eb Mon Sep 17 00:00:00 2001 From: omigamedev Date: Sat, 13 Jun 2026 05:40:24 +0200 Subject: [PATCH] Route final texture setup sites through helper --- docs/modernization/debt.md | 4 ++++ docs/modernization/roadmap.md | 4 ++++ src/app_vr.cpp | 8 +++++--- src/node_canvas.cpp | 8 +++++--- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 47990b5..6a3e107 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -18,6 +18,10 @@ agent or engineer to remove them without reconstructing context from chat. ## Recent Reductions +- 2026-06-13: DEBT-0036 was narrowed again. `NodeCanvas` density-resolve and + desktop VR UI `Texture` shader setup now route through + `legacy_canvas_draw_merge_services.h`; those paths still own render target, + sampler/texture binding, viewport/state restoration, and draw execution. - 2026-06-13: DEBT-0036 was narrowed again. `CanvasModeTransform::on_Draw` and `CanvasModeFloodFill::on_Draw` retained `Texture` shader setup now route through `legacy_canvas_draw_merge_services.h`; the mode paths still own diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 078ff0f..676b5c2 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -3051,6 +3051,10 @@ Results: share the retained draw-merge texture shader setup helper for `Texture`, `Tex`, and `MVP` setup. Texture/sampler binding, viewport/state setup, and draw execution remain in the node paths. +- `NodeCanvas` density-resolve drawing and desktop VR UI drawing now share the + retained draw-merge texture shader setup helper, while render target, + sampler/texture binding, viewport/state restoration, and draw execution + remain in retained node/VR code. - `CanvasModeTransform::on_Draw` and `CanvasModeFloodFill::on_Draw` now share the retained draw-merge texture shader setup helper for `Texture`, `Tex`, and `MVP` setup. Active texture selection, sampler/texture binding, and draw diff --git a/src/app_vr.cpp b/src/app_vr.cpp index 7bfc559..f5c121f 100644 --- a/src/app_vr.cpp +++ b/src/app_vr.cpp @@ -475,9 +475,11 @@ void App::vr_draw(const glm::mat4& proj, const glm::mat4& camera, const glm::mat glm::translate(glm::vec3(0, 0, -1)) * glm::scale(aspect * tan_fov); sampler_linear.bind(0); - ShaderManager::use(kShader::Texture); - ShaderManager::u_int(kShaderUniform::Tex, 0); - ShaderManager::u_mat4(kShaderUniform::MVP, mvp); + pp::panopainter::setup_legacy_canvas_draw_merge_texture_shader( + pp::panopainter::LegacyCanvasDrawMergeTextureUniforms { + .mvp = mvp, + .texture_slot = 0, + }); set_active_texture_unit(0); uirtt.bindTexture(); m_face_plane.draw_fill(); diff --git a/src/node_canvas.cpp b/src/node_canvas.cpp index 429b268..dfa4ef0 100644 --- a/src/node_canvas.cpp +++ b/src/node_canvas.cpp @@ -765,9 +765,11 @@ void NodeCanvas::draw() m_sampler_nearest.bind(0); set_active_texture_unit(0); m_rtt.bindTexture(); - ShaderManager::use(kShader::Texture); - ShaderManager::u_int(kShaderUniform::Tex, 0); - ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-1, 1, -1, 1)); + pp::panopainter::setup_legacy_canvas_draw_merge_texture_shader( + pp::panopainter::LegacyCanvasDrawMergeTextureUniforms { + .mvp = glm::ortho(-1, 1, -1, 1), + .texture_slot = 0, + }); m_face_plane.draw_fill(); m_rtt.unbindTexture(); }