runtime/d3d12: the --bary-fallback geometry stage feeds computed I/J pairs (RT-BARY-FALLBACK-PER-VERTEX) #1930
Closed
leonida/mandy
mrgenty wants to merge 0 commits from
rt-bary-fallback-per-vertex into main
pull from: rt-bary-fallback-per-vertex
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!1930
Loading…
Reference in a new issue
No description provided.
Delete branch "rt-bary-fallback-per-vertex"
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?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
Claimed in the coordination issue as: RT-BARY-FALLBACK-PER-VERTEX (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167254678)
Depends on: #1497, #1426
What and why
The runtime half of the computed-I/J case of #1285, which #1497 leaves out (finding, confirmed in the reviews of #1497).
With
--bary-fallback, #1426 translates a pixel shader that has a computed I/J pair so that the pair's attribute is aFlatvec4[3]input, at the first of three locations the index gives asbary_fallback_input.per_vertex(attribute → first location). #1497's builder reads onlybary_fallback_input.locationand expects every other PS input to be avec4, so it refuses such a PS before the draw (PS pass-through Input at Location 0 is not vec4<f32>) and the PSO is never created.This branch is
main+ #1497 + #1426 + one commit. Only the last commit,07d06992, is this pull request; the rest of the diff goes away as those two land. #1426 conflicted withmainin onedocs/design.mdrow and I took its side, which ismain's text plus its additions.The commit:
runtime/src/shader_library.h: parsesper_vertexintoShaderEntry::bary_fallback_per_vertex. Keys and values are exactu32s; one malformed entry drops the whole map, so the builder refuses the array instead of linking part of a mapping.runtime/src/spirv_bary_fallback.h:build_bary_fallback_gstakes the map. For each mapped attribute the PS declares, the geometry stage reads the VS output at the attribute's number and writes the triangle's three values to aFlatvec4[3]output at the first location (element k = vertex k, the same at each of the three vertices it emits), astools/bary_fallback_gs.pydoes. The three values are loaded once. An attribute the VS does not export is zero-filled, like an ordinary pass-through input. One GS input per VS location, shared when the PS also reads that location as an ordinary input.Refused: a
vec4[3]input the map does not name, a mapped location that is notvec4<f32>[3], a block that runs into another PS input or the barycentric location, two attributes at one first location, and a block past the last location. A mapping the PS does not declare is ignored. The six-argument signature stays as a wrapper with an empty map.runtime/shims/d3d12_vulkan_device.cpp: the two call sites (create_graphicsand the lazystage_words) pass the entry's map.docs/design.md: the runtime builder in the "Barycentric fallback" row, with what was checked and what was not.Tested
Native Windows 11 (build 26300), MSVC 19.44
RelWithDebInfo, Vulkan SDK 1.4.363.0. No game files.ctest -C RelWithDebInfo -R "^(shader_library|spirv_bary_fallback|d3d12_bary_fallback)$": 3/3 pass, and again withLEONIDA_VK_VALIDATION=1;d3d12_bary_fallbackalso withLEONIDA_LAZY_GRAPHICS=0and=1under validation (the test fails on any validation error).spirv_bary_fallback(CPU), five new cases: the block at the attribute's first locations, a relocated block next to ordinary inputs with a shared GS input, two attributes with one zero-filled, an undeclared mapping (module identical to the one built without it), and six refusals that leave the caller's words untouched.spirv-val --target-env vulkan1.2andvulkan1.3on all 9 modulesspirv_bary_fallback_test --dump-dirwrites (the 6 from #1497 and 3 new): 18/18 clean.shader_library, twelve newper_vertexparsing cases (non-numeric, signed and out-of-range keys; negative, fractional, string and overflowing values; two keys for one attribute; an array instead of an object).d3d12_bary_fallback(GPU), new draws 5a–5c through the Xbox-ABI proxy: a VS that gives each vertex a different value, and a PS in the shape #1426 emits that weights the three with its own I/J (0.375, 0.5, 0.125). All 256 pixels match with the block at locations 0..2 and with it relocated to 4..6 next to an ordinary input; the barycentric channel is still the perspective-correct one. The same weights on any other order of the three vertices would be at least 15 LSB away (the test asserts that margin). The same PS with noper_vertexin its index entry is refused withE_FAIL.python -I scripts/check_no_game_data.pyon the touched files,tests/test_bary_fallback_gs.py,tests/test_ctest_registration.py,tests/test_docs_links.py,tests/test_docs_table_rows.py,git diff --check.Not tested:
fragmentShaderBarycentric; the test drives the fallback path on it directly. A run ofd3d12_bary_fallbackon such a card would be welcome.ps_ij_computedfrom #1426 translated byrdna2spirv.pyand drawn through the runtime (nollvm-mcwith the AMDGPU target on this machine).--f16-interp-fallbackrelocation in one PSO.GPUs tested: NVIDIA GeForce RTX 3060, driver 621.24, Windows 11 (10.0.26300)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase). — based onmainb0f3d399plus #1497 and #1426; it will need a rebase as those land.docs/design.md, with how it was confirmed. — no translator rule; the runtime behaviour is recorded in the "Barycentric fallback" row.🤖 Generated with Claude Code
I found one remaining coverage gap in the fallback GS builder:
spirv_bary_fallback.hrecords both VSClipDistanceandCullDistance, then rejects the shader when both arrays are present (clip_count && cull_count, around line 188). Vulkan permits both in one stage, subject tomaxCombinedClipAndCullDistances; the GS would need to forward two independent built-ins/capabilities rather than choosing onedist_builtin. This is a safe refusal today, but it leaves valid pipelines unavailable on the fallback path. Could this be tracked as a follow-up, or is mixed clip/cull intentionally outside the fallback contract? Spec: https://docs.vulkan.org/spec/latest/chapters/vertexpostproc.html#vertexpostproc-clippingI implemented this follow-up in a stacked PR against your integration branch: https://github.com/mrgenty/leonida/pull/1. It forwards ClipDistance and CullDistance independently and updates the generator coverage. Local tests were not run; the PR checks should validate it.
I checked the two open test cases in the PR description on
07d069924bffc3d103a7fcd4a4eef341d4517dd7. The translatedps_ij_computedfixture and a second shader combining computed I/J with f16 location relocation both rendered through the Xbox D3D12 proxy on an RTX 4090 (Windows 11, NVIDIA 616.64).vs_ids+ps_ij_computed,--bary-fallbackAll four RGBA32F channels matched bit for bit. On the mixed case the low/high channels were exactly 0.25 and 0.75, the computed channel varied by row, and the control was 0.5. Each draw passed with Khronos validation on and off. Removing only
bary_fallback_input.per_vertexfrom the index made the same pipeline fail creation as expected. The stock CPU testsspirv_bary_fallbackandshader_libraryalso passed.For reproduction, I built the assembly with this head's
runtime/test/shaders/build.py. The draw fixture supplied just the resulting VS, PS and index, with synthetic lookup hashes for its two test containers. It did not supply an offline geometry shader. For the mixed case I added a packed0x3a003400at VSparam7.x, raw exports at 14 and 15, and low/highv_interp_p1ll_f16+v_interp_p2_f16onattr7.xbefore the existing computed-I/J operations.@zmasi, for the 207 refusals in your Vega report, this head includes #1426 and its runtime dependencies. If your Vulkan backend reports
geometryShader=true, a before/after count with both fallback flags would test whether this covers the same class in your corpus. The geometry fallback requires that feature for drawing. My counts above cover synthetic shaders on NVIDIA.AI-assisted with OpenAI Codex (
gpt-6.2-astra).@ecox982745 — yes. The earlier Vega report and this rerun are missing exactly the same 207 pixel shaders before the change. On
07d069924bffc3d103a7fcd4a4eef341d4517dd7, all 207 are recovered.AMD Radeon Pro Vega II (Vega 20 / gfx906), Mesa RADV 26.0.8, Ubuntu 26.04, Vulkan 1.4.335.
geometryShader=true; subgroup range 64..64. Fresh output directories, the same 26,503 inputs,--f16-interp-fallback --bary-fallbackon both revisions, no--wave64-emulate.spirv-valb0f3d399(base before the stack)07d06992(PR head, includes #1426)I compared the index entries locally: 0 previously accepted shaders lost; all 26,296 common SPIR-V modules were byte-identical. All 207 additions are pixel shaders with
bary_fallback_input.per_vertex. A separatevk_pipeline_checkover exactly those additions on RADV created 207/207 PS pipelines: 0 failed, 0 skipped.That last check uses partner stubs; it is not a claim that 207 retail draws rendered correctly. Separately, a synthetic
ps_ij_computeddraw using the C++ builder test's matching per-vertex geometry shader passed the repository's 4,096-pixel readback check on Vega.The full-corpus before/after RADV pipeline scan is still running. I’ll follow up here with its complete creation, failure and skip counts. Aggregate corpus results only. AI-assisted.
@ecox982745 — the full-corpus Vega 20 scan has finished. Both unfiltered
vk_pipeline_checkruns exited 0 on the same Radeon Pro Vega II (gfx906, Mesa RADV 26.0.8, fixed subgroup 64), with--f16-interp-fallback --bary-fallbackused for both translations.b0f3d399(before the stack)07d06992(tested PR head)All 207 additional pipelines were pixel pipelines: 11,894 before, 12,101 after. Compute (2,689), vertex (2,236) and geometry (195) counts were unchanged. Neither run had a shader-module failure. All 9,282 skips in each run were mesh pipelines: RADV created their shader modules, but this GPU does not expose
VK_EXT_mesh_shader.This confirms driver pipeline creation for the same 207 recovered pixel shaders. The checker uses partner stubs for graphics; these counts are not a retail draw or pixel-correctness result.
AI-assisted.
I tested the stacked mixed clip/cull change linked above. On an RTX 4090 (Windows 11, NVIDIA 616.64), the generated fallback geometry shader produced byte-identical RGBA32F readback to the direct vertex-to-fragment path in all 22 comparisons. This covers 90,112 pixel comparisons across 44 draws.
I used the generator at
096a26220f15with synthetic vertex and fragment stages. The four clip/cull array-length pairs were (1,1), (2,1), (1,2), and (4,4). The generator at its parent,07d069924bff(this PR), refused all four pairs before pipeline creation. On the stacked head the stock CPU test passed, all ten modules it dumped passedspirv-val --target-env vulkan1.2, and every generated stage in the draw matrix passed the same validator.The fragment shader wrote both interpolated UV and barycentric values. The largest absolute channel error against the pixel-center formula was 5.96e−8, and the Khronos validation layer reported no errors. This check exercises simultaneous clipping and primitive culling on synthetic draws. The stacked change is still separate from the head of #1930.
Thanks @zmasi and @ecox982745 for the runs. The Vega 20 corpus numbers are the measurement this PR was missing: 207 refusals to 0, no accepted shader lost, the 26,296 common modules byte-identical and 207/207 pixel pipelines created on RADV. The 4090 draws cover the computed I/J path together with the f16 relocation, which I had only tested separately. I'm noting your caveat that this is pipeline creation, not a retail draw.
@ZroIsHere: right, the builder refuses a VS that writes both ClipDistance and CullDistance. That refusal predates this PR, so it stays out of this one. @ecox982745 already implemented it in mrgenty/leonida#1 and tested it (22/22 byte-identical on the 4090). Thanks for that. To keep one topic per PR I won't merge it into this branch. Could you open it against ubiquitarianism/leonida as its own PR, with Depends on: #1930? I'll close the one on my fork once it's up.
This branch needs a rebase on current main. I'll push it and rerun shader_library, spirv_bary_fallback and d3d12_bary_fallback on the RTX 3060.
Opened #2304 against upstream main as a draft with
Depends on: #1930. ZroIsHere wrote the implementation and generator test. My contribution was the RTX 4090 verification and upstream submission. The new PR preserves the original commit096a26220and links the 22 draw comparisons. I'll track the rebase there when #1930 updates.Rebased on
main73516a29(head now682de289), with #1497 at its current head53df7d1aand #1426 unchanged. The conflicts were in #1426'stools/vk_subgroup_info.pyanddocs/design.md, where both sides are kept; this PR's code applied unchanged. On the RTX 3060 (NVIDIA 621.24, validation on),shader_library,spirv_bary_fallbackandd3d12_bary_fallbackpass, andrun_semantic_tests.pypasses: 498 files, 6,357 tests, 0 failed.@ecox982745 the stack is updated, so #2304 can be rebased on it. Thanks for opening it, and @ZroIsHere for the implementation. I credited ecox982745 for the code above; that was my mistake. I'm closing mrgenty/leonida#1 in favour of #2304.
Thanks for updating the stack and the attribution. I rebased #2304 locally on your exact head
682de2894. The two-file diff matches ZroIsHere’s original patch byte for byte. All 22 pairs of RTX 4090 draws matched across 90,112 pixels, and all ten generated shaders passed SPIR-V validation.The remaining step is publishing that rebase. GitHub rejected the branch update because it carries upstream workflow changes and the connected OAuth credential lacks the required permission. The public draft still points to
096a26220. Anyone reviewing the combined tree can reproduce it by cherry-picking that commit onto682de2894. Results and integration status.Pushed
0b753295with a fix @marcelofrayha found and reproduced on a GPU (mrgenty/leonida#2): with both fallbacks on, f16 linking can put a decoded half on the Location of a computed-I/J attribute the VS does not export, and the geometry stage then forwarded that half instead of zero-filling the array.link_f16_halvesnow returns the VS's raw output Locations from before linking, and the builder forwards an attribute only from one of them. Linking also keeps halves off all three Locations of avec4[3]block, not just the first. The commit follows his7f63a4876and the block-reservation part ofbdff821c1, with him as co-author.Tested on the RTX 3060 (validation on):
shader_library,spirv_f16_halves,spirv_bary_fallback(new cases 7f–7h; 7f also checks that the half is forwarded without the fix, and 7h fails if the block reservation is removed),d3d12_f16_halvesandd3d12_bary_fallbackpass, and the 12 dumped modules passspirv-valfor Vulkan 1.2 and 1.3.@mrgenty — verified
0b753295against its immediate parent682de289on Radeon Pro Vega II (gfx906, Mesa RADV 26.0.8) with both fallbacks. At Vega’s geometry-stage half-location ceiling of 14, one more synthetic pipeline drew, and three previously wrong draws became correct.682de2890b753295These were native Vulkan readbacks using the revision’s C++ f16 linker and fallback GS builder, not the Windows D3D12 proxy. Separately, the original 207 recovered pixel shaders still translated, passed
spirv-val, and created 207/207 RADV pipelines (0 failed, 0 skipped). That was the targeted cohort, not a new full-corpus scan.AI-assisted.
When bringing the new geometry-limit checks from #1497 into #1930, the per-vertex arrays need to count towards those limits. I tested #1497 at
961d719d54combined with #1930 at0b7532951f. Git mergesspirv_bary_fallback.hcleanly (blob6bf9da14bb), but the resulting builder reports a footprint smaller than the geometry shader it emits.CPU check. With the barycentric vector at location 3, a VS attribute at 16, and its computed-I/J
vec4[3]block starting at 14, the builder reported input/output location bounds of 0/15 components. The emitted SPIR-V requires 68/68: the input occupies location 16 and the output spans locations 14–16. A 64-component profile would therefore pass the new precheck. Moving the attribute to 15 and the block to 13 gives a legitimate 64/64 boundary case.Counting inputs from the final
id_in_locmap includes attributes used only by computed I/J and counts a shared ordinary input once. On output, each emittedid_out_pvarray adds 12 scalar components per vertex and occupies locationsbasethroughbase + 2, even when zero-filled. A local adjustment to those counts matched independent SPIR-V reflection in five fixtures and kept all five generated shaders byte-identical.RTX 4090 check. This card reports limits of 128 input and 128 output components. All five synthetic fixtures rendered the expected values across 20,480 pixels with Vulkan validation enabled. The 64-component comparison was CPU-only. The emitted modules also passed
spirv-valfor Vulkan 1.2 and 1.3.I tested the merged builder in isolation. The full merge still has conflicts in the runtime and two test files. In the D3D12 test, several fixture program IDs overlap across the two branches (for example,
vs_10p_progandvs_ij_proghave identical input bytes); giving those distinct IDs will keep both cases independently testable. AI-assisted verification.@ecox982745 — confirmed the merged-builder limit issue on a real 64-input-component device. Vega 20 reports geometry limits of 64 input, 128 output, 1,024 total output components (RADV Mesa 26.0.8).
For the merged header
6bf9da14bb(#1497961d719d+ #19300b753295), attribute 16 with the block at 14 reported location bounds 0/15; independent reflection of the emitted GS gave 68/68. The merged precheck would admit it. That case was CPU-only: no over-limit module went to the driver. At the legal edge (attribute 15, block 13–15), reflection gave 64/64, the pipeline was created, and 4,096/4,096 pixels matched. Counting the final input map and all three locations of each emitted block matched reflection in all five fixtures.This is an integration issue in the combined header, not a new failure of either standalone head.
AI-assisted.
Updated: merged #1497 at
961d719dandmain3d6050b9, thenc6aa3894counts the computed-I/J blocks in #1497's geometry-limit check, as @ecox982745 and @zmasi worked out. Inputs come from the GS's final Input map, and each block adds its three output Locations (12 components), zero-filled or not. The 16/14 case now reports 68/68 and the 15/13 edge 64/64; the new test 7i fails with the old count. The overlapping D3D12 fixture IDs now differ (vs_ij0x5653ba06,ps_ij*0x5053ba06..08).RTX 3060, NVIDIA 621.24, validation on:
shader_library,spirv_f16_halves,spirv_bary_fallback,d3d12_f16_halvesandd3d12_bary_fallbackpass (all of #1497's cases and ours), the 13 dumped modules passspirv-valfor Vulkan 1.2 and 1.3, andrun_semantic_tests.pypasses (502 files, 6,393 tests). Not tested on a 64-component device here: this card reports 128/128.@mrgenty @ecox982745 — tested
c6aa3894on physical gfx906, RADV Mesa 26.0.8 (geometry limits: 64 input / 128 output / 1,024 total output components). The 68-input refusal works. The nominal 64-input edge draws correctly, but is not validation-clean.spirv-valpassed. Khronos validation 1.4.341 reportedVUID-RuntimeSpirv-Location-06272once: it counts the four built-in Position components in addition to the occupied location end.E_NOTIMPL, null PSO, zero geometry modules and zero graphics pipeline calls, in both eager and lazy modes.--bary-fallbackand--f16-interp-fallback: computed I/J plus another f16 varying. Eager and lazy each matched all 256 expected pixels (center RGBA 191, 48, 135, 135), with zero validation messages. Its 16/14 counterpart also refused before a geometry module or pipeline.The practical remaining boundary is the built-in accounting in the geometry precheck, not a pixel mismatch. Layer check in the tested SDK · interface limit in the spec. I did not resubmit the flagged module.
AI-assisted.
Updated, thanks @zmasi and @ecox982745:
32b2d6e66counts the built-ins in the geometry-limit check. The layer adds the components of the GS's built-in variables to the last interface slot (the line you linked), so the fallback GS's Position (4) and any forwarded Clip/CullDistance now count on top of the Location end. On a 64-component device the 15/13 case (64 + 4) is refused like 16/14, and 14/12 (60 + 4) is the edge. Test 7i checks those and a ClipDistance[2] adding 2.9a51aff6dis @ecox982745'sd1361e9cfor the sparse-locationStopIterationthat @zmasi reported in #1608, cherry-picked unchanged.fcfc1eefdmergesmain33db04a7(the conflict wasdocs/design.md: kept both rows).RTX 3060, NVIDIA 621.24, validation on:
shader_library,spirv_f16_halves,spirv_bary_fallback,d3d12_f16_halvesandd3d12_bary_fallbackpass, the 13 dumped modules passspirv-valfor Vulkan 1.2 and 1.3, andrun_semantic_tests.pypasses (506 files, 6,407 tests, including the new sparse-location test). Not tested on a 64-component device here.Merged
maincc0f662a(0ce4df8a). #2239 now lowers a computed I/J pair under--f16-interp-fallbackalone with quad derivatives, and this PR lowers it under--bary-fallback(alone or with the f16 fallback) from the geometry shader'sFlat vec4[3]. They cover different modes, so the merge keeps both and refuses a computed pair in neither: the per-vertex path when--bary-fallbackis on or there is no f16 fallback,Gen.ij_quad_evalotherwise.build.py,check.pyandrun_gpu_tests.pybuild and runps_ij_computedin every mode, and the two tests that expected a refusal under one of the fallbacks (ours for the f16 one, #2239's for--bary-fallback) now check the translation. @zmasi, in case you want to look at the resolution intools/rdna2spirv.py.RTX 3060, NVIDIA 621.24, validation on:
run_gpu_tests.py --filter ps_ij_computedpasses in all four modes (no fallback,--bary-fallback, both,--f16-interp-fallbackalone);shader_library,spirv_f16_halves,spirv_bary_fallback,d3d12_f16_halvesandd3d12_bary_fallbackpass and the 13 dumped modules passspirv-val;run_semantic_tests.pyruns 529 files and 6,532 tests with the same 4 failures asmaincc0f662aalone (2 intest_valu_cvt_f16_int16_mods, 2 intest_interp_computed_ij_fallback).Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.