Sample mask: masked draws discard the pixels OMSetSampleMaskX leaves out (LOD crossfade) #1407

Closed
github-bot wants to merge 1 commit from github-bot/gh-1407 into main AGit
Owner

@⁠atk3001 on GitHub · 2026-11-28 19:15 UTC · original
atk3001:pr/sample-mask → main · +424 −16 · 10 files · 1 commits · closed without merging

What

GTA calls OMSetSampleMaskX (newer list slot 142, 0x470) to fade between an object's levels of detail. The old and the new level are drawn with complementary masks over each 2x2 quad: 25/50/75 % of the quad, e.g. 0x0000ffffffff0000 / 0xffff00000000ffff. All of these are mesh draws, across about 20 shader pairs in a few seconds of play. Until now slot 142 was ignored_state, so both levels drew every pixel during a fade.

  • Translator: with_pixel_mask makes a second translation of a pixel program. At entry it finds the pixel's place in its quad from SV_Position; when the signature has no SV_Position, it adds one. It reads its bit from a new host user-data dword, USER_PIXEL_MASK (0x108), and discards the pixel when the bit is clear. That translation also drops the early depth test, so a discarded pixel writes no depth.
  • GPU:
    • Slot 142 now records the mask (State::set_sample_mask).
    • A draw under a mask that leaves pixels out takes the pipeline's masked twin. Its pixel shader is Shader::masked, whose hash ends in -mask, so it has its own cache entry and pipeline-library entry.
    • The twin is made on first use, without waiting; the plain pipeline draws until it is ready.
    • The mask passed to the shader is each pixel's sample-0 bit, because host targets have one sample.
    • All other draws are unchanged and keep early-Z.
  • Added GraphicsState: Clone (the input names are re-pointed) and make::made_or_start.

Tests

  • New GPU test a_pixel_mask_draws_only_its_pixels_of_each_quad. On hardware and WARP, with and without SV_Position in the signature, each mask draws exactly its pixels, and the complementary pairs cover every pixel once.
  • victory-shader lib: 294 passed. victory-gpu lib: 454 passed.
  • Clippy: only the existing is_multiple_of warning.
  • xtask policy fails only on main's own bindings.ini.
  • Played on an RTX 5080: 136 masked pixel shaders and 205 masked mesh pipelines were made, with no failures, and the LOD fades look right.

Limits

  • A masked draw without a pixel shader (depth only) still writes every pixel.
  • The order of pixels in a quad is assumed to be x & 1 | (y & 1) << 1. Complementary masks cover each pixel once in either order.
  • A translator change: caches are translated again.

🤖 Generated with Claude Code

**@⁠atk3001** on GitHub · 2026-11-28 19:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1407) `atk3001:pr/sample-mask` → `main` · +424 −16 · 10 files · 1 commits · closed without merging ## What GTA calls `OMSetSampleMaskX` (newer list slot 142, 0x470) to fade between an object's levels of detail. The old and the new level are drawn with complementary masks over each 2x2 quad: 25/50/75 % of the quad, e.g. `0x0000ffffffff0000` / `0xffff00000000ffff`. All of these are mesh draws, across about 20 shader pairs in a few seconds of play. Until now slot 142 was `ignored_state`, so both levels drew every pixel during a fade. - **Translator:** `with_pixel_mask` makes a second translation of a pixel program. At entry it finds the pixel's place in its quad from `SV_Position`; when the signature has no `SV_Position`, it adds one. It reads its bit from a new host user-data dword, `USER_PIXEL_MASK` (0x108), and discards the pixel when the bit is clear. That translation also drops the early depth test, so a discarded pixel writes no depth. - **GPU:** - Slot 142 now records the mask (`State::set_sample_mask`). - A draw under a mask that leaves pixels out takes the pipeline's masked twin. Its pixel shader is `Shader::masked`, whose hash ends in `-mask`, so it has its own cache entry and pipeline-library entry. - The twin is made on first use, without waiting; the plain pipeline draws until it is ready. - The mask passed to the shader is each pixel's sample-0 bit, because host targets have one sample. - All other draws are unchanged and keep early-Z. - Added `GraphicsState: Clone` (the input names are re-pointed) and `make::made_or_start`. ## Tests - New GPU test `a_pixel_mask_draws_only_its_pixels_of_each_quad`. On hardware and WARP, with and without `SV_Position` in the signature, each mask draws exactly its pixels, and the complementary pairs cover every pixel once. - `victory-shader` lib: 294 passed. `victory-gpu` lib: 454 passed. - Clippy: only the existing `is_multiple_of` warning. - `xtask policy` fails only on main's own `bindings.ini`. - Played on an RTX 5080: 136 masked pixel shaders and 205 masked mesh pipelines were made, with no failures, and the LOD fades look right. ## Limits - A masked draw without a pixel shader (depth only) still writes every pixel. - The order of pixels in a quad is assumed to be x & 1 | (y & 1) << 1. Complementary masks cover each pixel once in either order. - A translator change: caches are translated again. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
GTA fades between an object's levels of detail with OMSetSampleMaskX
(newer list slot 142): the two levels are drawn with complementary 2x2
quad masks. The slot was ignored, so both levels drew every pixel.

A second translation of the pixel program (with_pixel_mask) discards
at entry each pixel whose quad bit is clear in a host dword
(USER_PIXEL_MASK) and drops early depth. Draws under a mask that leaves
pixels out take the pipeline's masked twin, made on first use (the
plain pipeline draws meanwhile); every other draw is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 19:19:20 +00:00
github-bot force-pushed github-bot/gh-1407 from 0938dd9b07 to 74daaa0d5e 2026-11-28 20:51:42 +00:00 Compare
Author
Owner

@⁠upipibi on GitHub · 2026-11-28 22:49 UTC · original

Tested on Ampere: RTX 3070 (10de:2484), driver 616.56, native Windows 11 Pro 10.0.26100, rustc 1.98.1. Debug test profile. The system WARP is the one that ships with Windows. Wave sizes tested: 32 lanes only (the 3070 reports WaveLaneCountMin/Max 32-32; WARP reports 4-4). The PR's program is a pixel shader, so the wave width does not enter its test.

  • Head 74daaa0d5, merged onto main d4b5d5170 (--no-ff, clean, no conflicts). The PR's base is 923e38cc, 3 commits behind main (the README, the issue forms and the label bot; none of them touch these files). The merge changes the same 10 files by the same +424/-16 as the PR. The head was still 74daaa0d5 and main still d4b5d5170 when I finished.

On the 3070, main's code draws every pixel under every mask. With the PR, each mask draws exactly its pixels of each quad. The PR's test renders on the device: a mesh triangle and a pixel program on a 16x16 target, on the 3070 and on WARP in the same run. It is not a CPU replay. Both controls below fail it on both adapters.

The test

export CARGO_TARGET_DIR=<separate target dir>
cargo test -p victory-shader --lib --locked -- --nocapture --test-threads=1 a_pixel_mask_draws_only_its_pixels_of_each_quad
VICTORY_WARP=1 cargo test ...   # same command

The filter matches only the new test, emit::tests::a_pixel_mask_draws_only_its_pixels_of_each_quad.

  • Default, 3 runs: 1 passed, 0 failed, 0 ignored each (0.60 to 0.71 s).
  • VICTORY_WARP=1, 3 runs: 1 passed, 0 failed, 0 ignored each (0.10 s).

The test loops over Host::new(false) and Host::new(true) itself. It moves on to the next adapter with a bare continue when Host::new fails, and to the next mask when root_signature_for fails. It prints no device with mesh shaders; skipped only when nothing at all was drawn. So a pass does not by itself show that both adapters drew. It printed nothing in any run here. The temporary probe below shows that both adapters drew every mask.

With VICTORY_WARP=1, Host::new(false) opens WARP too, so those runs draw on WARP twice and never on the 3070.

Adapters and wave sizes

A temporary probe test (below) prints GetDesc1 of the adapter behind device.GetAdapterLuid(), the D3D12_OPTIONS1 wave lane counts and the D3D12_OPTIONS7 mesh shader tier:

run Host::new adapter vendor:device flags wave lanes mesh tier
default false NVIDIA GeForce RTX 3070 10de:2484 0x0 32-32 1
default true Microsoft Basic Render Driver 1414:008c 0x2 (software) 4-4 1
VICTORY_WARP=1 false and true Microsoft Basic Render Driver 1414:008c 0x2 (software) 4-4 1

The pixels drawn (temporary probe)

I added a temporary test beside the PR's in emit/mod.rs. It makes the same draws for the same masks and both signatures, 3 rounds each. Instead of asserting, it prints the lit pixel count out of 256, the pixels that differ from the mask's quad pattern (x & 1 | (y & 1) << 1), whether the mask's user-data dword is there, and one lit and one dark texel. The DXIL passed the validator for every translation. I removed the probe before the lib suites.

Merge, on the 3070 and on WARP alike, with and without SV_Position in the signature, and the same in all 3 rounds:

mask translation dword lit / 256 wrong pixels
0b1111 plain absent 256 0
0b0110 masked at 0 128 0
0b1001 masked at 0 128 0
0b0001 masked at 0 64 0
0b1110 masked at 0 192 0
0b0000 masked at 0 0 0

Lit texels read [1.0, 1.0, 1.0, 1.0] and dark texels [0.0, 0.0, 0.0, 0.0].

Negative control A: main's lowering, PR's tests

I deleted only the three lines in Lower::lower that call self.pixel_mask(). with_pixel_mask then sets a flag that nothing reads, as if the translator were main's. It builds, with one extra warning (pixel_mask is never used).

  • Default, 3 runs: 0 passed, 1 failed, 0 ignored each.
  • VICTORY_WARP=1, 3 runs: 0 passed, 1 failed, 0 ignored each.

All six failed the same way, at emit/mod.rs:2429, before any draw:

assertion `left == right` failed: hardware with SV_Position: the mask's dword

So the test's own failure on main's code is the missing user-data dword, not a pixel. The probe (3 runs on this control, 3 rounds each) shows what the 3070 draws then. Every masked draw lights all 256 of 256 pixels, on the 3070 and on WARP alike, with and without SV_Position. Wrong pixels: 128 for 0b0110 and 0b1001, 192 for 0b0001, 64 for 0b1110 and 256 for 0b0000. No texel is dark. That is the double draw the description gives for the LOD fades.

Negative control B: the PR's dword, no discard

I deleted only the discard op in pixel_mask() and kept the SV_Position input, the user-data dword and the dropped early-depth flag. It builds, with one extra warning (kill unused).

  • Default, 3 runs: 0 passed, 1 failed, 0 ignored each.
  • VICTORY_WARP=1, 3 runs: 0 passed, 1 failed, 0 ignored each.

All six failed at emit/mod.rs:2463, on the first pixel check:

assertion `left == right` failed: hardware with SV_Position mask 0b0110: pixel (0, 0)

The probe on this control shows the dword at index 0 and again 256 of 256 pixels lit for every mask on the 3070. So the test's pixel check, not only its dword check, catches a translation that does not discard.

Lib suites (default features unless named; once each, except the diagnostics WARP row)

suite merge main d4b5d5170
cargo test -p victory-shader --lib --locked 349 passed, 0 failed, 8 ignored (290 s) 348 passed, 0 failed, 8 ignored (286 s)
cargo test -p victory-gpu --lib --locked 550 passed, 0 failed, 43 ignored 550 passed, 0 failed, 43 ignored
VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --lib --locked --features diagnostics run 1: 603 passed, 1 failed, 43 ignored; 7 runs: 5 clean, 2 with 1 failure 604 passed, 0 failed, 43 ignored; 5 runs: all clean

The extra victory-shader pass is the new test. The PR adds no victory-gpu tests, so those counts match.

The diagnostics WARP failures look like flakes in code the PR does not touch, but they came only on the merge. I ran that suite 7 times on the merge and 5 times on main. Main was clean every time. The merge was clean 5 times, and twice one test failed, a different one each time:

  • run 1: watch::tests::what_is_put_in_beside_the_guards_is_told_at_every_view (watch.rs:4789, assertion failed: published(two, two + BLOCK));
  • run 2: descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytes (descriptor/host.rs:6935, left: 6291456, right: 65536).

Neither file is in the PR. Run alone, the watch test passed 10 of 10 on the merge and 10 of 10 on main. Our earlier main baseline on this card already lists flaky descriptor::host tests. I did not find a way the PR's changes could reach either test, but 2 failures in 7 runs against 0 in 5 is not enough to rule it out.

VICTORY_D3D12_WARP=1 takes effect only in a --features diagnostics build: the shared test device host() (host.rs:893) checks it at host.rs:957. It changes nothing for the PR's own test, which is in victory-shader and reads VICTORY_WARP (emit/host.rs:175).

The PR adds no compiler warnings. Both builds print the same warnings: in victory-shader, main's unused colour; in victory-gpu, gpu never read, let_go and host_pressure_reclaimed never used, and three drop of a reference.

What the tests do not reach

The new test covers the translator only: with_pixel_mask and the pixel_mask() prologue. No test calls any of the victory-gpu side: slot 142 (sample_mask_x, in both the plain table and thin.rs), State::set_sample_mask and State::pixel_mask (the 64-bit mask to 4 pixel bits), the USER_PIXEL_MASK user-data value, host_pipeline_masked, make::made_or_start, Shader::masked, host_shader_masked with its separate cache key, and GraphicsState::clone with its re-pointed semantic names. I only read that code. By reading, the description's example masks 0x0000ffffffff0000 and 0xffff00000000ffff become 0b0110 and 0b1001, two of the masks the test draws.

The test has no depth target, so it does not check that a discarded pixel writes no depth (the dropped early-depth flag).

CI

gh pr checks 1407: no checks reported on the branch. I did not run clippy or cargo xtask policy. The PR has no comments or reviews yet.

Overlap

  • #1138's triage map was made against main 63b902fe and names no PR above #1373. It does not list #1407 or any sample-mask or LOD-fade item.
  • #1510 (console API conformance) also maps slot 142 to a function named sample_mask_x in list.rs. That one only logs the first eight distinct masks ("a quad sample mask the host does not apply") and has a test, sample_masks_are_noted_once_each. git merge-tree shows one conflict region, the NEWER_METHODS doc comment. The identical (142, sample_mask_x ...) lines merge silently, but the result would define sample_mask_x twice. Whichever lands second has to drop or rename its function. #1510 also lists 0x470 in a table of named methods.
  • I ran git merge-tree of #1407 against the 121 other open PRs that change any of its 10 files. 61 are clean with both main and the merge, and 51 already conflict with main. 9 merge cleanly with main but conflict with #1407:
    • #1555 (mesh fallback for GPUs without mesh shaders): pipeline.rs, 3 regions, and emit/mod.rs, 1 region. Both PRs give translate a second bool, #1407 masked and #1555 as_compute. #1555's new Shader::ours builds a Shader without #1407's masked and masked_twin fields, so it will not compile until they are added. The pub use lower::{...} lines conflict too.
    • #1457 (link oversized mesh exports): shader_cache.rs, 3 regions. Both replace host_shader with a variant function (host_shader_as(masked) against shader_variant(link)), and the cache key and translate closure collide.
    • #1203 and #1096 (single-pass store classification, both for #1055): one region in pipeline.rs translate, the host_shader call beside the store classification. Mechanical.
    • #1584 (translation time in the shader-translated line) and #1124 (VICTORY_HELD_FRAME_MS): one region each in pipeline.rs, at the translate call and next to host_pipeline_masked. Mechanical.
    • #1537 (pair meetings): one region, the pub use shader::{...} list in emit/mod.rs (both add a name). Mechanical.
    • #546 (Intel rest pipeline): one region in draw.rs, where both add a State method at the same place. Mechanical.
  • No other open PR's title names the sample mask, LOD fades or OMSetSampleMask.

Not tested

  • The game and any title capture, so not the masks GTA really sets, the mesh pipelines it fades, or the description's 136 masked shaders and 205 masked pipelines.
  • The victory-gpu path from slot 142 to the masked pipeline (above), and the masked pipeline's first-use fallback to the plain one.
  • Depth: whether discarded pixels write no depth, and what dropping early depth costs.
  • Multisampled targets, a draw without a pixel shader (the description's own limit), and masks whose sample bits within a pixel differ.
  • Native 64-lane hosts, AMD or Intel cards.
  • Merging alongside #1510, #1555 or #1457.
  • VICTORY_SHADER_OPT, clippy, cargo xtask policy, the release build, and the rest of the workspace.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

**@⁠upipibi** on GitHub · 2026-11-28 22:49 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1407#issuecomment-7247008380) Tested on Ampere: RTX 3070 (`10de:2484`), driver 616.56, native Windows 11 Pro 10.0.26100, rustc 1.98.1. Debug test profile. The system WARP is the one that ships with Windows. Wave sizes tested: **32 lanes only** (the 3070 reports `WaveLaneCountMin/Max` 32-32; WARP reports 4-4). The PR's program is a pixel shader, so the wave width does not enter its test. - Head `74daaa0d5`, merged onto main `d4b5d5170` (`--no-ff`, clean, no conflicts). The PR's base is `923e38cc`, 3 commits behind main (the README, the issue forms and the label bot; none of them touch these files). The merge changes the same 10 files by the same +424/-16 as the PR. The head was still `74daaa0d5` and main still `d4b5d5170` when I finished. **On the 3070, main's code draws every pixel under every mask. With the PR, each mask draws exactly its pixels of each quad.** The PR's test renders on the device: a mesh triangle and a pixel program on a 16x16 target, on the 3070 and on WARP in the same run. It is not a CPU replay. Both controls below fail it on both adapters. **The test** ``` export CARGO_TARGET_DIR=<separate target dir> cargo test -p victory-shader --lib --locked -- --nocapture --test-threads=1 a_pixel_mask_draws_only_its_pixels_of_each_quad VICTORY_WARP=1 cargo test ... # same command ``` The filter matches only the new test, `emit::tests::a_pixel_mask_draws_only_its_pixels_of_each_quad`. - Default, 3 runs: 1 passed, 0 failed, 0 ignored each (0.60 to 0.71 s). - `VICTORY_WARP=1`, 3 runs: 1 passed, 0 failed, 0 ignored each (0.10 s). The test loops over `Host::new(false)` and `Host::new(true)` itself. It moves on to the next adapter with a bare `continue` when `Host::new` fails, and to the next mask when `root_signature_for` fails. It prints `no device with mesh shaders; skipped` only when nothing at all was drawn. So a pass does not by itself show that both adapters drew. It printed nothing in any run here. The temporary probe below shows that both adapters drew every mask. With `VICTORY_WARP=1`, `Host::new(false)` opens WARP too, so those runs draw on WARP twice and never on the 3070. **Adapters and wave sizes** A temporary probe test (below) prints `GetDesc1` of the adapter behind `device.GetAdapterLuid()`, the `D3D12_OPTIONS1` wave lane counts and the `D3D12_OPTIONS7` mesh shader tier: | run | `Host::new` | adapter | vendor:device | flags | wave lanes | mesh tier | |---|---|---|---|---|---|---| | default | `false` | NVIDIA GeForce RTX 3070 | `10de:2484` | `0x0` | 32-32 | 1 | | default | `true` | Microsoft Basic Render Driver | `1414:008c` | `0x2` (software) | 4-4 | 1 | | `VICTORY_WARP=1` | `false` and `true` | Microsoft Basic Render Driver | `1414:008c` | `0x2` (software) | 4-4 | 1 | **The pixels drawn (temporary probe)** I added a temporary test beside the PR's in `emit/mod.rs`. It makes the same draws for the same masks and both signatures, 3 rounds each. Instead of asserting, it prints the lit pixel count out of 256, the pixels that differ from the mask's quad pattern (`x & 1 | (y & 1) << 1`), whether the mask's user-data dword is there, and one lit and one dark texel. The DXIL passed the validator for every translation. I removed the probe before the lib suites. Merge, on the 3070 and on WARP alike, with and without `SV_Position` in the signature, and the same in all 3 rounds: | mask | translation | dword | lit / 256 | wrong pixels | |---|---|---|---|---| | `0b1111` | plain | absent | 256 | 0 | | `0b0110` | masked | at 0 | 128 | 0 | | `0b1001` | masked | at 0 | 128 | 0 | | `0b0001` | masked | at 0 | 64 | 0 | | `0b1110` | masked | at 0 | 192 | 0 | | `0b0000` | masked | at 0 | 0 | 0 | Lit texels read `[1.0, 1.0, 1.0, 1.0]` and dark texels `[0.0, 0.0, 0.0, 0.0]`. **Negative control A: main's lowering, PR's tests** I deleted only the three lines in `Lower::lower` that call `self.pixel_mask()`. `with_pixel_mask` then sets a flag that nothing reads, as if the translator were main's. It builds, with one extra warning (`pixel_mask` is never used). - Default, 3 runs: **0 passed, 1 failed, 0 ignored each.** - `VICTORY_WARP=1`, 3 runs: **0 passed, 1 failed, 0 ignored each.** All six failed the same way, at `emit/mod.rs:2429`, before any draw: ``` assertion `left == right` failed: hardware with SV_Position: the mask's dword ``` So the test's own failure on main's code is the missing user-data dword, not a pixel. The probe (3 runs on this control, 3 rounds each) shows what the 3070 draws then. **Every masked draw lights all 256 of 256 pixels**, on the 3070 and on WARP alike, with and without `SV_Position`. Wrong pixels: 128 for `0b0110` and `0b1001`, 192 for `0b0001`, 64 for `0b1110` and 256 for `0b0000`. No texel is dark. That is the double draw the description gives for the LOD fades. **Negative control B: the PR's dword, no discard** I deleted only the `discard` op in `pixel_mask()` and kept the `SV_Position` input, the user-data dword and the dropped early-depth flag. It builds, with one extra warning (`kill` unused). - Default, 3 runs: **0 passed, 1 failed, 0 ignored each.** - `VICTORY_WARP=1`, 3 runs: **0 passed, 1 failed, 0 ignored each.** All six failed at `emit/mod.rs:2463`, on the first pixel check: ``` assertion `left == right` failed: hardware with SV_Position mask 0b0110: pixel (0, 0) ``` The probe on this control shows the dword at index 0 and again 256 of 256 pixels lit for every mask on the 3070. So the test's pixel check, not only its dword check, catches a translation that does not discard. **Lib suites** (default features unless named; once each, except the `diagnostics` WARP row) | suite | merge | main `d4b5d5170` | |---|---|---| | `cargo test -p victory-shader --lib --locked` | 349 passed, 0 failed, 8 ignored (290 s) | 348 passed, 0 failed, 8 ignored (286 s) | | `cargo test -p victory-gpu --lib --locked` | 550 passed, 0 failed, 43 ignored | 550 passed, 0 failed, 43 ignored | | `VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --lib --locked --features diagnostics` | run 1: 603 passed, **1 failed**, 43 ignored; 7 runs: 5 clean, 2 with 1 failure | 604 passed, 0 failed, 43 ignored; 5 runs: all clean | The extra victory-shader pass is the new test. The PR adds no victory-gpu tests, so those counts match. **The `diagnostics` WARP failures look like flakes in code the PR does not touch, but they came only on the merge.** I ran that suite 7 times on the merge and 5 times on main. Main was clean every time. The merge was clean 5 times, and twice one test failed, a different one each time: - run 1: `watch::tests::what_is_put_in_beside_the_guards_is_told_at_every_view` (`watch.rs:4789`, `assertion failed: published(two, two + BLOCK)`); - run 2: `descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytes` (`descriptor/host.rs:6935`, `left: 6291456`, `right: 65536`). Neither file is in the PR. Run alone, the watch test passed 10 of 10 on the merge and 10 of 10 on main. Our earlier main baseline on this card already lists flaky descriptor::host tests. I did not find a way the PR's changes could reach either test, but 2 failures in 7 runs against 0 in 5 is not enough to rule it out. `VICTORY_D3D12_WARP=1` takes effect only in a `--features diagnostics` build: the shared test device `host()` (`host.rs:893`) checks it at `host.rs:957`. It changes nothing for the PR's own test, which is in victory-shader and reads `VICTORY_WARP` (`emit/host.rs:175`). The PR adds no compiler warnings. Both builds print the same warnings: in victory-shader, main's unused `colour`; in victory-gpu, `gpu` never read, `let_go` and `host_pressure_reclaimed` never used, and three `drop` of a reference. **What the tests do not reach** The new test covers the translator only: `with_pixel_mask` and the `pixel_mask()` prologue. No test calls any of the victory-gpu side: slot 142 (`sample_mask_x`, in both the plain table and `thin.rs`), `State::set_sample_mask` and `State::pixel_mask` (the 64-bit mask to 4 pixel bits), the `USER_PIXEL_MASK` user-data value, `host_pipeline_masked`, `make::made_or_start`, `Shader::masked`, `host_shader_masked` with its separate cache key, and `GraphicsState::clone` with its re-pointed semantic names. I only read that code. By reading, the description's example masks `0x0000ffffffff0000` and `0xffff00000000ffff` become `0b0110` and `0b1001`, two of the masks the test draws. The test has no depth target, so it does not check that a discarded pixel writes no depth (the dropped early-depth flag). **CI** `gh pr checks 1407`: no checks reported on the branch. I did not run clippy or `cargo xtask policy`. The PR has no comments or reviews yet. **Overlap** - #1138's triage map was made against main `63b902fe` and names no PR above #1373. It does not list #1407 or any sample-mask or LOD-fade item. - **#1510** (console API conformance) also maps slot 142 to a function named `sample_mask_x` in `list.rs`. That one only logs the first eight distinct masks ("a quad sample mask the host does not apply") and has a test, `sample_masks_are_noted_once_each`. `git merge-tree` shows one conflict region, the `NEWER_METHODS` doc comment. The identical `(142, sample_mask_x ...)` lines merge silently, but the result would define `sample_mask_x` twice. Whichever lands second has to drop or rename its function. #1510 also lists 0x470 in a table of named methods. - I ran `git merge-tree` of #1407 against the 121 other open PRs that change any of its 10 files. 61 are clean with both main and the merge, and 51 already conflict with main. **9 merge cleanly with main but conflict with #1407:** - #1555 (mesh fallback for GPUs without mesh shaders): `pipeline.rs`, 3 regions, and `emit/mod.rs`, 1 region. Both PRs give `translate` a second `bool`, #1407 `masked` and #1555 `as_compute`. #1555's new `Shader::ours` builds a `Shader` without #1407's `masked` and `masked_twin` fields, so it will not compile until they are added. The `pub use lower::{...}` lines conflict too. - #1457 (link oversized mesh exports): `shader_cache.rs`, 3 regions. Both replace `host_shader` with a variant function (`host_shader_as(masked)` against `shader_variant(link)`), and the cache key and translate closure collide. - #1203 and #1096 (single-pass store classification, both for #1055): one region in `pipeline.rs` `translate`, the `host_shader` call beside the store classification. Mechanical. - #1584 (translation time in the shader-translated line) and #1124 (`VICTORY_HELD_FRAME_MS`): one region each in `pipeline.rs`, at the `translate` call and next to `host_pipeline_masked`. Mechanical. - #1537 (pair meetings): one region, the `pub use shader::{...}` list in `emit/mod.rs` (both add a name). Mechanical. - #546 (Intel rest pipeline): one region in `draw.rs`, where both add a `State` method at the same place. Mechanical. - No other open PR's title names the sample mask, LOD fades or `OMSetSampleMask`. **Not tested** - The game and any title capture, so not the masks GTA really sets, the mesh pipelines it fades, or the description's 136 masked shaders and 205 masked pipelines. - The victory-gpu path from slot 142 to the masked pipeline (above), and the masked pipeline's first-use fallback to the plain one. - Depth: whether discarded pixels write no depth, and what dropping early depth costs. - Multisampled targets, a draw without a pixel shader (the description's own limit), and masks whose sample bits within a pixel differ. - Native 64-lane hosts, AMD or Intel cards. - Merging alongside #1510, #1555 or #1457. - `VICTORY_SHADER_OPT`, clippy, `cargo xtask policy`, the release build, and the rest of the workspace. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
github-bot referenced this pull request from a commit 2026-11-29 00:27:22 +00:00
github-bot closed this pull request 2026-11-29 00:28:28 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-29 00:25 UTC · original

Merged into main as f798bde2 ("Merge pull request #1407"), which brought in your commit 0938dd9b. The branch was rebased afterwards, so GitHub doesn't mark it as merged by itself. It's in main as of f9dfb76f. Thanks!

**@⁠trustno1-coder** on GitHub · 2026-11-29 00:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1407#issuecomment-7248099977) Merged into main as f798bde2 ("Merge pull request #1407"), which brought in your commit 0938dd9b. The branch was rebased afterwards, so GitHub doesn't mark it as merged by itself. It's in main as of f9dfb76f. Thanks!

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1407
No description provided.