diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 582e95f..db3e0ee 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -18,6 +18,12 @@ agent or engineer to remove them without reconstructing context from chat. ## Recent Reductions +- 2026-06-13: DEBT-0036 was narrowed again. `Canvas::draw_merge` non-stroke + `TextureBlend` shader setup now routes through + `legacy_canvas_draw_merge_services.h`, preserving the optional `TexBG` + uniform only when copy-based blend destination feedback is active. Canvas + still owns draw-merge layer iteration, framebuffer copies, sampler/texture + binding, and draw ordering. - 2026-06-13: DEBT-0036 was narrowed again. `NodeCanvas` non-stroke `TextureBlend` shader setup now routes through `legacy_canvas_draw_merge_services.h`, including the optional destination diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index b1f7bf8..2fb95ff 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -2992,6 +2992,11 @@ Results: checkerboard backgrounds and the final merged texture redraw over the grid; layer traversal, blend destination copies, sampler/texture binding, and draw ordering remain in the legacy Canvas path. +- `Canvas::draw_merge` non-stroke layer blending now shares the retained + draw-merge shader setup helper for `TextureBlend` uniforms, preserving the + optional `TexBG` uniform when copy-based blend destination feedback is active. + Layer traversal, framebuffer copies, sampler/texture binding, and draw + ordering remain in the legacy Canvas path. - `Canvas::stroke_draw_mix` now shares the retained stroke composite shader helper for mixer-pass `CompDraw` setup, while preserving its caller-specific texture slot uniforms. Mixer framebuffer/scissor state, sampler and texture diff --git a/src/canvas.cpp b/src/canvas.cpp index 5f15750..7718186 100644 --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -1411,15 +1411,18 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array faces /*= SI m_sampler.bind(0); m_sampler.bind(2); - ShaderManager::use(kShader::TextureBlend); - ShaderManager::u_int(kShaderUniform::Tex, 0); - ShaderManager::u_int(kShaderUniform::BlendMode, m_layers[layer_index]->m_blend_mode); - ShaderManager::u_float(kShaderUniform::Alpha, 1.f); - ShaderManager::u_mat4(kShaderUniform::MVP, ortho); + pp::panopainter::setup_legacy_canvas_draw_merge_texture_blend_shader( + pp::panopainter::LegacyCanvasDrawMergeTextureBlendUniforms { + .mvp = ortho, + .texture_slot = 0, + .destination_texture_slot = 2, + .use_destination_texture = copy_blend_destination, + .blend_mode = m_layers[layer_index]->m_blend_mode, + .alpha = 1.f, + }); if (copy_blend_destination) { m_sampler.bind(2); - ShaderManager::u_int(kShaderUniform::TexBG, 2); } set_active_texture_unit(0);