Skip to content

rust: Port the scene blend lookups in obs-scene.c to obs-scene-blend #1520

Closed

Description

@rdoupe

Unit

Port the scene blend lookups in libobs/obs-scene.c.h to a new crate rust/obs-scene-blend: the blend-mode table (blend mode → blend function/operation and the effect technique) and the Darken clear colour (from #1406). They are pure lookups.

Phase and position

Phase 6, entered by function extraction (testing-policy.md). Crate per naming.md's one-crate-per-component pattern, like rust/obs-scene-bounds; whether obs-scene units later share one crate is the maintainer's layout call (#444), cheap to fold later.

Dependencies and existing tests

No dependencies beyond the graphics enums. test_darken_transparent (#1406) covers the Darken path end to end. A dedicated characterization of every blend mode's mapping comes first.

Plan

  1. Function extraction PR: move the lookups verbatim into their own file (same unity group), plus a characterization test of every blend mode and the clear colour. Existing tests unchanged.
  2. Port PR after 1 lands: Rust in obs-scene-blend, shim swap under ENABLE_RUST_LIBOBS=ON, Tier 1, layout, Tier 3 parity, Tier 2 OFF/ON unchanged.

No intended behaviour changes.

Activity

  1. rdoupe commented on Oct 20, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #1520

    1. Function extraction PR: the blend lookups moved verbatim into their own file, with a characterization of every blend mode and the clear colour.
    2. The port, as its own PR after 1 merges.

    First PR expected today.

  2. added
    claimed
    on Oct 20, 2026
  3. rdoupe commented on Oct 20, 2026

    @rdoupe
    CollaboratorAuthor

    Scope note: #1521 moves only the blend-mode table (obs_blend_mode_params). The Darken clear colour is an inline condition in render_item() and the technique choice doesn't depend on the blend mode, so neither is a function that can move verbatim; extracting them would need new helpers, so they stay in obs-scene.c.h for now (test_darken_transparent still covers the clear colour). The port PR will cover the table.

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