mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
Vertex shaders do not have CMP, so we use SLT and MAD. For example, this vertex shader: uniform float4 f; void main(inout float4 pos : position, out float4 t1 : TEXCOORD1) { t1 = (int4)f; } results in: vs_2_0 dcl_position v0 slt r0, c0, -c0 frc r1, c0 add r2, -r1, c0 slt r1, -r1, r1 mad oT1, r0, r1, r2 mov oPos, v0 while we have the lower_cmp() pass, each time it is applied many instructions are generated, so this patch introduces a specialized version of the cast-to-int lowering for efficiency.