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
@@ -179,3 +179,25 @@ if(sm>=4) uniform 0 int -1
|
||||
if(sm>=4) uniform 1 int 3
|
||||
todo(msl & sm>=6) draw quad
|
||||
probe (0, 0) rgba (0.0, 1.0, 0.0, 0.0)
|
||||
|
||||
[pixel shader]
|
||||
int a, b;
|
||||
|
||||
float4 main() : SV_TARGET
|
||||
{
|
||||
return float4(!(a == b), !(a != b), !(a < b), !(a >= b));
|
||||
}
|
||||
|
||||
[test]
|
||||
if(sm<4) uniform 0 float 0
|
||||
if(sm<4) uniform 4 float 5
|
||||
if(sm>=4) uniform 0 int 0
|
||||
if(sm>=4) uniform 1 int 5
|
||||
todo(msl & sm>=6) draw quad
|
||||
probe (0, 0) f32(1.0, 0.0, 0.0, 1.0)
|
||||
if(sm<4) uniform 0 float -1
|
||||
if(sm<4) uniform 4 float -1
|
||||
if(sm>=4) uniform 0 int -1
|
||||
if(sm>=4) uniform 1 int -1
|
||||
todo(msl & sm>=6) draw quad
|
||||
probe (0, 0) f32(0.0, 1.0, 1.0, 0.0)
|
||||
|
Reference in New Issue
Block a user