You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port the canvas texture draw and display clear decisions to obs-core #2240
the early return (no mix, or texture not rendered);
the technique and multiplier for each pair of source and current colour spaces (Draw, DrawTonemap for 709-extended into sRGB, DrawMultiply with sdr_white_level / 80 into scRGB).
render_display_begin (libobs/obs-display.c.h):
the clear colour conversion: always sRGB when the host says so, linear for an sRGB canvas, sRGB otherwise;
the clear flags: colour only without the clear workaround;
whether to draw the solid-colour workaround.
These stay in C: every gs_* call in its order, the effect and param lookups, the blend state, obs_get_video_sdr_white_level() and the host query (C passes in their values), the swapchain, the resize and the viewport.
Plan (one PR, separate commits)
A behaviour-neutral move into libobs/obs-canvas-draw.c.h, as hidden functions. C asks each decision where it used to, so no gs_* call or getter is hoisted.
Characterization in test_canvas_draw_steps. It covers:
every pair of the four colour spaces, plus one value outside the enum;
SDR white levels of 80, 300 and 0;
both early returns;
every combination of the clear-colour and workaround flags.
RED, then GREEN: the safe Rust core plus shims, in a libobs.ported-canvas-draw group. Exported symbols are unchanged.
Tier 3 parity against the original C, exhaustive over spaces and flags, plus a proptest over f32 white levels taken as bit patterns. Also a deliberate-break check and port_comparison numbers.
These real-libobs tests must stay green on every lane: the canvas and multi-canvas render tests, the projector and display tests, and the HDR/SDR render tests. Grep test/cmocka for canvas, display, sdr_white.
Move the two decision tables into hidden functions in libobs/obs-canvas-draw.c.h (no EXPORT), with C still asking each decision where it used to, so no gs_* call or getter is hoisted.
Characterization in test_canvas_draw_steps (sorted into test-graph.json).
RED: Tier 1 tests against todo!() in rust/obs-core::canvas_draw.
GREEN: the safe core plus shims in a libobs.ported-canvas-draw group. Exports stay at 1766 on the C, hybrid and c-ref builds.
Tier 3: an oracle over the unchanged C, exhaustive over spaces and flags, a proptest over f32 white-level bit patterns, a mutation table, and port_comparison numbers.
The technique names mirror obs-source::draw_technique (#2206); obs-core can't depend on obs-source, so only the names this unit needs are mirrored. PR expected within a day.
Fixed by #2259 (merge commit 8349bb6): the canvas texture draw decisions (early return, technique, multiplier) and the display clear decisions (colour space, flags, solid-colour workaround) now live in rust/obs-core::canvas_draw, with C shims in the libobs.ported-canvas-draw group and Tier 1, 2 and 3 coverage.
Left: nothing from this unit. The gs_* calls, effect and param lookups, blend state, swapchain, resize and viewport stay in C as the issue planned, so there is no follow-up issue.
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2240.
libobs/obs-canvas-draw.c.h(no EXPORT), with C still asking each decision where it used to, so nogs_*call or getter is hoisted.test_canvas_draw_steps(sorted into test-graph.json).todo!()inrust/obs-core::canvas_draw.libobs.ported-canvas-drawgroup. Exports stay at 1766 on the C, hybrid and c-ref builds.f32white-level bit patterns, a mutation table, andport_comparisonnumbers.The technique names mirror
obs-source::draw_technique(#2206); obs-core can't depend on obs-source, so only the names this unit needs are mirrored. PR expected within a day.obs-core: Port the canvas texture draw and display clear decisions (o…
rdoupe commentedon Oct 25, 2026
Fixed by #2259 (merge commit 8349bb6): the canvas texture draw decisions (early return, technique, multiplier) and the display clear decisions (colour space, flags, solid-colour workaround) now live in
rust/obs-core::canvas_draw, with C shims in thelibobs.ported-canvas-drawgroup and Tier 1, 2 and 3 coverage.Left: nothing from this unit. The
gs_*calls, effect and param lookups, blend state, swapchain, resize and viewport stay in C as the issue planned, so there is no follow-up issue.