Repository navigation
Conversation
The clamp that bounds indirect arguments was HLSL compiled at start-up
by D3DCompile. Under Wine the built-in compiler refuses it ("Method
'Load' is not defined on type 'RWByteAddressBuffer'"), so there is no
clamp and every indirect draw and dispatch is dropped.
The clamp is now a module of ours (emit::clamp), built with the builder
the translations and the stub shaders use, so no host needs an HLSL
compiler:
* Shader gains root UAVs (raw buffers, u<root parameter> in the root
descriptor space), in the resource metadata and PSV0.
* emit::clamp::argument_clamp builds the shader from its Limits, which
stay in victory-gpu; clamped is the same arithmetic in Rust.
* victory-gpu makes the root signature with the pipelines' helper (the
shader no longer carries one) and no longer needs the Fxc bindings.
The arithmetic is unchanged, with one difference: a divisor that the
HLSL left to the && (the group count in z) is made 1 when it is 0.
Tested on Linux only (RTX 5080, driver 620.70), not on Windows:
* under GE-Proton11-6, indirect::tests::argument_clamp_builds fails
before this change; the two GPU tests that replace it pass, running
every record kind and the budget through the real pipeline against
clamped. The other nine failures of cargo test --workspace there are
the same before and after;
* Microsoft's validator (libdxil.so, DXC v1.9.2609) takes the container;
* on a native vkd3d-proton build of this module, 5,461 random records
gave the same buffers as the HLSL clamp compiled by DXC, but for which
records a spent budget emptied (thread order);
* cargo clippy --workspace --all-targets -- -D warnings, with and
without --all-features, for x86_64-pc-windows-msvc; cargo xtask policy.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
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.
Problem
The compute shader that bounds indirect arguments is HLSL, compiled at start-up with
D3DCompile. Under Wine the built-in compiler refuses it:So there is no clamp, and every indirect draw and dispatch is dropped.
indirect::tests::argument_clamp_buildsfails on current main (ffe310e) under GE-Proton11-6 for this reason.Change
The clamp becomes a module of ours, built with the same builder the translations and the stub shaders use. No host needs an HLSL compiler.
Shadergains root UAVs (raw buffers,u<root parameter>in the root descriptor space), in the resource metadata andPSV0.emit::clamp:argument_clamp(&Limits)builds the shader;clampedis the same arithmetic in Rust, for tests and readers. The limits stay invictory-gpu.victory-gpumakes the clamp's root signature with the helper the pipelines use (the shader no longer carries one) and drops theFxcbindings.The arithmetic is unchanged, with one difference: where the HLSL relied on
&&to skip a division by a zero group count, the divisor is made 1.Testing
Linux only (RTX 5080, driver 620.70). Not run on Windows, so the native D3D12 runtime has not seen this shader; CI will cover the build and the tests that need no GPU.
clamped. They replaceargument_clamp_builds, which fails there before this change. The other nine failures ofcargo test --workspacein that environment are the same before and after (repository-path checks,WSAConnectByList, the pipeline library, the container-digest check).libdxil.sofrom DXC v1.9.2609) accepts the container.cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features, forx86_64-pc-windows-msvc.cargo xtask policypasses.I could not check the effect in the world under Wine: the title does not get that far there with this Proton's vkd3d-proton.
🤖 Generated with Claude Code