Skip to content

GPU: clamp only the active native indirect records - #14

Draft
gmankab wants to merge 2 commits into
spidercraft:linux-native-runtimefrom
gmankab:contrib/native-indirect-count
Draft

gmankab wants to merge 2 commits into
spidercraft:linux-native-runtimefrom
gmankab:contrib/native-indirect-count

Conversation

@gmankab

@gmankab gmankab commented Nov 25, 2026 •

Copy link
Copy Markdown

The native ExecuteIndirect clamp currently checks MaxCommandCount records even when a title count buffer limits what will run. Garbage in inactive records can consume the list's work budget and suppress valid work.

Read and bound the count on the GPU, then store it beside the private argument records. ExecuteIndirect consumes that same snapshot. The clamp leaves the title's argument and count data intact, and returns buffers previously written by title UAVs to their legacy state before binding the title pipeline.

The regression uses an aliased title argument/count buffer and issues real indirect dispatches for counts of zero, one, and above the maximum. It checks the dispatch count, preserved title bytes and untouched inactive records.

Based-on: Marvisak#242
Depends-on: #11
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, Lavapipe and native VKD3D-Proton. The native GPU suite passed 45 tests. The counted-dispatch regression also passed on an AMD Radeon RX 6800 with RADV in a headless test.
Assisted-by: gpt-6.2 sol xhigh

Review this layer's diff.

An in-place clamp overwrites records in the title shadow buffer and transitions the entire buffer even when later commands bind other regions as vertex or shader input. Read the title records through an SRV and execute from a reusable per-list buffer so only the clamp output changes state. Keep previous allocations alive when the list grows and preserve the signed base vertex and other draw offsets.

Based-on: Marvisak@315cea1
Tested-on: Fedora Linux 45, Lavapipe and native VKD3D-Proton (44 GPU tests passed)
Assisted-by: gpt-6.2 sol xhigh
The native clamp walks MaxCommandCount even when a count buffer limits execution to fewer records. Inactive records can contain unrelated data and consume the per-list budget before a valid dispatch. Read the count in the clamp, skip the unused records, and store the bounded count beside the private arguments for ExecuteIndirect. Earlier UAV writers are ordered before the clamp and their title buffers are restored before the title pipeline binds.

Based-on: Marvisak#242
Depends-on: spidercraft#11
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, Lavapipe and native VKD3D-Proton (45 GPU tests)
Assisted-by: gpt-6.2 sol xhigh
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