Route layer merge composite setup through helper

This commit is contained in:
2026-06-13 04:58:04 +02:00
parent 5838a8f4ce
commit a9d3c63ee0
3 changed files with 23 additions and 11 deletions

View File

@@ -18,6 +18,12 @@ agent or engineer to remove them without reconstructing context from chat.
## Recent Reductions ## Recent Reductions
- 2026-06-13: DEBT-0036 was narrowed again. `Canvas::layer_merge` now reuses
`legacy_canvas_stroke_composite_services.h` for retained layer-merge
`kShader::CompDraw` binding and source/destination blend uniform writes.
Render-task ordering, dirty face/box mutation, framebuffer copies, sampler
binding, texture binding, and draw execution remain in the retained Canvas
layer-merge path.
- 2026-06-13: DEBT-0036 was narrowed again. `Canvas::stroke_commit` now routes - 2026-06-13: DEBT-0036 was narrowed again. `Canvas::stroke_commit` now routes
its retained per-face commit order through its retained per-face commit order through
`execute_legacy_canvas_stroke_commit_sequence`, consuming the tested `execute_legacy_canvas_stroke_commit_sequence`, consuming the tested

View File

@@ -2984,6 +2984,10 @@ Results:
through retained callbacks, so the legacy body no longer owns the loop order through retained callbacks, so the legacy body no longer owns the loop order
directly. The callbacks still execute the existing OpenGL RTT, texture, directly. The callbacks still execute the existing OpenGL RTT, texture,
sampler, shader, history, and layer mutation work under DEBT-0036. sampler, shader, history, and layer mutation work under DEBT-0036.
- `Canvas::layer_merge` now shares the retained stroke composite shader helper
for its source-over-destination `CompDraw` uniform setup, while keeping the
existing layer dirty mutation, framebuffer copy, texture binding, and draw
order local to the Canvas layer-merge path.
- Canvas thumbnail layer blending now uses the same canvas destination-feedback - Canvas thumbnail layer blending now uses the same canvas destination-feedback
plan for framebuffer-fetch versus texture-copy decisions; the thumbnail draw plan for framebuffer-fetch versus texture-copy decisions; the thumbnail draw
itself still executes through retained OpenGL canvas code under DEBT-0036. itself still executes through retained OpenGL canvas code under DEBT-0036.

View File

@@ -1636,17 +1636,19 @@ void Canvas::layer_merge(int source_idx, int dest_idx) // m_layer index
m_sampler.bind(0); m_sampler.bind(0);
m_sampler_nearest.bind(1); m_sampler_nearest.bind(1);
{ {
ShaderManager::use(kShader::CompDraw); pp::panopainter::setup_legacy_stroke_composite_shader(
ShaderManager::u_int(kShaderUniform::Tex, 0); // dest pp::panopainter::LegacyStrokeCompositeUniforms {
ShaderManager::u_int(kShaderUniform::TexStroke, 1); // source .resolution = m_size,
ShaderManager::u_vec2(kShaderUniform::Resolution, m_size); .mvp = glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f),
ShaderManager::u_float(kShaderUniform::Alpha, m_layers[source_idx]->m_opacity); .layer_alpha = m_layers[source_idx]->m_opacity,
ShaderManager::u_int(kShaderUniform::Lock, false); .alpha_lock = false,
ShaderManager::u_int(kShaderUniform::UseFragcoord, false); .mask_enabled = false,
ShaderManager::u_int(kShaderUniform::BlendMode, m_layers[source_idx]->m_blend_mode); .use_fragcoord = false,
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f)); .blend_mode = m_layers[source_idx]->m_blend_mode,
ShaderManager::u_int(kShaderUniform::UseDual, false); .use_dual = false,
ShaderManager::u_int(kShaderUniform::UsePattern, false); .dual_alpha = 0.0f,
.use_pattern = false,
});
set_active_texture_unit(0); set_active_texture_unit(0);
m_tex2[i].bind(); m_tex2[i].bind();