LARP_PIPELINE_WAIT_MS>0 drops one-time BRDF/lighting LUT & Decoration… #347

Open
github-bot wants to merge 1 commit from github-bot/gh-347 into main AGit
Owner

@⁠bcefedgn on GitHub · 2026-12-05 23:25 UTC · original
bcefedgn:patch-1 → main · +21 −6 · 1 files · 1 commits · open

…Blend pixel shaders on world entry (black skin, dark lighting, broken hair)

Summary

Enabling LARP_PIPELINE_WAIT_MS=8 (documented in README.md and docs/environment-variables.md) bypasses waits_for_all() in crates/larp-gpu/src/pipeline/make.rs for graphics pipelines where !p.lasting(). On world entry, this drops one-time BRDF/lighting LUT and PS_DecorationBlend draws even with a warm 88,500+ pipeline cache, leaving those targets zeroed (pitch-black skin, dark/crushed interiors, white eyebrows, and broken hair lighting) on both Series S and Series X.

Root Cause in Code (verified on origin/main deb2a0d)

  1. In crates/larp-gpu/src/pipeline/make.rs (ready()): rust if !p.lasting() && let Some(budget) = pipeline_wait_budget() { wait_budgeted(p, frame, budget); } else if waits_for_all() { wait_for(p, frame); } When LARP_PIPELINE_WAIT_MS > 0, any non-lasting() graphics pipeline whose driver/blob load takes longer than the budget drops the draw instead of waiting for waits_for_all().
  2. Pending::lasting() (crates/larp-gpu/src/pipeline/make.rs) currently only returns true for compute pipelines and the four PS_BakeDecorations_* pixel shaders in crates/larp-gpu/src/draw.rs (BAKE_PIXEL_SHADERS): rust pub(crate) const BAKE_PIXEL_SHADERS: [&str; 4] = ["c0a7fe77b1862e10", "0d1575a396dfe513", "b7cfd8dda91ebb6b", "280967ad158cee0b"];

Exact Dropped One-Time Shaders (from --features diagnostics with LARP_PIPELINE_WAIT_MS=8)

Even with all 88,500+ shaders/pipelines cached (without_a_stored_shader=0, created_without_blob=0), loading them from blobs on world entry still exceeds the 8 ms per-frame budget and drops the following one-time graphics pipelines:

Frame Pixel Shader Hash Shader Entry Name
11938 fcee612943c008e0 PS_DecorationBlend_0011_ff00f5de_Wrapped

Notice why triggering a live frame_reset in-game (e.g., toggling upscaler in the F10 menu) partially restores skin and shadows: by that point the e4d137db LUT pipelines have finished loading in the background, and the frame_reset re-runs those 6 LUT passes, whereas earlier character PS_DecorationBlend passes from loading do not re-run.

Confirmed Workaround & Verification

Unsetting LARP_PIPELINE_WAIT_MS (or setting LARP_PIPELINE_WAIT_MS=0) restores waits_for_all() == true (0 without a host pipeline dropped) and completely fixes skin, lighting, shadows, and hair lighting from frame 1 (tested with 0 frame resets, both DLSS Performance and DLSS Quality + DLSS 2x Frame Generation on RTX 4070 Laptop 8 GB, Windows 11, driver 621.47).

Suggested Fix

Include the one-time BRDF/lighting LUT (e4d137db) and PS_DecorationBlend pixel shader hashes (plus any remaining PS_DecorationBlend_* variants if present) in BAKE_PIXEL_SHADERS / LASTING_PIXEL_SHADERS checked by Pending::lasting() in crates/larp-gpu/src/pipeline/make.rs + crates/larp-gpu/src/draw.rs so LARP_PIPELINE_WAIT_MS=8 still works safely without breaking initial world/character lighting:

pub(crate) const BAKE_PIXEL_SHADERS: [&str; 12] = [
    // PS_BakeDecorations_*
    "c0a7fe77b1862e10",
    "0d1575a396dfe513",
    "b7cfd8dda91ebb6b",
    "280967ad158cee0b",
    // PS_DecorationBlend_*
    "fcee612943c008e0",
    "d126bcae5d5d8d26",
    // One-time env BRDF / area light / hair phase LUT integration (e4d137db)
    "a467d848ace5810d",
    "8992ac65c3b6b5eb",
    "f9b6e2728e0628b0",
    "1b86ffadd1d70850",
    "8919e24c5ce2816a",
    "2a0d503ba0532798",
];

Additional Observation (Brief Note on Live frame_reset VRAM Retention)

While diagnosing this via F10 upscaler / upscaler_mode switches, diag.log also showed that a live frame_reset retains old alias pool + texture-object VRAM (499 MB -> 1011 MB alias pool, 785 MB -> 1403 MB texture objects, total card VRAM 6778 MB -> 7456 MB even 15s later), causing 8 GB GPUs to spill into Shared RAM (~2 FPS) on a subsequent live frame_reset. Happy to open a separate issue with full diag.log details if helpful.

Environment

  • OS: Windows 11 Pro (Build 26300)
  • CPU: AMD Ryzen 9 7940HS
  • GPU: NVIDIA GeForce RTX 4070 Laptop GPU 8 GB (Driver 32.0.16.2147 / 621.47)
  • RAM: 16 GB
  • larp: Checked against origin/main (deb2a0d, same BAKE_PIXEL_SHADERS / LARP_PIPELINE_WAIT_MS logic)
**@⁠bcefedgn** on GitHub · 2026-12-05 23:25 UTC · [original](https://github.com/gamingwithhomie/larp/pull/347) `bcefedgn:patch-1` → `main` · +21 −6 · 1 files · 1 commits · open …Blend pixel shaders on world entry (black skin, dark lighting, broken hair) ### Summary Enabling `LARP_PIPELINE_WAIT_MS=8` (documented in `README.md` and `docs/environment-variables.md`) bypasses `waits_for_all()` in `crates/larp-gpu/src/pipeline/make.rs` for graphics pipelines where `!p.lasting()`. On world entry, this drops one-time BRDF/lighting LUT and `PS_DecorationBlend` draws even with a warm 88,500+ pipeline cache, leaving those targets zeroed (pitch-black skin, dark/crushed interiors, white eyebrows, and broken hair lighting) on both Series S and Series X. ### Root Cause in Code (verified on `origin/main` `deb2a0d`) 1. In `crates/larp-gpu/src/pipeline/make.rs` (`ready()`): ```rust if !p.lasting() && let Some(budget) = pipeline_wait_budget() { wait_budgeted(p, frame, budget); } else if waits_for_all() { wait_for(p, frame); } ``` When `LARP_PIPELINE_WAIT_MS > 0`, any non-`lasting()` graphics pipeline whose driver/blob load takes longer than the budget drops the draw instead of waiting for `waits_for_all()`. 2. `Pending::lasting()` (`crates/larp-gpu/src/pipeline/make.rs`) currently only returns `true` for compute pipelines and the four `PS_BakeDecorations_*` pixel shaders in `crates/larp-gpu/src/draw.rs` (`BAKE_PIXEL_SHADERS`): ```rust pub(crate) const BAKE_PIXEL_SHADERS: [&str; 4] = ["c0a7fe77b1862e10", "0d1575a396dfe513", "b7cfd8dda91ebb6b", "280967ad158cee0b"]; ``` ### Exact Dropped One-Time Shaders (from `--features diagnostics` with `LARP_PIPELINE_WAIT_MS=8`) Even with all 88,500+ shaders/pipelines cached (`without_a_stored_shader=0`, `created_without_blob=0`), loading them from blobs on world entry still exceeds the 8 ms per-frame budget and drops the following one-time graphics pipelines: | Frame | Pixel Shader Hash | Shader Entry Name | | --- | --- | --- | | `11938` | `fcee612943c008e0` | `PS_DecorationBlend_0011_ff00f5de_Wrapped` | | `11939` | `d126bcae5d5d8d26` | `PS_DecorationBlend_0000_ff00f5de_Wrapped` | | `12063` | `a467d848ace5810d` | `PS_IntegrateEnvBRDF_e4d137db_Wrapped` | | `12063` | `8992ac65c3b6b5eb` | `PS_IntegrateEnvBRDF_Beckmann_e4d137db_Wrapped` | | `12063` | `f9b6e2728e0628b0` | `PS_IntegrateEnvBRDF_ThinFilm_e4d137db_Wrapped` | | `12063` | `1b86ffadd1d70850` | `PS_IridescenceSpectralIntegration_e4d137db_Wrapped` | | `12063` | `8919e24c5ce2816a` | `PS_AreaLightIlluminance_e4d137db_Wrapped` | | `12063` | `2a0d503ba0532798` | `PS_AnisotropicPhaseFunction_e4d137db_Wrapped` | Notice why triggering a live `frame_reset` in-game (e.g., toggling `upscaler` in the F10 menu) partially restores skin and shadows: by that point the `e4d137db` LUT pipelines have finished loading in the background, and the `frame_reset` re-runs those 6 LUT passes, whereas earlier character `PS_DecorationBlend` passes from loading do not re-run. ### Confirmed Workaround & Verification Unsetting `LARP_PIPELINE_WAIT_MS` (or setting `LARP_PIPELINE_WAIT_MS=0`) restores `waits_for_all() == true` (`0 without a host pipeline` dropped) and completely fixes skin, lighting, shadows, and hair lighting from frame 1 (tested with `0` frame resets, both DLSS Performance and DLSS Quality + DLSS 2x Frame Generation on RTX 4070 Laptop 8 GB, Windows 11, driver `621.47`). ### Suggested Fix Include the one-time BRDF/lighting LUT (`e4d137db`) and `PS_DecorationBlend` pixel shader hashes (plus any remaining `PS_DecorationBlend_*` variants if present) in `BAKE_PIXEL_SHADERS` / `LASTING_PIXEL_SHADERS` checked by `Pending::lasting()` in `crates/larp-gpu/src/pipeline/make.rs` + `crates/larp-gpu/src/draw.rs` so `LARP_PIPELINE_WAIT_MS=8` still works safely without breaking initial world/character lighting: ```rust pub(crate) const BAKE_PIXEL_SHADERS: [&str; 12] = [ // PS_BakeDecorations_* "c0a7fe77b1862e10", "0d1575a396dfe513", "b7cfd8dda91ebb6b", "280967ad158cee0b", // PS_DecorationBlend_* "fcee612943c008e0", "d126bcae5d5d8d26", // One-time env BRDF / area light / hair phase LUT integration (e4d137db) "a467d848ace5810d", "8992ac65c3b6b5eb", "f9b6e2728e0628b0", "1b86ffadd1d70850", "8919e24c5ce2816a", "2a0d503ba0532798", ]; ``` ### Additional Observation (Brief Note on Live `frame_reset` VRAM Retention) While diagnosing this via F10 `upscaler` / `upscaler_mode` switches, `diag.log` also showed that a live `frame_reset` retains old `alias pool` + texture-object VRAM (`499 MB -> 1011 MB` alias pool, `785 MB -> 1403 MB` texture objects, total card VRAM `6778 MB -> 7456 MB` even 15s later), causing 8 GB GPUs to spill into Shared RAM (~2 FPS) on a subsequent live `frame_reset`. Happy to open a separate issue with full `diag.log` details if helpful. ### Environment - **OS:** Windows 11 Pro (Build 26300) - **CPU:** AMD Ryzen 9 7940HS - **GPU:** NVIDIA GeForce RTX 4070 Laptop GPU 8 GB (Driver `32.0.16.2147` / `621.47`) - **RAM:** 16 GB - **larp:** Checked against `origin/main` (`deb2a0d`, same `BAKE_PIXEL_SHADERS` / `LARP_PIPELINE_WAIT_MS` logic) ```
### Summary

Enabling `LARP_PIPELINE_WAIT_MS=8` (documented in `README.md` and `docs/environment-variables.md`) bypasses `waits_for_all()` in `crates/larp-gpu/src/pipeline/make.rs` for graphics pipelines where `!p.lasting()`. On world entry, this drops one-time BRDF/lighting LUT and `PS_DecorationBlend` draws even with a warm 88,500+ pipeline cache, leaving those targets zeroed (pitch-black skin, dark/crushed interiors, white eyebrows, and broken hair lighting) on both Series S and Series X.

### Root Cause in Code (verified on `origin/main` `deb2a0d`)

1. In `crates/larp-gpu/src/pipeline/make.rs` (`ready()`):
   ```rust
   if !p.lasting()
       && let Some(budget) = pipeline_wait_budget()
   {
       wait_budgeted(p, frame, budget);
   } else if waits_for_all() {
       wait_for(p, frame);
   }
   ```
   When `LARP_PIPELINE_WAIT_MS > 0`, any non-`lasting()` graphics pipeline whose driver/blob load takes longer than the budget drops the draw instead of waiting for `waits_for_all()`.
2. `Pending::lasting()` (`crates/larp-gpu/src/pipeline/make.rs`) currently only returns `true` for compute pipelines and the four `PS_BakeDecorations_*` pixel shaders in `crates/larp-gpu/src/draw.rs` (`BAKE_PIXEL_SHADERS`):
   ```rust
   pub(crate) const BAKE_PIXEL_SHADERS: [&str; 4] =
       ["c0a7fe77b1862e10", "0d1575a396dfe513", "b7cfd8dda91ebb6b", "280967ad158cee0b"];
   ```

### Exact Dropped One-Time Shaders (from `--features diagnostics` with `LARP_PIPELINE_WAIT_MS=8`)

Even with all 88,500+ shaders/pipelines cached (`without_a_stored_shader=0`, `created_without_blob=0`), loading them from blobs on world entry still exceeds the 8 ms per-frame budget and drops the following one-time graphics pipelines:

| Frame | Pixel Shader Hash | Shader Entry Name |
| --- | --- | --- |
| `11938` | `fcee612943c008e0` | `PS_DecorationBlend_0011_ff00f5de_Wrapped` |
| `11939` | `d126bcae5d5d8d26` | `PS_DecorationBlend_0000_ff00f5de_Wrapped` |
| `12063` | `a467d848ace5810d` | `PS_IntegrateEnvBRDF_e4d137db_Wrapped` |
| `12063` | `8992ac65c3b6b5eb` | `PS_IntegrateEnvBRDF_Beckmann_e4d137db_Wrapped` |
| `12063` | `f9b6e2728e0628b0` | `PS_IntegrateEnvBRDF_ThinFilm_e4d137db_Wrapped` |
| `12063` | `1b86ffadd1d70850` | `PS_IridescenceSpectralIntegration_e4d137db_Wrapped` |
| `12063` | `8919e24c5ce2816a` | `PS_AreaLightIlluminance_e4d137db_Wrapped` |
| `12063` | `2a0d503ba0532798` | `PS_AnisotropicPhaseFunction_e4d137db_Wrapped` |

Notice why triggering a live `frame_reset` in-game (e.g., toggling `upscaler` in the F10 menu) partially restores skin and shadows: by that point the `e4d137db` LUT pipelines have finished loading in the background, and the `frame_reset` re-runs those 6 LUT passes, whereas earlier character `PS_DecorationBlend` passes from loading do not re-run.

### Confirmed Workaround & Verification

Unsetting `LARP_PIPELINE_WAIT_MS` (or setting `LARP_PIPELINE_WAIT_MS=0`) restores `waits_for_all() == true` (`0 without a host pipeline` dropped) and completely fixes skin, lighting, shadows, and hair lighting from frame 1 (tested with `0` frame resets, both DLSS Performance and DLSS Quality + DLSS 2x Frame Generation on RTX 4070 Laptop 8 GB, Windows 11, driver `621.47`).

### Suggested Fix

Include the one-time BRDF/lighting LUT (`e4d137db`) and `PS_DecorationBlend` pixel shader hashes (plus any remaining `PS_DecorationBlend_*` variants if present) in `BAKE_PIXEL_SHADERS` / `LASTING_PIXEL_SHADERS` checked by `Pending::lasting()` in `crates/larp-gpu/src/pipeline/make.rs` + `crates/larp-gpu/src/draw.rs` so `LARP_PIPELINE_WAIT_MS=8` still works safely without breaking initial world/character lighting:

```rust
pub(crate) const BAKE_PIXEL_SHADERS: [&str; 12] = [
    // PS_BakeDecorations_*
    "c0a7fe77b1862e10",
    "0d1575a396dfe513",
    "b7cfd8dda91ebb6b",
    "280967ad158cee0b",
    // PS_DecorationBlend_*
    "fcee612943c008e0",
    "d126bcae5d5d8d26",
    // One-time env BRDF / area light / hair phase LUT integration (e4d137db)
    "a467d848ace5810d",
    "8992ac65c3b6b5eb",
    "f9b6e2728e0628b0",
    "1b86ffadd1d70850",
    "8919e24c5ce2816a",
    "2a0d503ba0532798",
];
```

### Additional Observation (Brief Note on Live `frame_reset` VRAM Retention)

While diagnosing this via F10 `upscaler` / `upscaler_mode` switches, `diag.log` also showed that a live `frame_reset` retains old `alias pool` + texture-object VRAM (`499 MB -> 1011 MB` alias pool, `785 MB -> 1403 MB` texture objects, total card VRAM `6778 MB -> 7456 MB` even 15s later), causing 8 GB GPUs to spill into Shared RAM (~2 FPS) on a subsequent live `frame_reset`. Happy to open a separate issue with full `diag.log` details if helpful.

### Environment

- **OS:** Windows 11 Pro (Build 26300)
- **CPU:** AMD Ryzen 9 7940HS
- **GPU:** NVIDIA GeForce RTX 4070 Laptop GPU 8 GB (Driver `32.0.16.2147` / `621.47`)
- **RAM:** 16 GB
- **larp:** Checked against `origin/main` (`deb2a0d`, same `BAKE_PIXEL_SHADERS` / `LARP_PIPELINE_WAIT_MS` logic)
```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 23:36:04 +00:00
Author
Owner

@⁠vanya890 on GitHub · 2026-12-06 01:15 UTC · original

I checked this against the current upstream/main rather than only the PR base. The requested lasting-shader change is already present there: commit c048b3a (Fix #335: never budget-drop one-time LUT/decoration pipelines) adds the same 12 hashes to BAKE_PIXEL_SHADERS and updates Pending::lasting() / the dropped-once full-wait behavior in pipeline/make.rs. c048b3a is an ancestor of current upstream/main, and the PR's only changed file/hunk is now in the mainline code.

This PR appears superseded by the #335 fix already shipped in v1.1.6 and merged to main; I don't see any remaining delta to merge from this branch. Please close it as superseded to avoid reapplying the same change.

**@⁠vanya890** on GitHub · 2026-12-06 01:15 UTC · [original](https://github.com/gamingwithhomie/larp/pull/347#issuecomment-7449023944) I checked this against the current `upstream/main` rather than only the PR base. The requested lasting-shader change is already present there: commit `c048b3a` (`Fix #335: never budget-drop one-time LUT/decoration pipelines`) adds the same 12 hashes to `BAKE_PIXEL_SHADERS` and updates `Pending::lasting()` / the dropped-once full-wait behavior in `pipeline/make.rs`. `c048b3a` is an ancestor of current `upstream/main`, and the PR's only changed file/hunk is now in the mainline code. This PR appears superseded by the #335 fix already shipped in v1.1.6 and merged to `main`; I don't see any remaining delta to merge from this branch. Please close it as superseded to avoid reapplying the same change.
This pull request has changes conflicting with the target branch.
  • crates/larp-gpu/src/draw.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/347/head:github-bot/gh-347'
git switch 'github-bot/gh-347'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-347'
git switch 'github-bot/gh-347'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-347'
git switch 'github-bot/gh-347'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-347'
git switch 'main'
git merge --squash 'github-bot/gh-347'
git switch 'main'
git merge --ff-only 'github-bot/gh-347'
git switch 'main'
git merge 'github-bot/gh-347'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.