From: Zebediah Figura <zfigura(a)codeweavers.com> copy_propagation_compute_replacement() is not doing very much for us, and conceptually is a bit of an odd fit anyway, since it's meant to deal with multi-component types. --- libs/vkd3d-shader/hlsl_codegen.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index a90524e5..09cda714 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -763,15 +763,20 @@ static bool copy_propagation_transform_load(struct hlsl_ctx *ctx, static bool copy_propagation_transform_object_load(struct hlsl_ctx *ctx, struct hlsl_deref *deref, struct copy_propagation_state *state) { + struct copy_propagation_value *value; struct hlsl_ir_load *load; - struct hlsl_ir_node *instr; - unsigned int swizzle; + unsigned int start, count; + + if (!hlsl_component_index_range_from_deref(ctx, deref, &start, &count)) + return false; + assert(count == 1); - if (!(instr = copy_propagation_compute_replacement(ctx, state, deref, &swizzle))) + if (!(value = copy_propagation_get_value(state, deref->var, start))) return false; + assert(!value->component); /* Only HLSL_IR_LOAD can produce an object. */ - load = hlsl_ir_load(instr); + load = hlsl_ir_load(value->node); hlsl_cleanup_deref(deref); hlsl_copy_deref(ctx, deref, &load->src); -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/51