mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Use conditional moves for arithmetic operators instead of branching.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Alexandre Julliard
parent
34b1c0fe5d
commit
6d1ba83856
Notes:
Alexandre Julliard
2023-09-22 22:46:41 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/336
@@ -100,3 +100,22 @@ float4 main() : SV_TARGET
|
||||
uniform 0 float4 5.0 -7.0 0.0 -10.0
|
||||
draw quad
|
||||
probe all rgba (5.0, 7.0, 0.0, 10.0)
|
||||
|
||||
[pixel shader]
|
||||
uniform float4 a;
|
||||
uniform float4 b;
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
int2 x = a.xz;
|
||||
int2 y = a.yw;
|
||||
int2 z = b.xy;
|
||||
int2 w = b.zw;
|
||||
return float4(x / y, z % w);
|
||||
}
|
||||
|
||||
[test]
|
||||
uniform 0 float4 45.0 5.0 50.0 10.0
|
||||
uniform 4 float4 3.0 8.0 2.0 5.0
|
||||
draw quad
|
||||
probe all rgba (9.0, 5.0, 1.0, 3.0)
|
||||
|
Reference in New Issue
Block a user