vkd3d-shader/hlsl: Write SM4 square root instructions.

This commit is contained in:
Giovanni Mascellani 2022-10-04 23:40:30 +02:00 committed by Alexandre Julliard
parent 8e5aefb309
commit 5442f4236c
Notes: Alexandre Julliard 2022-10-18 00:13:00 +02:00
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/28
2 changed files with 10 additions and 5 deletions

View File

@ -1685,6 +1685,11 @@ static void write_sm4_expr(struct hlsl_ctx *ctx,
&expr->node, arg1, 0); &expr->node, arg1, 0);
break; break;
case HLSL_OP1_SQRT:
assert(type_is_float(dst_type));
write_sm4_unary_op(buffer, VKD3D_SM4_OP_SQRT, &expr->node, arg1, 0);
break;
case HLSL_OP2_ADD: case HLSL_OP2_ADD:
switch (dst_type->base_type) switch (dst_type->base_type)
{ {

View File

@ -8,7 +8,7 @@ float4 main() : SV_TARGET
[test] [test]
uniform 0 float4 2.0 3.0 4.0 5.0 uniform 0 float4 2.0 3.0 4.0 5.0
todo draw quad draw quad
probe all rgba (7.34846926, 7.34846926, 7.34846926, 7.34846926) 1 probe all rgba (7.34846926, 7.34846926, 7.34846926, 7.34846926) 1
[pixel shader] [pixel shader]
@ -21,7 +21,7 @@ float4 main() : SV_TARGET
[test] [test]
uniform 0 float4 2.0 3.0 4.0 0.0 uniform 0 float4 2.0 3.0 4.0 0.0
todo draw quad draw quad
probe all rgba (5.38516474, 5.38516474, 5.38516474, 5.38516474) 1 probe all rgba (5.38516474, 5.38516474, 5.38516474, 5.38516474) 1
[pixel shader] [pixel shader]
@ -34,7 +34,7 @@ float4 main() : SV_TARGET
[test] [test]
uniform 0 float4 2.0 3.0 0.0 0.0 uniform 0 float4 2.0 3.0 0.0 0.0
todo draw quad draw quad
probe all rgba (3.60555124, 3.60555124, 3.60555124, 3.60555124) 1 probe all rgba (3.60555124, 3.60555124, 3.60555124, 3.60555124) 1
[pixel shader] [pixel shader]
@ -47,7 +47,7 @@ float4 main() : SV_TARGET
[test] [test]
uniform 0 float4 2.0 0.0 0.0 0.0 uniform 0 float4 2.0 0.0 0.0 0.0
todo draw quad draw quad
probe all rgba (2.0, 2.0, 2.0, 2.0) probe all rgba (2.0, 2.0, 2.0, 2.0)
[pixel shader] [pixel shader]
@ -60,7 +60,7 @@ float4 main() : SV_TARGET
[test] [test]
uniform 0 float4 2.0 0.0 0.0 0.0 uniform 0 float4 2.0 0.0 0.0 0.0
todo draw quad draw quad
probe all rgba (2.0, 2.0, 2.0, 2.0) probe all rgba (2.0, 2.0, 2.0, 2.0)
[pixel shader fail] [pixel shader fail]