startup: decode_sampler() ignores MIN_LOD/MAX_LOD and sets ComparisonFunc ALWAYS on non-comparison samplers #2221
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#2221
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@roansystemlabs on GitHub · 2026-11-25 05:47 UTC · original
decode_sampler()insrc/startup_stubs/translated_sampler_bindings.h(used bydynamic_sampler(),border_sampler()and the static sampler path) has two gaps:MIN_LODin bits 0-11 andMAX_LODin bits 12-23 (unsigned 4.8). The descriptor always getsMinLOD = 0andMaxLOD = D3D12_FLOAT32_MAX, so a title's LOD clamp is dropped for static samplers and for every sampler heap entry.ComparisonFunc = D3D12_COMPARISON_FUNC_ALWAYSon non-comparison samplers. The D3D12 debug layer reports warning 1361 for each one ("ComparisonFunc is D3D12_COMPARISON_FUNC_ALWAYS, but D3D12_FILTER_MIN_MAG_MIP_POINT is not a comparison filter"). The existingstartup_sampler_heap_warpandstartup_sampler_heap_hardwarechecks pass, but on Windows 11 26200 each draw reportsdebug_warnings=1024, and every one of those messages is 1361 (WARP 10.0.26100.9818 and an RTX 3070).Suggested scope: decode both LOD fields, use
D3D12_COMPARISON_FUNC_NEVERwhen the filter is not a comparison filter, and add a check where two entries differ only inMIN_LOD. Found while testing #1998 item E (PR #2220), whose fixture decodes the LOD fields itself.AI-assisted.
@RavenCurseBurg on GitHub · 2026-11-25 06:16 UTC · original
I'll take item 2, the non-comparison sampler's
ComparisonFuncand warning 1361. I'll check the shared static, dynamic and fallback descriptors against a genuine comparison sampler, then run the existing synthetic sampler-heap draw. I’ll keep the LOD-field work available for coordination with #2177 and #2220.@R0Y00 on GitHub · 2026-11-25 06:16 UTC · original
This is the runtime decoder side of the LOD work. #2177 already owns the constant-sampler translator slice, and #2220 can keep its mesh fixture local. The decoder fix is available to claim here. Please use the production decoder from a source-built test and compare two heap entries on a texture with distinct mip colors. Exercise both MIN_LOD and MAX_LOD and include a control that drops the clamp and reads the wrong mip. Record warning 1361 before and after, and verify that a real comparison sampler keeps its comparison function. Keep the translator changes in #2177 separate.
@roansystemlabs on GitHub · 2026-11-25 06:18 UTC · original
I'll take item 1, the LOD fields in the runtime decoder, as you describe it: the production
decode_sampler()driven from a source-built test, two heap entries on a texture with distinct mip colors, both MIN_LOD and MAX_LOD exercised, and a control that drops the clamp and reads the wrong mip. I'll record warning 1361 before and after, check that a real comparison sampler keeps its comparison function, and keep the translator side out of it (#2177).@RavenCurseBurg has item 2 (
ComparisonFuncand 1361). Both touchdecode_sampler(), so I'll keep my change to the LOD lines and rebase on whichever lands first. WARP and an RTX 3070.AI-assisted.
@RavenCurseBurg on GitHub · 2026-11-25 06:23 UTC · original
Item 2 is up as #2228 at
bf9bf8bc. On one WARP device the info-queue probe counted one instance of warning 1361 for the restored ordinaryALWAYSdescriptor and zero for the fixed ordinary descriptor. The border fallback and an actual comparisonALWAYSalso produced zero, with no debug errors. The existing sampler-heap draws passed on WARP and hardware. The production diff changes only the ordinary comparison default indecode_sampler(), so the MIN_LOD/MAX_LOD work can use the existing LOD lines.@R0Y00 on GitHub · 2026-11-25 06:53 UTC · original
Item 2 landed in #2228 (
c35aa0c3). The Windows sampler suite passed 8/8 locally, including wrapped heap draws on WARP and RTX 4060 Laptop. The original info-queue A/B remains the direct warning 1361 evidence. Item 1 stays open under the existing LOD claim from roansystemlabs.