mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Prefer overload candidates without component count widening.
This commit is contained in:
parent
64bb4150f0
commit
c4f69f4d3d
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
@ -3088,7 +3088,9 @@ static int function_parameter_compare(const struct hlsl_ir_var *candidate,
|
|||||||
if ((ret = (a.width > r.width) - (a.width > c.width)))
|
if ((ret = (a.width > r.width) - (a.width > c.width)))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return 0;
|
/* Prefer candidates without component count widening. E.g. given a float
|
||||||
|
* argument, float is a better match than float2. */
|
||||||
|
return (a.count < r.count) - (a.count < c.count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int function_compare(const struct hlsl_ir_function_decl *candidate,
|
static int function_compare(const struct hlsl_ir_function_decl *candidate,
|
||||||
|
@ -184,7 +184,7 @@ float4 main() : sv_target
|
|||||||
}
|
}
|
||||||
|
|
||||||
% An exact match is preferred over widening.
|
% An exact match is preferred over widening.
|
||||||
[pixel shader todo]
|
[pixel shader]
|
||||||
float f(float x) { return 1.0; }
|
float f(float x) { return 1.0; }
|
||||||
float f(float2 x) { return 2.0; }
|
float f(float2 x) { return 2.0; }
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ float4 main() : sv_target
|
|||||||
}
|
}
|
||||||
|
|
||||||
[test]
|
[test]
|
||||||
todo(sm<6) draw quad
|
draw quad
|
||||||
probe (0, 0) rgba(1.0, 1.0, 1.0, 1.0)
|
probe (0, 0) rgba(1.0, 1.0, 1.0, 1.0)
|
||||||
|
|
||||||
% Component type narrowing is preferred over component count narrowing.
|
% Component type narrowing is preferred over component count narrowing.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user