Repository navigation
Conversation
The clamp that bounds indirect arguments was HLSL compiled at start-up: by D3DCompile on Windows, and on Linux by DXC, only if VICTORY_DXCOMPILER named one. Without it every indirect draw and dispatch was dropped as "not bounded" (several hundred a frame in the world), and with it DXC's LLVM took our fault handlers at its first compile, which had to be taken back. The clamp is now a module of ours (emit::clamp), built with the builder the translations 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. * Gone: the HLSL source, hostlib::compile_hlsl and its library, signals::reclaim, the DXC compile at device creation, the Fxc bindings. docs/linux.md no longer asks for libdxcompiler.so. 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 x86-64, RTX 5080, vkd3d-proton 30b0eb9: Microsoft's validator (libdxil.so 1.9.2609) takes the container; new GPU tests run every record kind and the budget against clamped; 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); a title run without DXC reaches the world with no "not bounded" drops; cargo test --workspace 418 passed; Windows type-check clean (cargo xwin check); cargo xtask policy. Not run on Windows. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
|
Closing this to send the change to Marvisak/VIctory main instead, where the same HLSL clamp exists. I'll link the new pull request here. |
Author
|
Now at Marvisak#1470. |
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.
For the native Linux runtime in Marvisak#526, on top of
d46727f. Independent of #1.Problem
The compute shader that bounds indirect arguments is HLSL compiled at start-up. On Linux that needs DXC, which is opt-in through
VICTORY_DXCOMPILER(Arch's package asserts, so nothing is loaded unasked). Without it every indirect draw and dispatch is dropped as "not bounded": several hundred per frame in the world on my machine. With it, DXC's LLVM replaces the fault handlers at its first compile and they have to be taken back.Change
The clamp becomes a module of ours, built with the same builder the translations and the stub shaders use, so 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).hostlib::compile_hlsland its library loader,signals::reclaim, the DXC compile at device creation, theFxcbindings.docs/linux.mdno longer asks forlibdxcompiler.so.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.This also takes
D3DCompileout of the Windows path. I could only type-check that side.Testing
Linux x86-64, RTX 5080 (driver 620.70), vkd3d-proton
30b0eb9.libdxil.sofrom DXC v1.9.2609) accepts the container.VICTORY_VKD3D=... cargo test -p victory-gpu indirect) run every record kind and the budget through the real pipeline and compare withclamped.d46727fwith DXC.cargo test --workspace: 418 passed, 0 failed.cargo xtask policypasses.cargo xwin checkis clean. Not run on Windows.One unrelated observation:
linux::vm::tests::physical_pages_map_alias_and_freefailed once in a full workspace run (region size 65536, expected 196608) and passed in the next seven. I have not looked into it.🤖 Generated with Claude Code