Repository navigation
Description
source_render() in libobs/obs-source.c.h (~574-650 on master, c8f086c) is still C. It is the draw behind both obs_source_default_render() (Rust, reached through the hidden adapter obs_source_default_render_source_render()) and obs_source_main_render() (being ported in #5974). Every decision in it is already Rust: obs_source_draw_plan_convert, _technique, _reads_white_level and _multiplier (obs-source source_draw_plan), the profiler begin/end (obs-core source_profiler) and obs_source_base_width/_height. What is left is the field reads, the texrender cache and the graphics calls.
Behavior the port keeps, read for read and call for call:
- Profiler:
source_profiler_source_render_begin()before anything,source_profiler_source_render_end()last, on both routes. - Read
gs_get_color_space()once, askobs_source_get_color_space(source, 1, ¤t), and take the format fromgs_get_format_from_space(). - No conversion:
info.video_render(context.data, effect)and nothing else. - Conversion: drop
color_space_texrenderwhen its format differs, create it (GS_ZS_NONE) when missing, reset it, and only whengs_texrender_begin_with_color_space()succeeds at the base size: blending off, clear to zero, ortho,video_render, blending on, end; then draw the texture with the default effect's technique,imageas sRGB,multiplierread from the SDR white level only when the plan says so, framebuffer sRGB on and restored, blendONE/INVSRCALPHApushed and popped, one sprite per pass.
Plan, one PR into obs-source (the shape of #5943 and #5974):
- Extract
source_render()verbatim into its own livecore-sourcefile, the adapter calling it unchanged. No behavior change. - Tier 1 RED in obs-source's existing category binary against a
todo!()core over a trait for the fields, the texrender cache and the graphics calls. - GREEN: safe core in
obs-source, the adapter as a hidden C ABI export inffi/, a one-access field adapter, the extracted file moved to a reference-only ported group. - Tier 3 parity against the original C in
obs-c-oracle: the same source states through both (no conversion, conversion with a cached texrender of the same and of a different format, a failed begin, a white-level read and none), comparing recorded calls and their order. - Tier 2: the existing cmocka cases that reach it through
obs_source_video_render()andobs_source_default_render()against the hybrid libobs and the C reference, plus a characterization of the conversion route if none reaches it.
No public header, C test or obs-websocket change.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Nov 30, 2026
/ready
rdoupe commentedon Nov 30, 2026
Claiming: #5976 port of source_render (extract, Tier 1 RED, GREEN, Tier 3 parity, Tier 2), the step after obs_source_main_render (#5974). I'll start once #5974 is merged, since both touch the same part of obs-source.c.h.
build: keep obs-source release modules in their own archive members (…