rdna2spirv: mesh shader pos1 misc export writes Layer and ViewportIndex per primitive (OLD-9893) #1197
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1197
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1197/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ambroseautomation on GitHub · 2026-11-24 20:01 UTC · original
ambroseautomation:carry/old-9893-ms-pos1-layer-viewport→main· +98 −26 · 3 files · 3 commits · merged 2026-11-25 03:12 UTCClaimed in the coordination issue as: OLD-9893 (#14)
What and why
Carries forward
old-pr/9893(draft #162, original commit authortedin7preserved; indexed in #17), rebased cleanly onto currentmain.Implements per-primitive
LayerandViewportIndexmesh shader outputs fromexp pos1misc vector exports intools/rdna2spirv.py:OSG1declaresSV_RenderTargetArrayIndex(Layer) and/orSV_ViewportArrayIndex(ViewportIndex), decodesz[10:0](Layer) and(z >> 16) & 0xF(ViewportIndex) fromexp pos1into%ms_layer/%ms_viewportand writes them into per-primitive members of%ms_cull_blk(BuiltIn Layer,BuiltIn ViewportIndex,PerPrimitiveEXT), emittingOpCapability ShaderLayer/OpCapability ShaderViewportIndexand reportingshaderOutputLayer/shaderOutputViewportIndexin shader metadata.tests/test_translate.py:test_ms_misc_pos1_exports_layer_and_viewport_per_primitive,test_ms_misc_pos1_layer_only_has_no_viewport_member, andtest_ms_without_misc_outputs_keeps_plain_primitive_block.Tested
tests/test_translate.pyfunctions directly viardna2spirv.translateand verified SPIR-V binary assembly viaspirv_asm.assemble(nollvm-mc/spirv-valinstalled on host): 3/3 PASS.python -I scripts/run_semantic_tests.py tests/semantic: 470 files, 6,168 tests, 0 files failed.python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/test_translate.py: exit 0 (no game data).GPUs tested: n/a (CPU SPIR-V interpreter semantic suite + in-process
spirv_asmassembly on Windows 11 Pro 64-bit, Python 3.12.10)AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (extends existing mesh shaderpos1export lowering)b07b9ecb0' into HEAD 2fc4224cda@Deedlyy on GitHub · 2026-11-24 20:07 UTC · original
Recommendation: [MERGE]
Reasoning: Carries #162: mesh shaders decode
LayerandViewportIndexfrom theexp pos1misc export and write them as per-primitive outputs whenOSG1declares them. Focused translator change with a translate test. No independent GPU run yet, but the change only takes effect when the outputs are declared. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict withmain. Merge once the queued checks are green.Impact level: 4/10
@aslan2142 on GitHub · 2026-11-25 03:12 UTC · original
Merged, after merging
maininto it. Thanks.OLD-9893, valid, before this PR; the only claim for the item.docs/design.md. It states one open point as a hypothesis: each lane writes the primitive with its own index, which is exact when the value is the same for all vertices of a primitive; whether the hardware takes the provoking vertex's value instead is not measured.pos1writesLayerorViewportIndexunder this translation, so the game's mesh shaders only gain three unused declarations each.OLD-9921) depends on this; its one conflict with it, inmesh_export, is resolved next by keeping both: the misc-vector return first, then the compressed components.mainb07b9ecb0+e950f8582: the semantic suite passes (487 files, 6,279 tests, 0 files failed);test_translate (pytest; 2 failing as on main)pass; the 14 docs and writer tests pass;check_no_game_data.pyis clean on the 3 changed files.AI-assisted (Claude Code, Claude Opus 5.5).