Skip to content

rust: Port the source and filter render routing in obs-source.c to obs-source #2189

Closed

Description

@rdoupe

Unit

Port the source and filter render routing in libobs/obs-source.c.h to rust/obs-source, as a new module render_route. These decisions move:

  • source_render_video:
    • skip a source that is neither video nor a filter;
    • update async textures (and deinterlace) for an async input that is not being rendered as a filter;
    • skip a source with no data, or one that is disabled;
    • otherwise pick one route: filters, main render, filter target, deinterlace or async video.
  • obs_source_main_render: the default-effect rule and the sRGB-aware rule.
  • can_bypass and the route in obs_source_process_filter_begin_with_color_space:
    • no target or no parent;
    • bypass;
    • skip at zero size;
    • texrender reuse when the format matches;
    • default render versus video render of the target.
  • obs_source_process_filter_tech_end: bypass or texture, the default technique name, and the linear sRGB flag.
  • obs_source_skip_video_filter: the route, including the NULL parent and target guard from libobs: Draw nothing when a filter with no parent skips its video #2177.

These stay in C:

  • every gs_* call and texrender;
  • the source refs;
  • the render functions themselves;
  • get_base_width/get_base_height, since C passes the sizes in;
  • the debug markers.

Plan (one PR, separate commits)

  1. A behaviour-neutral move into libobs/obs-source-render-route.c.h, as hidden functions.
  2. Characterization in test_source_render_route_steps. It is exhaustive over the boolean inputs, every source type and colour space, and the NULL parent and target cases.
  3. RED, then GREEN: the safe Rust core plus shims, in a libobs.ported-source-render-route group. Exported symbols are unchanged.
  4. Tier 3 parity against the original C, exhaustive over all inputs. Also a deliberate-break check and port_comparison numbers.

These real-libobs tests must stay green on every lane:

  • test_filter_color_space
  • test_filter_skip_removed
  • test_scroll_filter_wide_source
  • test_color_correction_16f
  • test_darken_transparent
  • test_scene_rotated_scale_filter
  • test_slideshow_size
  • test_texture_render

Activity

  1. rdoupe commented on Oct 24, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2189.

  2. added
    claimed
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions