mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Fold some general unary identities.
The following unary identities are applied: ||x|| -> |x| |-x| -> |x| ~(~x) -> x f(g(x)) -> g(x), where f(), g() are floor() or ceil() functions. -(-x) -> x !!x -> x !(x == y) -> x != y, !(x < y) -> x >= y, etc (for integers).
This commit is contained in:
Notes:
Henri Verbeet
2025-08-21 16:34:36 +02:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1648
@@ -89,6 +89,21 @@ uniform 0 uint 7
|
||||
draw quad
|
||||
probe (0, 0) rgba(38.0, 5.0, 7.0, 0.0)
|
||||
|
||||
[pixel shader]
|
||||
uniform uint x;
|
||||
|
||||
float4 main() : SV_TARGET
|
||||
{
|
||||
uint4 res = 0;
|
||||
res.x = ~(~x);
|
||||
return res;
|
||||
}
|
||||
|
||||
[test]
|
||||
uniform 0 uint 7
|
||||
draw quad
|
||||
probe (0, 0) f32(7.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[rtv 0]
|
||||
format r32g32b32a32-uint
|
||||
size (2d, 640, 480)
|
||||
|
Reference in New Issue
Block a user