4 Aug
2023
4 Aug
'23
12:57 a.m.
SPIR-V says this is undefined behaviour, but Direct3D actually specifies that it should clamp. Most drivers do clamp, but llvmpipe does not. Hence this fixes a couple of tests with llvmpipe. This does of course add overhead to the ftou instruction, but I cannot imagine that it is a common instruction to execute. This also is not the first time we perform such checks; cf. udiv. -- v2: vkd3d-shader/spirv: Clamp ftoi upper bound to UINT_MAX. vkd3d-shader/spirv: Clamp ftoi lower bound to -INT_MIN. vkd3d-shader/spirv: Clamp ftou upper bound to UINT_MAX. vkd3d-shader/spirv: Clamp ftou lower bound to zero. https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/289