You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port the shader-parser name lookups (get_shader_param_type, get_sample_filter, get_address_mode) to obs-graphics #839
claimedAn agent or person has claimed this; check the claim comment before startingenhancementNew feature or requestportPort a C unit to Rust (four-tier policy)
The three exported string-to-enum lookups at the top of libobs/graphics/shader-parser.c (shader-parser.h): get_shader_param_type, get_sample_filter, get_address_mode. Target crate: obs-graphics.
Phase and position
Phase 6, tracker #444 ("the effect/shader parser"), first slice. The rest of shader-parser.c fills struct shader_parser, which libobs-opengl and libobs-d3d11 read directly, so its layout is public contract and it gets its own scoping issue. effect-parser.c compiles through the graphics device inside ep_parse and is later still.
Dependencies and existing tests
astrcmpi/astrcmp_n (dstr, ported). No cmocka test covers these functions. Steps, per the testing policy's partial-file rule:
Behavior-neutral PR: move the three functions verbatim into libobs/graphics/shader-param-names.c (added to libobs/CMakeLists.txt).
RED, then GREEN; ENABLE_RUST_LIBOBS=ON drops the new file.
Notes
Quirks to pin as characterized: any type that starts with texture is a texture (astrcmp_n(type, "texture", 7)); Anisotropy/Point/Linear match case-insensitively but the MIN_MAG_* filter names only exactly; an unknown filter is GS_FILTER_LINEAR; the address-mode fallback is whatever the C returns past Border. A NULL argument crashes in C (strcmp(NULL)); the port returns the fallback (intentional difference).
Done: #840 moved the three lookups into graphics/shader-param-names.c, #843 characterized them (C only), and #844 ported them to obs-graphics (Tier 1 1:1; Tier 3 against the original with the C dstr.c on every known name in every case plus random names and bytes; Tier 2 249/249 OFF and ON; ENABLE_RUST_LIBOBS=ON drops the C file).
Intentional difference: a null name gives the fallback where C calls strcmp(NULL); get_address_mode(NULL) is CLAMP in both.
Left on #444's parser item: the rest of shader-parser.c (struct shader_parser is read directly by the GL/D3D11 backends, so its layout is contract) and effect-parser.c (ep_parse compiles through the graphics device); both need their own scoping.
claimedAn agent or person has claimed this; check the claim comment before startingenhancementNew feature or requestportPort a C unit to Rust (four-tier policy)
Activity
zackees commentedon Oct 15, 2026
Claiming: shader-parser name lookups
graphics/shader-param-names.c.test_shader_param_names.obs-graphics.First PR today.
graphics: Move the shader-parser name lookups into shader-param-names…
test: Characterize the shader-parser name lookups before port (obs-ru…
obs-graphics: Port the shader-parser name lookups (GREEN)
obs-graphics: Link obs-util into the shader-name parity test
obs-graphics: Test the shader-parser name lookups against todo!() stu…
obs-graphics: Port the shader-parser name lookups (GREEN)
obs-graphics: Link obs-util into the shader-name parity test
zackees commentedon Oct 15, 2026
Done: #840 moved the three lookups into
graphics/shader-param-names.c, #843 characterized them (C only), and #844 ported them toobs-graphics(Tier 1 1:1; Tier 3 against the original with the Cdstr.con every known name in every case plus random names and bytes; Tier 2 249/249 OFF and ON;ENABLE_RUST_LIBOBS=ONdrops the C file).Intentional difference: a null name gives the fallback where C calls
strcmp(NULL);get_address_mode(NULL)isCLAMPin both.Left on #444's parser item: the rest of
shader-parser.c(struct shader_parseris read directly by the GL/D3D11 backends, so its layout is contract) andeffect-parser.c(ep_parsecompiles through the graphics device); both need their own scoping.obs-graphics: Port the shader-parser name lookups (obs-rust#844)