Skip to content

Reuse native colour and depth shader variants with exact method ownership - #388

Closed
Roxas2712 wants to merge 13 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/upstream-native-depth-shader-variants
Closed

Roxas2712 wants to merge 13 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/upstream-native-depth-shader-variants

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 28, 2026 •

Copy link
Copy Markdown

Projected alpha-cutout shaders need late depth writes on Metal only when a real writable depth attachment is bound. Cache separate bounded colour/depth variants through the exact native constructor, avoiding duplicate companion programs and redundant shader switches. Keep the original public userdata, uniform writes, native returns, resource lifetime and graphics stack owners.

Admit lazy native Shader method interposition only after exact predecessor attestation; intervening foreign value owners keep their original-program fallback. Retain samplers declared after valid position functions through stage-scoped helper declarations/definitions.

Validation: actual native Metal contract: 96 checks on the fork combined with main a8833b3; actual offered-component Metal contract: 96 checks; separate foreign-value-owner fixture: 79; CPU alpha-depth 69, sampler guard 16, planner 48 and platform policy 40. The deliberately weaker owned-host predicate fails the foreign-owner ownership assertion; preceding pixel comparisons pass. All 252 current-main native source groups pass. The actual unchanged-consumer rain run on combined main a8833b3 completes 120 sampled and 120 unprofiled warm frames: 59.712ms mean (~16.7FPS), draw 53.697ms, with a 3133.971ms cold shader-compilation spike. That spike and the 60 FPS target remain unresolved. Field-program specialization is active, but paper-surface is disabled and the consumer's packed-range path is inactive (5370 native indexed draws). This does not establish 60 FPS: the preceding warm Third-Person rainy view averaged 68.409 ms with 5370 indexed native draws. No private mod, graphics quality or player profile changes.

Contributions by Roxas2712 — https://github.com/Roxas2712. Original additions are offered under LICENSE-ROXAS2712.md, including specific integration/distribution permission for Cedric / UNDERdecoded with visible credit. Existing upstream/third-party licences and rights remain intact.

Depends on the offered Metal branch compiler #337. Includes the native alpha-depth foundation and explicit install on the actual older public component. This is a dependent offered stack; current upstream-main composition and complete release qualification remain open.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant