vkd3d-shader/hlsl: Implement the sincos() intrinsic.

This commit is contained in:
Petrichor Park
2024-08-19 12:57:50 -05:00
committed by Henri Verbeet
parent 384810b4ba
commit 855b9713b8
Notes: Henri Verbeet 2024-09-04 18:49:35 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1009
2 changed files with 77 additions and 0 deletions

View File

@@ -126,3 +126,50 @@ probe (0, 0) rgba (-0.91715234, -0.5, 0.5, 0.91715234) 2
uniform 0 float4 -10.0 -0.0 0.0 10.0
todo(glsl) draw quad
probe (0, 0) rgba (-1.0, 0.0, 0.0, 1.0) 1
[pixel shader]
uniform float4 a;
float4 main() : sv_target
{
float sin_out, cos_out;
sincos(a.x, sin_out, cos_out);
return float4(sin_out, cos_out, 0.0, 0.0);
}
[test]
uniform 0 float4 7.604 0 0 0
todo(glsl) draw quad
probe (0, 0) rgba (0.968916833, 0.2473865, 0, 0) 1024
uniform 0 float4 -10.0 0 0 0
todo(glsl) draw quad
probe (0, 0) rgba (0.544020891, -0.839071631, 0.0, 0.0) 1024
[pixel shader fail]
float4 main() : sv_target
{
// Make sure `out` variables don't work with literals
sincos(12345.0, 10.0, 20.0);
return float4(6789);
[pixel shader fail]
float4 main() : sv_target
{
// sincos returns void.
float s, c;
float err = sincos(12345.0, s, c);
return float4(6789);
}
[pixel shader todo]
float4 main() : sv_target
{
int sin_out, cos_out;
sincos(30, sin_out, cos_out);
return float4(sin_out, cos_out, 0, 0);
}
[test]
todo(sm<6 | glsl) draw quad
probe (0, 0) rgba (0, 0, 0, 0);