Commit Graph

4 Commits

Author SHA1 Message Date
ffe9b18049 Merge the D3D-45 branch (with main aa2988cc) into the D3D-60 clear branch
Main's render_target_clear_color already converts the D3D-60 integer formats and
the 10:10:10:2 alpha, so this branch now carries only its tests. The R8_TYPELESS
mapping is on main too; the duplicate case label the merge produced is dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:47:58 +03:00
2bee23fe79 d3d12_clear_formats_test: register it with ctest, exit 77 without a Vulkan GPU
main's test_ctest_registration (#1258) requires every built test to have an
add_test. Like the other D3D12 GPU tests, it now returns 77 when no Vulkan
device is available and is registered with SKIP_RETURN_CODE 77.
2026-11-22 14:05:02 -03:00
23827fea46 clears: convert the D3D-60 integer formats like D3D, and map R8_TYPELESS
#600 mapped R8G8, R16G16 and R32G32 UINT/SINT, R16G16B16A16 UINT/SINT
and R10G10B10A2_UINT, but render_target_clear_color still treats them
as float formats: a ClearRenderTargetView writes the float's bits
(255.0 becomes 0x437f0000). They now clamp to the component range and
truncate toward zero like WARP, with per-channel limits for
R10G10B10A2_UINT (10, 10, 10 and 2 bits). R8_TYPELESS, the last
two-channel/one-channel TYPELESS form still refused, is mapped as
R8_UNORM with the mutable-format flag.

d3d12_clear_formats_test goes from 178 to 251 cases against WARP, all
matching on an RTX 3060 Ti; without this change 54 differ and R8_TYPELESS
is not exposed. clear_color_test checks the integer conversions on the CPU.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 04:23:16 +03:00
a7b9ea19d9 clears: tie rounding like D3D, and the rest of the format classes (D3D-45)
Rebased onto main after #525, which added SNORM/SINT render targets for four formats.
This keeps #525's formats and adds what it leaves out:

- Normalised clears round to nearest even like D3D, so 0.5 on an 8-bit channel is 128
  (NVIDIA's clears write 127). The layer hands Vulkan the exact fraction; NaN is 0 and
  out-of-range values clamp. Covers UNORM, SNORM (scale 127 or 32767, -1.0 is -127), the
  alpha of the sRGB formats, R10G10B10A2_UNORM and D16_UNORM depth.
- More formats: R8/R8G8/R16/R16G16/R16G16B16A16 SNORM, R8/R16 SINT, R8/R16 UINT,
  R16_UNORM and R16G16_UNORM, with their copy sizes; SINT and UINT of every width clamp to
  the component range and truncate toward zero.
- d3d12_clear_formats_test: 178 cases against WARP over UNORM, SNORM, sRGB, FLOAT, UINT,
  SINT and the four depth formats. typeless_rtv_test now expects the rounded UNORM value.

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