gpu: CreateSamplerX sampler contract check and toolchain paths #1180
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1180
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1180/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@KelboLive on GitHub · 2026-11-24 02:42 UTC · original
KelboLive:gpu/startup-sampler-x→main· +433 −3 · 7 files · 2 commits · closed without merginggpu: add startup_sampler_x fixture for CreateSamplerX sampler contract (#874)
Source-built fixture that checks the desktop D3D12_SAMPLER_DESC fields
a translated sampler must reproduce. The console descriptor layout is not
established here.
What this tests
A cs_6_0 shader runs one SampleLevel per dispatch on an 8x8 R32_FLOAT
texture with four mips and unique texel values. Two point samplers
(WRAP/MIRROR with LOD 1–2, CLAMP/BORDER with LOD 0) and one
MIN_MAG_MIP_LINEAR sampler are compared against a CPU reference. A
pre-dispatch check requires the probes to separate every non-default
field. The swapped control writes the two point samplers into each
other's slots and must read back the other sampler's rows.
Evidence
Passes 4/4 in Debug and Release on WARP and an RTX adapter. Dropping
MinLOD, copying AddressU into AddressV, and forcing the linear filter
to point each fail on both adapters.
build: add MSVC include and lib paths to CMake presets
Ensures MSVC headers and libraries are resolvable by the presets.
Refs: #874
@ChazY11 on GitHub · 2026-11-24 10:22 UTC · original
The fixture part already landed, and the only new hunk hard-codes one machine's toolchain
Independent reviewer, not the author. I did not touch the branch. Reviewed
bfcf5f28.1. The fixture is a duplicate of what is already on main
tests/startup_sampler_x.cppandtests/startup_sampler_x.hlslon this branch are byte-identical to the versionson
main— I compared the two blobs directly (353 lines each, equal). The same is true of everystartup_sampler_xline in
CMakeLists.txt(11 lines on both, identical), anddocs/experiments.mdon main already contains thestartup_sampler_xtext twice, exactly as here.That landed through #1121, which was merged after this branch was cut: the merge-base is
78a6b31eand the branch is762 commits behind
main. After a rebase this PR's diff should be empty for those six files.For the record, the merged fixture is sound on hardware — I ran it on three backends while reviewing #1121:
startup_sampler_xandstartup_sampler_x_swappedpass on the NVIDIA RTX 5080 Laptop (32.0.15.8142), the Intel Arc140T (32.0.101.8132) and in-box WARP (10.0.26100.9818), with the swapped controls tripping as intended. So the content
is fine; it is simply already in
main.2.
CMakePresets.jsonbakes absolute paths from one installationThe remaining hunk sets, for both
devandrelease:Those paths only exist on a machine with that exact Visual Studio 2022 Community install and that exact MSVC
version. The Windows CI job, a BuildTools or Enterprise install, or a later MSVC would all fail to configure. The
presets currently work because
.\tools\dev.ps1puts the toolchain onPATHandcmake --preset devtakesclfromthere; naming an absolute compiler and passing raw
/Iand/LIBPATHflags also bypasses the CMake toolchain logicthat normally supplies them.
If the underlying problem is that a plain
cmake --preset devcannot findclon your machine, the portable fixes areto run it from the developer prompt (
tools/dev.ps1) as the README says, or to document that requirement — not tocommit one install's paths. That deserves its own small PR if you want it.
3. Verdict
Not mergeable as it stands: the fixture half duplicates
main, and the presets half would break other machines and CI.Concretely:
mainand drop the six duplicated files;CMakePresets.jsonCMAKE_CXX_COMPILER,CMAKE_CXX_FLAGSandCMAKE_EXE_LINKER_FLAGSentries;Happy to re-run the fixture on the same three adapters from a rebased branch if that is useful — it takes a minute.
@R0Y00 on GitHub · 2026-11-24 10:36 UTC · original
Thanks for contributing the sampler fixture. #1121 already brought both fixture files into main, and I verified that their contents match this head. The remaining preset change pins compiler, include and link paths to one Visual Studio installation. I'm closing this duplicate so the sampler work stays with #1121. A portable build-path fix can be reviewed separately if the developer-shell setup still reproduces the failure.
@tedin7 on GitHub · 2026-11-24 02:51 UTC · original · reviewed
Review of
bfcf5f28b3a59423abda6bc3e387e413c137570d(Linux):tests/startup_sampler_x.cppandstartup_sampler_x.hlsl: cleancs_6_0sampler contract fixture withcheck_probe_coverage()verifying probe separation and a swapped-slot negative control (startup_sampler_x_swapped_*).CMakePresets.json: hardcoding local VS 2022 Community (14.44.35207) and Windows SDK (10.0.26100.0) include/lib/compiler paths will break builds on other VS editions, toolset versions, or SDK installs (andtools/dev.ps1already sets up the environment). Consider keeping the presets portable.docs_links_check.py(246 links),bidi_controls_check.py(930 files),gpu_report_format_check.py(10 tests),xgameruntime_table_check.py, and JSON validation ofCMakePresets.json.Pull request closed