Repository navigation
Conversation
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
The argument clamp charges rejected records to a 32-bit accumulator. After enough large records, the accumulator wraps and admits more work even though the list has already spent its budget. A 128-record test admits four maximum-cost draws when only two fit. Saturate the reservation at the work limit. Groups reserve their total once, so a large argument table avoids a compare-exchange loop for each record. Resolve the one group that crosses the limit in lane order. A single active group can update the counter directly because the UAV barriers between clamps already order its access. Read back large and small batches as well as the boundary inside a group. Counted dispatches now use a separate atomic witness shader to count commands even when the driver overlaps their dispatches. Based-on: Marvisak#1510 Based-on: fxceless/victory-fork@f85101b Depends-on: spidercraft#14 Tested-on: Fedora Linux 45, Intel Xeon E5-2670 v3, Lavapipe and AMD Radeon RX 6800 using native VKD3D-Proton. Microsoft FXC compiled both shaders as cs_5_1 under Wine. Assisted-by: gpt-6.2 sol xhigh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Native indirect clamping charges rejected records to a 32-bit counter, which can wrap and allow more work. The new readback case admits four maximum-cost records on the prerequisite branch. Two records fit the budget.
Saturate the counter when a group reserves work. The group that crosses the limit checks its records in lane order. Workgroups can still reserve out of order. The single-active-group path uses the existing UAV ordering and skips global atomics.
The regression also checks the cutoff within a group, untouched draw fields and 65,536 small records that all fit. Microsoft FXC compiled the clamp and the counted-dispatch witness at shader model 5.1.
GPU timestamp checks on the RX 6800 with synthetic valid records, median ticks per clamp:
The large valid-batch path takes longer on this adapter. The Lavapipe 16,384-record case took 335k ticks after the patch, down from 542k. These timings cover the clamp and its barriers.
Based-on: Marvisak#1510
Based-on: fxceless/victory-fork@f85101b
Depends-on: #14
Tested-on: Fedora Linux 45, Intel Xeon E5-2670 v3, Lavapipe and AMD Radeon RX 6800 with native VKD3D-Proton. 46 tests passed on Lavapipe and 4 focused tests passed on RX 6800.
Assisted-by: gpt-6.2 sol xhigh
Review this layer's diff.