Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl_codegen.c:
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);
I won't block the MR on that, but I don't like this style: `component` is really a number here, not a boolean value; in other words, zero is not a value that is more special than any other. So I would write `component == 0`, rather than using operator `!` which gives to the reader the impression that zero is a qualitatively different value from any other.