Repository navigation
Closed
Labels
claimedAn agent or person has claimed this; check the claim comment before starting
Description
Unit
This unit moves the per-item render decisions in libobs/obs-scene.c.h into rust/obs-scene, as a new module render_plan. The decisions are:
item_texture_enabledand its triggers (crop_enabled,scale_filter_enabled,default_blending_enabled,item_is_scene), which decide whether the item draws through a texture.- These choices in
render_item:- whether the texrender is kept, destroyed or created;
- the empty-source rule (libobs: Let a cropped item's transition end while its source is empty #573): a running show/hide transition renders even with no size;
- the clear colour (libobs: Draw Darken sources over white so transparency keeps the background #1406): white for Darken;
- which child is drawn (show transition, hide transition or the source);
linear_srgb.
are_texcoords_centered.- These choices in
render_item_texture: the effect (scale filter andoutput_scale, withupscalefor Area), the SDR white multiplier and the technique.
Every gs_* call, obs_source_video_render, the texrender objects, and the SDR white level lookup stay in C. C passes in the white level, the two scene_transition_active results, the source size, the colour spaces and the format match. The blend table (#1521) and calc_cx/calc_cy (#1947) are already ported.
Plan (one PR, separate commits)
- A behaviour-neutral move into
libobs/obs-scene-render-plan.c.h, as hidden functions.render_itemandrender_item_texturekeep every graphics call, in the same order, and read the plan. - Characterization:
test_scene_render_plan_steps. It covers:- each texture trigger alone, and none;
output_scaleat 0.5 ± 1 ulp, 1 ±EPSILON, and NaN;- each scale filter, with and without upscale;
- the 4 × 4 colour space pairs, with white levels of 80, 300 and 0;
- the child choice for visible/hidden × show/hide active;
are_texcoords_centeredon identity, a fractional translation, -0.0 and NaN. The C compares bytes, so -0.0 counts as not centred.
- RED, then GREEN: the safe Rust core plus shims, in a
libobs.ported-scene-render-plangroup. Exported symbols are unchanged. - Tier 3 parity against the original C. It is exhaustive over the enums and flags, runs proptests over
f32scales and matrices drawn from bit patterns, and compares the plan field by field. Plus a deliberate-break check andport_comparisonnumbers.
These real-libobs tests must stay green on every lane: test_item_transition_empty_source, test_darken_transparent, test_scene_rotated_scale_filter, test_scene_blend, test_visibility_transition and test_group_hide_transition_audio.
Metadata
Metadata
Assignees
Labels
claimedAn agent or person has claimed this; check the claim comment before starting
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Oct 23, 2026
Claiming: #2003.
test: Characterize the scene item render decisions
obs-scene: Add Tier 1 tests for the scene item render decisions port
obs-scene: Port the scene item render decisions
obs-scene: Check the scene item render decisions port against the C
docs: Record the scene item render decisions port
obs-scene: Port the scene item render decisions (obs-rust#2018)