Route stroke preview mixer composite through service
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. `NodeStrokePreview::stroke_draw_mix`
|
||||||
|
now reuses `legacy_canvas_stroke_composite_services.h` for mixer-pass
|
||||||
|
`kShader::CompDraw` binding and composite/pattern/dual uniform writes.
|
||||||
|
Mixer framebuffer, scissor/capability state, texture binding, and draw/copy
|
||||||
|
ordering remain retained legacy execution.
|
||||||
- 2026-06-13: DEBT-0036 was narrowed again. `NodeStrokePreview` final preview
|
- 2026-06-13: DEBT-0036 was narrowed again. `NodeStrokePreview` final preview
|
||||||
background capture, composite input binding/draw, and preview texture copy now
|
background capture, composite input binding/draw, and preview texture copy now
|
||||||
route through `legacy_canvas_stroke_preview_services.h`, with semantic preview
|
route through `legacy_canvas_stroke_preview_services.h`, with semantic preview
|
||||||
|
|||||||
@@ -1362,7 +1362,8 @@ ordering, RTT/texture binding, history mutation, and final dirty state storage.
|
|||||||
`NodeStrokePreview` also now consumes a tested preview composite sequence plan
|
`NodeStrokePreview` also now consumes a tested preview composite sequence plan
|
||||||
for mixer intent, and retained preview background capture, composite input
|
for mixer intent, and retained preview background capture, composite input
|
||||||
binding/draw, and preview texture copy are centralized behind
|
binding/draw, and preview texture copy are centralized behind
|
||||||
`legacy_canvas_stroke_preview_services.h`.
|
`legacy_canvas_stroke_preview_services.h`. Preview mixer-pass `CompDraw` setup
|
||||||
|
now also reuses `legacy_canvas_stroke_composite_services.h`.
|
||||||
It also owns renderer API texture-format to
|
It also owns renderer API texture-format to
|
||||||
OpenGL internal/pixel/component token mapping, including depth-stencil formats,
|
OpenGL internal/pixel/component token mapping, including depth-stencil formats,
|
||||||
for future backend texture objects. `Texture2D` 2D texture binding, upload,
|
for future backend texture objects. `Texture2D` 2D texture binding, upload,
|
||||||
|
|||||||
@@ -205,31 +205,30 @@ void NodeStrokePreview::stroke_draw_mix(const glm::vec2& bb_min, const glm::vec2
|
|||||||
if (b->m_pattern_flipx) patt_scale.x *= -1.f;
|
if (b->m_pattern_flipx) patt_scale.x *= -1.f;
|
||||||
if (b->m_pattern_flipy) patt_scale.y *= -1.f;
|
if (b->m_pattern_flipy) patt_scale.y *= -1.f;
|
||||||
|
|
||||||
ShaderManager::use(kShader::CompDraw);
|
|
||||||
ShaderManager::u_int(kShaderUniform::Tex, 0);
|
|
||||||
ShaderManager::u_int(kShaderUniform::TexStroke, 1);
|
|
||||||
ShaderManager::u_int(kShaderUniform::TexMask, 2);
|
|
||||||
ShaderManager::u_int(kShaderUniform::TexDual, 3);
|
|
||||||
ShaderManager::u_int(kShaderUniform::TexPattern, 4);
|
|
||||||
ShaderManager::u_vec2(kShaderUniform::Resolution, m_size);
|
|
||||||
ShaderManager::u_float(kShaderUniform::Alpha, 1);
|
|
||||||
ShaderManager::u_int(kShaderUniform::Lock, false);
|
|
||||||
ShaderManager::u_int(kShaderUniform::Mask, false);
|
|
||||||
ShaderManager::u_int(kShaderUniform::UseFragcoord, false);
|
|
||||||
ShaderManager::u_int(kShaderUniform::BlendMode, b->m_blend_mode);
|
|
||||||
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f));
|
|
||||||
const auto material = stroke_preview_material_plan(*b, false);
|
const auto material = stroke_preview_material_plan(*b, false);
|
||||||
ShaderManager::u_int(kShaderUniform::UseDual, material.composite_pass.use_dual);
|
pp::panopainter::setup_legacy_stroke_composite_shader(
|
||||||
ShaderManager::u_int(kShaderUniform::UsePattern, material.composite_pass.use_pattern);
|
pp::panopainter::LegacyStrokeCompositeUniforms {
|
||||||
ShaderManager::u_int(kShaderUniform::DualBlendMode, material.composite_pass.dual_blend_mode);
|
.resolution = m_size,
|
||||||
ShaderManager::u_vec2(kShaderUniform::PatternScale, patt_scale);
|
.pattern = {
|
||||||
ShaderManager::u_float(kShaderUniform::PatternInvert, b->m_pattern_invert);
|
.scale = patt_scale,
|
||||||
ShaderManager::u_float(kShaderUniform::PatternBright, b->m_pattern_brightness);
|
.invert = static_cast<float>(b->m_pattern_invert),
|
||||||
ShaderManager::u_float(kShaderUniform::PatternContrast, b->m_pattern_contrast);
|
.brightness = b->m_pattern_brightness,
|
||||||
ShaderManager::u_float(kShaderUniform::PatternDepth, b->m_pattern_depth);
|
.contrast = b->m_pattern_contrast,
|
||||||
ShaderManager::u_int(kShaderUniform::PatternBlendMode, material.composite_pass.pattern_blend_mode);
|
.depth = b->m_pattern_depth,
|
||||||
ShaderManager::u_vec2(kShaderUniform::PatternOffset, glm::vec2(b->m_pattern_rand_offset ? 0.5f : 0.0f));
|
.blend_mode = material.composite_pass.pattern_blend_mode,
|
||||||
ShaderManager::u_float(kShaderUniform::DualAlpha, material.composite_pass.dual_alpha);
|
.offset = glm::vec2(b->m_pattern_rand_offset ? 0.5f : 0.0f),
|
||||||
|
},
|
||||||
|
.mvp = glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f),
|
||||||
|
.layer_alpha = 1.0f,
|
||||||
|
.alpha_lock = false,
|
||||||
|
.mask_enabled = false,
|
||||||
|
.use_fragcoord = false,
|
||||||
|
.blend_mode = b->m_blend_mode,
|
||||||
|
.use_dual = material.composite_pass.use_dual,
|
||||||
|
.dual_blend_mode = material.composite_pass.dual_blend_mode,
|
||||||
|
.dual_alpha = material.composite_pass.dual_alpha,
|
||||||
|
.use_pattern = material.composite_pass.use_pattern,
|
||||||
|
});
|
||||||
|
|
||||||
m_sampler_linear.bind(0);
|
m_sampler_linear.bind(0);
|
||||||
set_active_texture_unit(0U);
|
set_active_texture_unit(0U);
|
||||||
|
|||||||
Reference in New Issue
Block a user