vkd3d-shader/hlsl: Write SM4 rsq instructions.

This commit is contained in:
Giovanni Mascellani 2022-09-28 13:49:03 +02:00 committed by Alexandre Julliard
parent d600f0488e
commit 1655d309bd
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/23
2 changed files with 10 additions and 5 deletions

View File

@ -1669,6 +1669,11 @@ static void write_sm4_expr(struct hlsl_ctx *ctx,
write_sm4_unary_op(buffer, VKD3D_SM4_OP_ROUND_NE, &expr->node, arg1, 0);
break;
case HLSL_OP1_RSQ:
assert(type_is_float(dst_type));
write_sm4_unary_op(buffer, VKD3D_SM4_OP_RSQ, &expr->node, arg1, 0);
break;
case HLSL_OP1_SAT:
assert(type_is_float(dst_type));
write_sm4_unary_op(buffer, VKD3D_SM4_OP_MOV

View File

@ -8,7 +8,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 3.0 4.0 5.0
todo draw quad
draw quad
probe all rgba (0.272165537, 0.408248305, 0.544331074, 0.680413842) 1
[pixel shader]
@ -21,7 +21,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 3.0 4.0 0.0
todo draw quad
draw quad
probe all rgba (0.371390700, 0.557086051, 0.742781401, 0.0) 1
[pixel shader]
@ -34,7 +34,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 3.0 0.0 0.0
todo draw quad
draw quad
probe all rgba (0.554700196, 0.832050323, 0.0, 0.0) 1
[pixel shader]
@ -47,7 +47,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 0.0 0.0 0.0
todo draw quad
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader]
@ -60,7 +60,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 0.0 0.0 0.0
todo draw quad
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader fail]