From: Francisco Casas fcasas@codeweavers.com
Otherwise we silently skip some type checks.
---
I think it doesn't hurt in the usual cases since add_implicit_conversion() just returns the node if hlsl_types_are_equal(src_type, dst_type). --- libs/vkd3d-shader/hlsl.y | 6 ++---- tests/cast-broadcast.shader_test | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 60ca09ce..66ca3e3e 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -1636,12 +1636,10 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in }
if (lhs_type->type <= HLSL_CLASS_LAST_NUMERIC) - { writemask = (1 << lhs_type->dimx) - 1;
- if (!(rhs = add_implicit_conversion(ctx, instrs, rhs, lhs_type, &rhs->loc))) - return NULL; - } + if (!(rhs = add_implicit_conversion(ctx, instrs, rhs, lhs_type, &rhs->loc))) + return NULL;
while (lhs->type != HLSL_IR_LOAD) { diff --git a/tests/cast-broadcast.shader_test b/tests/cast-broadcast.shader_test index f60eb758..e21e65b0 100644 --- a/tests/cast-broadcast.shader_test +++ b/tests/cast-broadcast.shader_test @@ -23,7 +23,7 @@ todo draw quad todo probe all rgba (84.0, 84.0, 84.0, 84.0)
-[pixel shader fail todo] +[pixel shader fail] struct apple { float3 aa;