Skip to content

rust: Port libobs/graphics/graphics-active-shader-queries.c.h to obs-graphics #5248

Closed

Description

@zackees

Unit: libobs/graphics/graphics-active-shader-queries.c.h, gs_get_vertex_shader and gs_get_pixel_shader, targeting obs-graphics. Phase 6 graphics wrapper work under the testing policy; this is the Rust swap after the separately landed C-only prerequisite #5244.

Dependency: verify that #5244's extraction/characterization PR has merged and close the prerequisite with merge evidence before claiming this swap. The new frozen test/cmocka/test_graphics_active_shader_queries.c characterizes the original C in both C-reference/hybrid modes using real graphics_subsystem headers, gs_enter_context and recording fake export callbacks. Keep that C test and public headers unchanged.

Preserve the current thread-context check and exact debug diagnostics, NULL fallback, separate mandatory backend callback dispatch, original device identity and exact borrowed shader result including backend NULL. Queries must not load, mutate, destroy or acquire ownership of shaders. No GPU, real shader compilation, host capabilities, shader compiler or WebSocket work is required.

Acceptance: commit safe-core Tier 1 RED then GREEN in the existing obs-tests-graphics category, mirroring every frozen C assertion; add original-C Tier 3 differential call/result/diagnostic traces and kill a mutation; retain unchanged dual-library Tier 2 and exact export parity. Tier 4 is inapplicable. Keep private C-owned TLS/export-table access behind real narrow adapters with correct NULL-check order; do not duplicate private layouts in Rust or replace real runtime dependencies with aborting stubs. Move the complete extracted C unit to its reference-only ported group and register per-unit metadata/exports/oracle according to policy.

Every Rust-referenced adapter must be linked into EVERY standalone Rust-static consumer through real common support. Run the entire native_build:: module, a focused Linux Tier 2 build of EVERY *_rust target with -k 0, ci/windows_link_check.py, the new C fixture's explicit Windows/Darwin links, and a separate ci/cmocka_link_check.py --alias mac-arm64 pass if Windows fails. Fakes should stay export-table callbacks; if any global C fake is introduced, prove Darwin two-level namespace binding using the linked Mach-O's nm output. Run ./lint once and review shared-file/sibling conflicts before publication.

Refs #5244.

Prerequisite PR: #5247 (auto-merge armed at 8ce41f9). Its C-only characterization/extraction passed original/extracted dual-library runs, the complete native_build:: module, every Linux *_rust target, Windows/Darwin links, symbol parity and full lint before publication.

Activity

  1. added
    portPort a C unit to Rust (four-tier policy)
    readyMeets the definition of Ready; claimable
    P2Normal priority
    on Nov 19, 2026
  2. zackees commented on Nov 19, 2026

    @zackees
    MemberAuthor

    Claiming: #5248 in pool slot obs-studio6, branch port/5248-active-shader-queries. 1. Commit safe-core RED mirrors of the frozen characterization. 2. Implement the Rust swap with real const-device export dispatch and original-C differential traces. 3. Verify all graphics/native tests, every Linux Rust-static fixture, Windows/Darwin links and binding evidence, then lint and publish a ready PR subject to backpressure. Prerequisite #5247 merged as 9135554 and #5244 is closed. I will preflight against queued #5252 before publishing. First PR expected after the required local verification in this session.

  3. zackees commented on Nov 19, 2026

    @zackees
    MemberAuthor

    Landed on master in #5261 (21d99bf): the active vertex/pixel shader queries now run in safe Rust in obs-graphics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Normal priorityportPort a C unit to Rust (four-tier policy)readyMeets the definition of Ready; claimablesize:SHours

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions