Skip to content

BUILD-873: verify shared literal samplers across a draw and dispatch - #4994

Open
kacper-serewis wants to merge 1 commit into
ItsNotRexed:mainfrom
kacper-serewis:test/build-873-sampler-regression
Open

kacper-serewis wants to merge 1 commit into
ItsNotRexed:mainfrom
kacper-serewis:test/build-873-sampler-regression

Conversation

@kacper-serewis

Copy link
Copy Markdown
Contributor

BUILD-873. Coordination claim

Exercise two shared sampler literals plus one distinct literal per stage in a synthetic draw and dispatch. Check that the shared indices survive pipeline creation and read back the stage-specific results. The functional registration change from #2887 landed in main as 7be6847. No open PR dependencies.

On native Windows with an RTX 5070, driver 616.56, three consecutive Vulkan-validation runs passed. All 4,096 graphics pixels met the expected RGBA (81, 180, 0, 255). The compute result scaled to (81, 180, 171, 255). Removing graphics metadata, compute metadata, or both failed the corresponding readback controls. Restoring the metadata passed. The fixture also passed against the base and head of #2887 independently. AI-assisted, synthetic inputs only.

@Atomic258

Copy link
Copy Markdown
Contributor

Independent check of 2a38c6ba — pass on NVIDIA hardware, including the literal-sampler readback.

Environment: Windows 11, MSVC 19.44 (RelWithDebInfo, Ninja), NVIDIA GeForce RTX 5090 (driver 617.42), Vulkan SDK 1.4.363.0, LEONIDA_VK_DEVICE="rtx 5090", LEONIDA_VK_VALIDATION=1. Synthetic cs_m2_literals/ps_m2_literals fixtures, no game files.

  • d3d12_m2_textured_test target built clean (13 steps, incl. self-translating the 6 fixture shaders — all spirv-val pass)
  • On the 5090 with validation on → exit 0. Readback verified on both paths:
    • PS literal sampler: RGBA 81 180 0 255, channel mismatches 0
    • CS literal sampler: 4 words scaled-exact (81.0, 180.0, 171.0, 255.0 as expected)
  • The regression checks still hold: textured quad through descriptor heaps/SRVs/point sampler matched all 4096 pixels (error 0); WRAP-left/CLAMP-right control split 1536 pixels as designed; translated PS resolved T#/S# via the hash table (2 image entries, 1 sampler entry)

Shared literal samplers verified live across a draw and a dispatch on the newest NVIDIA arch.

AI-assisted (Devin).

@gertify

gertify commented Nov 23, 2026

Copy link
Copy Markdown

Tested 2a38c6b on Intel UHD 770 (driver 32.0.101.7088), Windows 11, MSVC 19.44, Vulkan SDK 1.4.357.0: pass.

Native MSVC build of d3d12_m2_textured_test, run once with LEONIDA_VK_VALIDATION=1: exit 0, harness prints "device: Intel(R) UHD Graphics 770 (validation on)", no VUID or validation messages.

  • literal PS RGBA 81 180 0 255, channel mismatches 0 0 0 0
  • literal CS words scale to 81, 180, 171, 255 (expected 81, 180, 171, 255)
  • M2 LINEAR: 4096 pixels, maximum RGBA8 channel error 0; sampler control 1536 pixels differ

The metadata-removal control runs in the PR body are not part of this test file, so this run does not cover them.

AI-assisted.

@DenRakEiw

Copy link
Copy Markdown
Contributor

Independent hardware check of 2a38c6ba merged cleanly onto origin/main (3faac557): PASS on NVIDIA RTX 5090.

Environment: Windows 11 x64, MSVC 19.44 (Ninja, RelWithDebInfo), Vulkan SDK 1.4.363.0, LLVM_MC (WSL Ubuntu 24.04 LLVM 21), git diff --check clean.

  • Build (d3d12_m2_textured_test): Clean (0 warnings); 6 shaders: 6 translated, 6 pass spirv-val (including new ps_m2_literals and cs_m2_literals).
  • NVIDIA GeForce RTX 5090 (driver 32.0.16.1088, LEONIDA_VK_VALIDATION=1): ctest -R "^d3d12_m2_textured$" 1/1 passed (0.48 s), 0 Vulkan validation errors/messages.
    • literal PS RGBA 81 180 0 255, channel mismatches 0 0 0 0
    • literal CS scaled words: 81.000, 180.000, 171.000, 255.000 (expected 81, 180, 171, 255)
    • Existing M2 regression checks: M2 LINEAR: 4096 pixels, maximum RGBA8 channel error 0; sampler control 1536 pixels differ.
  • AMD Radeon(TM) Graphics RDNA2 iGPU (driver 31.0.22044.1, LEONIDA_VK_DEVICE=AMD, LEONIDA_VK_VALIDATION=1): Not exercisable due to pre-existing maxPushConstantsSize 128 < 144 limit on CreateGraphicsPipelineState (line 182, prior to the PR code); 0 Vulkan validation errors.

AI-assisted (Gemini 4 Neon).

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Reviewed change in PR #4994: BUILD-873: verify shared literal samplers across a draw and dispatch.

Scope: runtime/CMakeLists.txt, runtime/test/d3d12_m2_textured_test.cpp, runtime/test/shaders/cs_m2_literals.asm, +2 more
Diff: +177 / -3 across 5 file(s).

The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.

Reviewed by shayderrr via automated batch review.

@shayderrr

Copy link
Copy Markdown
Collaborator

Thanks @kacper-serewis - I went through BUILD-873: verify shared literal samplers across a draw and dispatch and the diff around runtime/CMakeLists.txt. The change is tight, the rationale matches the code, and there's nothing here that needs another pass from my side. Approved and squash-merging it into main now. Nice work.

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.

5 participants