vkd3d-shader/hlsl: Prefer overload candidates without component count narrowing.

This commit is contained in:
Henri Verbeet
2024-12-10 21:00:35 +01:00
parent cdf6100fe5
commit 63fce3062e
Notes: Henri Verbeet 2024-12-16 17:26:51 +01:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1313
2 changed files with 69 additions and 5 deletions

View File

@@ -198,7 +198,7 @@ todo(sm<6) draw quad
probe (0, 0) rgba(1.0, 1.0, 1.0, 1.0)
% Component type narrowing is preferred over component count narrowing.
[pixel shader todo]
[pixel shader]
float f(half4 x) { return 1.0; }
float f(float2 x) { return 2.0; }
@@ -208,7 +208,7 @@ float4 main() : sv_target
}
[test]
todo(sm<6) draw quad
draw quad
probe (0, 0) rgba(1.0, 1.0, 1.0, 1.0)
% Let C be the common type that would be produced in an arithmetic expression
@@ -218,7 +218,7 @@ probe (0, 0) rgba(1.0, 1.0, 1.0, 1.0)
% (same as the parameter) and "int2" for the second function (same base type as
% the argument, but narrower), so the first function is preferred.
[pixel shader todo]
[pixel shader]
float4 func(float4 x)
{
@@ -236,8 +236,8 @@ float4 main() : sv_target
}
[test]
todo(sm<6) draw quad
todo(sm<6) probe (0, 0) rgba(0.0, 0.0, 0.0, 0.0)
draw quad
probe (0, 0) rgba(0.0, 0.0, 0.0, 0.0)
% Let C be the common type that would be produced in an arithmetic expression
% between the parameter and argument types. If C is the same as the argument,