ClearRenderTargetView on R8G8B8A8_UNORM_SRGB and B8G8R8A8_UNORM_SRGB handed the linear float to
vkCmdClearColorImage or vkCmdClearAttachments and the GPU encoded it. D3D permits FLOAT -> SRGB 0.6 of a step of
tolerance and each implementation puts the steps between two codes somewhere else, so the byte depended on the GPU:
against WARP, d3d12_clear_formats differed in 10 clears and d3d12_srgb_uav in 2 on an Intel Iris Xe (0.5 is bb
there and bc on WARP), and an RTX 4060 passed because the five colours miss the values it encodes differently (3 648
of 60 000 random ones; the Iris Xe 6 649, never more than one code).
render_target_clear_color now encodes the colour channels itself (srgb8_from_linear) the way WARP was measured to:
the value to 12 bits with x * 4095 in single precision rounded half up, then the nearest code of the sRGB curve. All
255 floats at which WARP's byte changes are the ones this gives, and 84 582 further values agree. Vulkan gets the
linear value of that code (srgb8_linear), which both GPUs store as that code for all 256. Alpha is unchanged.
A GPU's own D3D12 driver encodes as its Vulkan driver does, so the layer now differs from that driver where it
differs from WARP, as it does for UNORM ties and D24. d3d12_state_sweep_test compares with that driver and cleared
its sRGB targets to 0.2, 0.4 and 0.6 (0.2 is 124 on WARP, 123 on the Iris Xe); it now starts them from the values of
codes 124, 170 and 203.
clear_color_test pins 38 values to WARP's bytes, the round trip of every code and the result under each rounding
mode. d3d12_clear_formats_test clears the sRGB formats to the value of every code and of every place halfway
between two codes as well: 178 of 352 cases differed from WARP on the Iris Xe and 170 on the RTX 4060 before, none
after.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.
Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.
Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.
Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.
No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.
Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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>
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.
#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>
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>