On 5/3/22 04:57, Giovanni Mascellani wrote:
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com
libs/vkd3d-shader/hlsl_codegen.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 78b22910..7c401e14 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -474,18 +474,20 @@ static bool copy_propagation_transform_load(struct hlsl_ctx *ctx, return false; }
- if (!(new_node = copy_propagation_compute_replacement(ctx, state, &load->src, dimx, &swizzle)))
return false;
- if (type->type != HLSL_CLASS_OBJECT)
- if ((new_node = copy_propagation_compute_replacement(ctx, state, &load->src, dimx, &swizzle))) {
if (!(swizzle_node = hlsl_new_swizzle(ctx, swizzle, dimx, new_node, &node->loc)))
return false;
list_add_before(&node->entry, &swizzle_node->node.entry);
new_node = &swizzle_node->node;
if (type->type != HLSL_CLASS_OBJECT)
{
if (!(swizzle_node = hlsl_new_swizzle(ctx, swizzle, dimx, new_node, &node->loc)))
return false;
list_add_before(&node->entry, &swizzle_node->node.entry);
new_node = &swizzle_node->node;
}
hlsl_replace_node(node, new_node);
return true; }
- hlsl_replace_node(node, new_node);
- return true;
return false; }
static bool copy_propagation_transform_object_load(struct hlsl_ctx *ctx,
I'm not sure I see how this is an improvement?