[D3D12] Truncate depth to float24 in EDRAM range ownership transfers and resolves by default

Doesn't ruin the "greater or equal" depth test in subsequent rendering passes if precision is lost, unlike rounding to the nearest
This commit is contained in:
Triang3l
2022-06-22 12:53:09 +03:00
parent e2f632f8fa
commit 7869b080d3
14 changed files with 193 additions and 185 deletions

View File

@@ -12,5 +12,6 @@ precise float main(XePSInput xe_input) : SV_Depth {
// allow for safe reinterpretation of any 24-bit value to and from float24
// depth using depth output without unrestricted depth range.
return asfloat(XeFloat20e4To32(
XeFloat32To20e4(asuint(saturate(xe_input.position.z * 2.0f))), true));
XeFloat32To20e4(asuint(saturate(xe_input.position.z * 2.0f)), true),
true));
}