Repository navigation
Description
Phase 6, graphics: replace the complete C extraction libobs/graphics/graphics-shader-matrix-queries.c.h with safe Rust in the existing obs-graphics crate after prerequisite PR #5184 (Refs #5132) merges. The prerequisite PR is #5184; its verified GREEN source is ff16e5fd3, signed/pushed as 612fe68.
The unit is gs_shader_get_viewproj_matrix and gs_shader_get_world_matrix. Preserve the public C signatures and diagnostics, context-before-shader validation, exact shader pointer and callback ordering, and borrowed backend result identity, including NULL. TLS context storage, field access, validators and graphics backend ownership remain behind a private C boundary. No GPU, shader compiler or matrix setter behavior belongs in this unit.
The prerequisite adds test/cmocka/test_shader_matrix_queries.c: no-context rejection, NULL-shader rejection inside a context, distinct viewproj/world dispatch with exact shader and parameter pointers, and silent NULL callback results. Keep this C test and all public headers unchanged. Port each assertion 1:1 into safe Rust Tier 1 RED tests in Graphics / obs-tests-graphics, then implement GREEN. Add original-C Tier 3 differential coverage and demonstrate a killed mutant. Run unchanged C tests against C-reference and hybrid libobs and verify exact dynamic export parity. Tier 4 does not apply; preserve the C++ WebSocket plugin.
Use the existing graphics PCH family, per-unit ported-source/export/oracle fragments and current source inventories; maintain sorted unity and test metadata. Register modules in the existing obs-graphics category, adding no Rust test executable. Link any real C adapter into every standalone Rust-static consumer via tests.d link support, never an aborting stub. Check Rust NULL handles before field-accessor calls. Avoid platform-width conversions on c_long (i32 on Windows, i64 on Linux/macOS), max_align_t and out-of-range enum sentinels.
Before publishing run the complete native_build:: module, a focused Linux Tier 2 build of two unrelated *_rust cmocka targets, Windows MSVC linkage and one full ./lint. Follow testing-policy.md, BUILD.md and coordination.md; Rust through soldr, Python through uv, publishing through ./push. Serialize shared graphics/test-graph edits with queued siblings.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Nov 19, 2026
Claiming: #5185 (swap gs_shader_get_viewproj_matrix and gs_shader_get_world_matrix to safe Rust in obs-graphics).
Plan, one PR:
First PR expected within a few hours.
rdoupe commentedon Nov 19, 2026
PR is up: #5194 (RED db341b9, GREEN c7dfcbd; Tier 1/2/3 evidence in the body). Auto-merge is armed, so it queues once PR CI is green.
rdoupe commentedon Nov 20, 2026
Done in #5194 (merged):
graphics/graphics-shader-matrix-queries.c.hnow builds only in its ported group and the entry points are Rust on master. The PR said Refs, so closing by hand.graphics: swap shader matrix-parameter queries to safe Rust (Refs obs…