You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
native compute: accept comparison static samplers (smpc) on the in-process route #3075
Part of #2935 (its "Samplers" item, which is not filed yet).
Problem. On main at e1ea515d, the in-process native compute route (X2W_NATIVE_SHADERS, src/startup_stubs/d3d12_compute_dispatch.inl) refuses any manifest line that starts with smpc and returns a comparison sampler (lines 174-175). The pieces on both sides already exist:
The native translator accepts constant comparison samplers in compute (sampler_index, src/gfx1013_compute_native.cpp), for example image_gather4_c_lz since shader: lower image_gather4_c_lz in the direct C++ image path #2971, and src/direct_compute_cache.cpp writes them as smpc lines.
TranslatedSamplers::read_manifest_line and decode_statics (src/startup_stubs/translated_sampler_bindings.h) already parse smpc and decode it to a comparison static sampler for the draw path.
So a compute request that the translator compiles is still sent back to the gfx2hlsl.py fallback at its first Dispatch because of its sampler line.
Plan.
Accept smpc <i> <w0> <w1> <w2> <w3> in the route under the same index and whole-line checks as smp and smpl, through read_manifest_line.
Leave smpheap refused under its current message. The sampler-heap path is a separate item.
Test (source-built only). A compute fixture that compiles a comparison gather or sample with a constant comparison sampler and runs it through the in-process route. The readback is compared against a CPU model of the compare, on _hardware. The route refuses WARP today (#2958), so there is no _warp run beyond the host-side manifest check. Negative control: the same fixture with the route change reverted is refused with a comparison sampler.
I'm taking this one. Environment: Windows 11 build 26300, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), Windows SDK 10.0.26100, plus WARP. The PR will target main.
Correction to the description above. The refusal is not on the in-process route.
a comparison sampler (src/startup_stubs/d3d12_compute_dispatch.inl, lines 174-175 at e1ea515d) is in load_compute_translation, the reader of a published <key>.txt. The in-process route (X2W_NATIVE_SHADERS, translate_compute_natively) reads no manifest lines. It refuses every sampler, and every view that is not a raw buffer, with its own messages.
Only tools/startup/gfx2hlsl.py writes smpc for a compute program today. format_compute_runtime_manifest (src/direct_compute_cache.cpp) returns no manifest for a comparison sampler; the smpc writer in that file is the graphics one. So the request does not fall back to gfx2hlsl.py because of this line. The translation gfx2hlsl.py publishes is the one the runtime refuses, and a compute request with a comparison sampler cannot be dispatched at all.
The published route runs on WARP, so the fixture has a _warp run as well as a _hardware one.
The plan is otherwise the same: accept smpc in that reader under the checks of smp and smpl, and leave smpheap refused. The fixture goes into tests/startup_compute_dispatch_texture_check.py.
Not part of this issue: static samplers on the in-process route (after #3049) and smpc from format_compute_runtime_manifest.
Activity
Not-Saii commentedon Nov 27, 2026
Correction to the description above. The refusal is not on the in-process route.
a comparison sampler(src/startup_stubs/d3d12_compute_dispatch.inl, lines 174-175 ate1ea515d) is inload_compute_translation, the reader of a published<key>.txt. The in-process route (X2W_NATIVE_SHADERS,translate_compute_natively) reads no manifest lines. It refuses every sampler, and every view that is not a raw buffer, with its own messages.tools/startup/gfx2hlsl.pywritessmpcfor a compute program today.format_compute_runtime_manifest(src/direct_compute_cache.cpp) returns no manifest for a comparison sampler; thesmpcwriter in that file is the graphics one. So the request does not fall back togfx2hlsl.pybecause of this line. The translationgfx2hlsl.pypublishes is the one the runtime refuses, and a compute request with a comparison sampler cannot be dispatched at all._warprun as well as a_hardwareone.The plan is otherwise the same: accept
smpcin that reader under the checks ofsmpandsmpl, and leavesmpheaprefused. The fixture goes intotests/startup_compute_dispatch_texture_check.py.Not part of this issue: static samplers on the in-process route (after #3049) and
smpcfromformat_compute_runtime_manifest.AI-assisted.
docs: drop smpc from the compute refusals in the smpl note
startup: read smpc comparison samplers in published compute manifests (…