Commit Graph

5 Commits

Author SHA1 Message Date
c491cf097c Tests: d3d12_sampler2 compares non-normalized cases only with a host that has them (TEST-191)
The test compared all 22 CreateSampler2 edge cases with the host's PC
runtime. A host that reports no NonNormalizedCoordinateSamplersSupported
leaves every non-normalized description unwritten, so the test failed
at the first one ("UINT border and non-normalized: ours written 1, host
runtime 0"). It printed that the host lacks the feature, then compared
anyway. Since 817a5e9 registered it with ctest, ctest fails on such
hosts.

Each edge case now records whether its description has
D3D12_SAMPLER_FLAG_NON_NORMALIZED_COORDINATES, read from the description
itself. Without the feature on the host, only the 3 cases without the
flag are compared live. The layer's answers to all 22 are still checked
against the recorded RTX 4090 / WARP answers first, as before. The
host's normalized-vs-not descriptor check runs only when the host has
the feature.

Measured on the host's default adapter here, a Radeon 680M (D3D12
driver 31.0.14084.6002): it reports no non-normalized samplers and
leaves all 19 non-normalized descriptions unwritten, which
docs/d3d12_vulkan.md now records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:25:13 +02:00
817a5e9f5e Tests: run the eight unregistered D3D12 GPU tests under ctest
d3d12_clear, d3d12_com, d3d12_descriptor, d3d12_method_variants,
d3d12_resource_desc, d3d12_sampler2, d3d12_typeless_rtv and d3d12_uav_clear were
built but never added with add_test, so ctest and CI never ran them. Each now
exits 77 when there is no Vulkan GPU (DeviceStatus::unavailable), as
d3d12_vulkan_device_test does, and is registered with SKIP_RETURN_CODE 77.

(cherry picked from commit 2af37e5da368dd130ba23db385e812635cb1a768)
2026-11-22 00:33:45 -05:00
fac8b022d5 fix: preserve NEVER comparison samplers in set 0
The hardware depth function is zero for both a regular sampler and a NEVER comparison. Give layer-created NEVER comparisons a separate descriptor key so Vulkan binds a comparison-enabled sampler.
2026-11-22 04:39:05 +01:00
b3e71d7a4d runtime: UINT border colours use VK_BORDER_COLOR_INT_* (#538 review)
A UINT opaque-white border read back as 0 (Vonsek, on an RTX 5080). The S# has
no integer border types, since the hardware reads them by the image's format.
So bind_sampler gave Vulkan VK_BORDER_COLOR_FLOAT_*, which an integer image
reads as 0. The float and UINT samplers also shared one S# key and so one
VkSampler.

An integer border is now marked in the S#: BORDER_COLOR_PTR = 0x800
(gfx10::kIntegerBorderPtr), a field the hardware reads only for table colours.
That gives it its own key, and vulkan_sampler picks VK_BORDER_COLOR_INT_*.

d3d12_descriptor_test runs Vonsek's case: an R8G8B8A8_UINT texture sampled past
its edge through UINT black and white border samplers reads 0 and 1, and a
float white border reads 255. The case fails with the float enums on an RTX
4090. gfx10_descriptors_test and d3d12_sampler2_test check the mark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:03:36 +00:00
ffb5e34b9c runtime: CreateSampler2 on the Vulkan device (D3D-28, part 2)
CreateSampler2 wraps CreateSampler. The UINT border colour maps (0,0,0,0),
(0,0,0,1) and (1,1,1,1) to the S#'s border types, and anything else to the
table. Non-normalized coordinates set FORCE_UNNORMALIZED. A description the PC
runtime refuses (unknown flags; a non-normalized sampler with an unequal
min/mag filter, a linear mip filter, anisotropy, comparison, a U/V address mode
other than clamp/border, or a non-zero LOD or bias) leaves the slot as it was,
as the runtime does on an RTX 4090 and on WARP. The layer now answers
D3D12_OPTIONS17 with NonNormalizedCoordinateSamplersSupported, as both report.

d3d12_sampler2_test compares the S# bytes with CreateSampler's and the 22
edge cases with the host's PC runtime live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:03:36 +00:00