Route thumbnail blend setup through helper
This commit is contained in:
@@ -18,6 +18,11 @@ agent or engineer to remove them without reconstructing context from chat.
|
|||||||
|
|
||||||
## Recent Reductions
|
## Recent Reductions
|
||||||
|
|
||||||
|
- 2026-06-13: DEBT-0036 was narrowed again. `Canvas::thumbnail_generate`
|
||||||
|
thumbnail layer `TextureBlend` shader setup now routes through
|
||||||
|
`legacy_canvas_draw_merge_services.h`; thumbnail generation still owns
|
||||||
|
destination feedback copies, sampler/texture binding, grid redraw, readback,
|
||||||
|
and draw execution.
|
||||||
- 2026-06-13: DEBT-0036 was narrowed again. Desktop VR checkerboard background
|
- 2026-06-13: DEBT-0036 was narrowed again. Desktop VR checkerboard background
|
||||||
shader setup now routes through `legacy_canvas_draw_merge_services.h`; VR
|
shader setup now routes through `legacy_canvas_draw_merge_services.h`; VR
|
||||||
still owns render state transitions, per-plane transforms, and draw
|
still owns render state transitions, per-plane transforms, and draw
|
||||||
|
|||||||
@@ -3024,6 +3024,10 @@ Results:
|
|||||||
- Desktop VR checkerboard background drawing now shares the retained draw-merge
|
- Desktop VR checkerboard background drawing now shares the retained draw-merge
|
||||||
shader setup helper, while render state transitions, per-plane transforms,
|
shader setup helper, while render state transitions, per-plane transforms,
|
||||||
and draw execution remain in retained VR code.
|
and draw execution remain in retained VR code.
|
||||||
|
- `Canvas::thumbnail_generate` thumbnail layer blending now shares the retained
|
||||||
|
draw-merge shader setup helper for per-layer `TextureBlend` uniforms, while
|
||||||
|
destination feedback copies, sampler/texture binding, grid redraw, readback,
|
||||||
|
and draw execution remain in retained Canvas code.
|
||||||
- `Canvas::stroke_draw_mix` now shares the retained stroke composite shader
|
- `Canvas::stroke_draw_mix` now shares the retained stroke composite shader
|
||||||
helper for mixer-pass `CompDraw` setup, while preserving its caller-specific
|
helper for mixer-pass `CompDraw` setup, while preserving its caller-specific
|
||||||
texture slot uniforms. Mixer framebuffer/scissor state, sampler and texture
|
texture slot uniforms. Mixer framebuffer/scissor state, sampler and texture
|
||||||
|
|||||||
@@ -2986,12 +2986,8 @@ Image Canvas::thumbnail_generate(int w, int h)
|
|||||||
apply_canvas_capability(blend_state(), false);
|
apply_canvas_capability(blend_state(), false);
|
||||||
auto plane_mvp = proj * m_mv * m_plane_transform[i] * glm::translate(glm::vec3(0, 0, -1));
|
auto plane_mvp = proj * m_mv * m_plane_transform[i] * glm::translate(glm::vec3(0, 0, -1));
|
||||||
|
|
||||||
ShaderManager::use(kShader::TextureBlend);
|
|
||||||
ShaderManager::u_int(kShaderUniform::Tex, 0);
|
|
||||||
ShaderManager::u_mat4(kShaderUniform::MVP, plane_mvp);
|
|
||||||
if (copy_layer_destination)
|
if (copy_layer_destination)
|
||||||
{
|
{
|
||||||
ShaderManager::u_int(kShaderUniform::TexBG, 2);
|
|
||||||
set_active_texture_unit(2);
|
set_active_texture_unit(2);
|
||||||
blendtex.bind();
|
blendtex.bind();
|
||||||
m_sampler_nearest.bind(2);
|
m_sampler_nearest.bind(2);
|
||||||
@@ -3008,8 +3004,15 @@ Image Canvas::thumbnail_generate(int w, int h)
|
|||||||
set_active_texture_unit(2);
|
set_active_texture_unit(2);
|
||||||
copy_framebuffer_to_texture_2d(0, 0, 0, 0, w, h);
|
copy_framebuffer_to_texture_2d(0, 0, 0, 0, w, h);
|
||||||
}
|
}
|
||||||
ShaderManager::u_int(kShaderUniform::BlendMode, m_layers[layer_index]->m_blend_mode);
|
pp::panopainter::setup_legacy_canvas_draw_merge_texture_blend_shader(
|
||||||
ShaderManager::u_float(kShaderUniform::Alpha, m_layers[layer_index]->m_opacity);
|
pp::panopainter::LegacyCanvasDrawMergeTextureBlendUniforms {
|
||||||
|
.mvp = plane_mvp,
|
||||||
|
.texture_slot = 0,
|
||||||
|
.destination_texture_slot = 2,
|
||||||
|
.use_destination_texture = copy_layer_destination,
|
||||||
|
.blend_mode = m_layers[layer_index]->m_blend_mode,
|
||||||
|
.alpha = m_layers[layer_index]->m_opacity,
|
||||||
|
});
|
||||||
set_active_texture_unit(0);
|
set_active_texture_unit(0);
|
||||||
m_layers[layer_index]->rtt(i).bindTexture();
|
m_layers[layer_index]->rtt(i).bindTexture();
|
||||||
m_face_plane.draw_fill();
|
m_face_plane.draw_fill();
|
||||||
|
|||||||
Reference in New Issue
Block a user