Skip to content

ambient: the light estimate's passes build under Proton (no isnan, system compiler, root signature apart) - #2160

Open
birdneststream wants to merge 4 commits into
trustno1-coder:mainfrom
birdneststream:ambient-passes-under-proton
Open

birdneststream wants to merge 4 commits into
trustno1-coder:mainfrom
birdneststream:ambient-passes-under-proton

Conversation

@birdneststream

Copy link
Copy Markdown

Fixes #2158. Three commits on main, all in ambient.rs (+ hlsl.rs):

  1. No isnan/isinf intrinsics in the passes' source. Wine's system compiler is fxc, which has neither (E5005: Function "isnan" is not defined), and a shader that fails there never reaches the fallback whole. The two uses are a clamp that a max/min pair does the same.
  2. The passes by the system compiler, the root signature serialized apart. hlsl::system_code compiles the source as it is (no [RootSignature] check: fxc drops the block with W5302 and the check turned that into a DXC cs_6_0 fallback, which vkd3d-proton refuses with vsir_parse: Failed to parse shader). The signature is built in ambient.rs::root_signature() from the RS definition. (DXC's -extractrootsignature blob gives E_INVALIDARG under Wine, hence the builder.)
  3. The signature's constants read from RS (num32BitConstants=N): main's RS grew to 14; with a signature made for 13 the RAISE pass read zeros — raise_opt_in_chroma_scrub_… catches it on hardware.

What does not change on Windows: the passes are cs_5_x HLSL that fxc compiles on every Windows host too; the signature built from RS is the one the passes declare.

Rig (wine-staging 11.22, RTX 5090, vkd3d-proton master), ambient:: tests: main 10 passed / 4 failed (the_passes_build: Module not found; the_passes_compile: KEEP: … Module not found) → this branch 13 / 2, the two left being WARP-only (neutral_probe_…, raise_opt_in_chroma_scrub_…: "clamp shader must compile on WARP", no WARP DLL under Wine). In play under GE-Proton 11 the passes build and the light estimate acts (VICTORY_AMBIENT=0.8 default; 0 is #1957's fallback), indoors lit for the first time.

Your Name added 2 commits November 29, 2026 09:58
…er (E5005: Function "isnan" is not defined)
…(no root-signature check), the root signature serialized apart; its constants read from the passes' RS
@ArturoWolff

Copy link
Copy Markdown

Source review of b727808d94bef8cca492198d5ab5c18655fba235: the separate root signature is a useful direction for Wine, but the neutral pass currently gets the wrong descriptor-table type.

  • ambient.rs:723–748 constructs parameters in the order constants, SRV table (ranges[0]), UAV table (ranges[1]), UAV u1, UAV u2.
  • root_signature(..., false) serializes the first two parameters (NumParameters = 2 at lines 761–764). That gives the neutral pass a t0 SRV table, not its u0 UAV table.
  • NEUTRAL_SOURCE at lines 932–935 declares three constants and DescriptorTable(UAV(u0)); make_neutral at lines 959–969 selects that false branch, and neutral_after at line 996 binds the image as the second parameter. The original main implementation derives the signature directly from this shader.

I would keep the five-parameter layout for the screen passes and explicitly select the UAV range as parameter 1 for the two-parameter neutral layout. This is a static binding mismatch, not a reproduced driver failure. It is also outside the coverage of the_passes_build (lines 1607–1612, which calls make, not make_neutral). The existing neutral pixel/bounds readback test starts by requiring WARP, so the reported Wine results do not establish the neutral path. A game-free root-layout check and the existing make_neutral colour/bounds readback on a physical adapter, as well as WARP where available, would make a good regression gate after correcting the layout.

For context, our two current-main RTX 4060/16 GiB Linux/GE-Proton11-14 startup trials have not reached visible gameplay. Their logs contain no ambient-module creation/failure records, and the requested RT builder stayed inactive with missing host pipelines. I therefore cannot yet corroborate the claimed lighting restoration or attribute our defective opening cinematic to the compiler path in #2158. Please keep the compiler fix and that separate builder-readiness problem distinct.

AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).

… table, as its RS declares (the first table built was the SRV's: a silent no-op, trustno1-coder#2160's review); the layout built over the ranges where they lie; a test reads the layout back
@birdneststream

Copy link
Copy Markdown
Author

You were right, and thank you: root_signature(.., false) serialized the first two parameters — constants and the SRV table — while NEUTRAL_SOURCE's RS declares constants and DescriptorTable(UAV(u0)). So the neutral pass has been dispatching with an SRV handle where it binds its UAV: a silent no-op, which is why nothing failed here either.

Fixed in the branch (Layout: the neutral pass's one table is the u0 UAV range; the screen passes' first table the t0 SRV), with a game-free regression gate, the_signatures_lay_out_as_the_passes_declare, that reads the layout back for both signatures (count, parameter types, each table's range type, the constants' count) — it fails on the previous commit and passes now, under Wine on hardware, no WARP needed. The screen passes' build test is green again too (my first cut of the refactor moved the ranges array under the parameters' pointers; caught by the_passes_build, fixed by building the parameters over the ranges where they lie).

Agreed on keeping the builder-readiness problem separate: #2158/#2160 are about the passes compiling at all under Proton, nothing about the RT builder. Your GE-Proton 11-14 trials never reaching gameplay is a different matter — if you open it with the logs, I will read them, but not in this PR.

@ArturoWolff

Copy link
Copy Markdown

Thanks for fixing that. I independently rechecked the exact new head 3fe250a8a79c26634ae23cd326a7cb585d6d300a (the previous reviewed head is its direct parent, and hlsl.rs is unchanged in the follow-up). Layout::parameters now chooses ranges[1] for the neutral table and ranges[0] for the screen table, with counts 2 and 5 respectively. The owning layout remains alive through the synchronous serialization call. This resolves the specific descriptor-type mismatch I reported at source level.

The new game-free test does use the production layout construction and catches the former neutral-table selection. One small coverage suggestion: its map_or(0, ...) can also yield the SRV range-type value when a range pointer is absent. I would explicitly assert the non-null range and its one descriptor/register, and regard this test as pre-serialization layout coverage, not GPU colour/bounds readback. The existing neutral-output readback still requires WARP. Your reported Wine build/layout results are useful; I have not yet executed the revised head on our RTX 4060.

Agreed on scope. Our separate startup observations are in the #2148 discussion, with the independently confirmed Proton compiler-memory measurement issue. The correction to that measurement is being qualified separately. I will keep startup evidence out of this lighting PR.

AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).

…ne descriptor (a missing range cannot pass as anything)
@birdneststream

Copy link
Copy Markdown
Author

Taken: the test now asserts each table's range pointer (expect), NumDescriptorRanges == 1 and the range's NumDescriptors == 1 before its type, and its doc says what it is — pre-serialization layout coverage; the neutral pass's colour/bounds readback still needs WARP. Pushed as the branch's head.

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.

Linux/Proton: the light estimate's passes never build (Wine fxc has no isnan; the root-signature check sends them to DXC, which vkd3d-proton refuses)

2 participants