Skip to content

rust: Port graphics/shader-file.c to obs-graphics #4306

Closed

Description

@zackees

Phase 6 Rust swap for gs_vertexshader_create_from_file and gs_pixelshader_create_from_file, targeting obs-graphics. Depends on #4304 (C characterization plus behavior-neutral extraction to libobs/graphics/shader-file.c.h); that prerequisite must land first per testing-policy.md.

Preserve context-first/path validation, os_quick_read_utf8_file semantics (including BOM removal and empty/BOM-only read failure), distinct vertex/pixel failure logs, constructor arguments/error-string pointer identity, return values, and bfree ownership. Do not touch gs_effect_create_from_file, public C headers, existing C tests, or plugins/obs-websocket.

Test plan: Tier 1 safe Rust tests mirroring all assertions in test_shader_file_creators.c, RED against stubs then GREEN. Thin ABI shims and an original-C oracle give randomized Tier 3 parity, including failed reads and backend rejection. Run unchanged C characterization against hybrid and C reference, compare symbol sets (Tier 2), and mutation-check differential coverage. Tier 4 does not apply to these local file wrappers. Keep cases in obs-tests-graphics; no new Rust executable. Register port-specific source/export fragments and any real private-adapter link support required by Rust-static consumers.

The prerequisite branch is test/4304-shader-file-creators-extract (branch-only pool delivery; manager will open its PR when the queue drains).

Activity

  1. added
    enhancement
    port
    P2
    size:S
    on Nov 9, 2026
  2. zackees commented on Nov 9, 2026

    @zackees
    MemberAuthor

    Claiming: shader-file Rust swap in slot obs-studio4 (im-bo-sw-4306), branch port/4306-shader-file-creators, stacked on test/4304-shader-file-creators-extract at 957b757. 1. Verify direct C characterization. 2. Commit RED safe Rust tests, then GREEN core/ABI and C-oracle parity. 3. Run focused tiers and lint, push branch only; no PR until the queue drains.

  3. added
    ready
    on Nov 9, 2026
  4. moved this from In progress to Ready in obs-rust Multiviewon Nov 11, 2026
  5. zackees commented on Nov 18, 2026

    @zackees
    MemberAuthor

    Landed on master in #4587 (dfcecb6); verified the merge is an ancestor of origin/master and rust/obs-graphics/src/ffi/shader_file.rs exists there.

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

    P2enhancementportreadysize:S

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions