vkd3d-shader/hlsl: Skip implicit conversion if types are equal.

Otherwise we get false in implicit_compatible_data_types() when passing
types that are equal but not convertible according to
convertible_data_type(); e.g. getting:

"Can't implicitly convert from Texture2D<float4> to Texture2D<float4>."

Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
This commit is contained in:
Francisco Casas 2022-07-22 15:28:19 -04:00 committed by Alexandre Julliard
parent 732f1737f4
commit a8b77b85ca
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/7
2 changed files with 5 additions and 2 deletions

View File

@ -370,6 +370,9 @@ static struct hlsl_ir_node *add_implicit_conversion(struct hlsl_ctx *ctx, struct
{
struct hlsl_type *src_type = node->data_type;
if (hlsl_types_are_equal(src_type, dst_type))
return node;
if (!implicit_compatible_data_types(src_type, dst_type))
{
struct vkd3d_string_buffer *src_string, *dst_string;

View File

@ -25,8 +25,8 @@ float4 main() : sv_target
}
[test]
todo draw quad
todo probe all rgba (0.2, 0.2, 0.2, 0.1)
draw quad
probe all rgba (0.2, 0.2, 0.2, 0.1)
[pixel shader]