Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/ir.c:
+{
- struct vkd3d_shader_parser *parser = normaliser->parser;
- unsigned int i, j, base, array_size, reg_mask;
- struct shader_signature *s = signature->s;
- struct signature_element *e;
- /* Up to two vec4 clip/cull elements are allowed. Merge these into an array,
* and track the location and array offset of the second one. */
- for (i = 0, array_size = 0, reg_mask = 0, base = 0; i < s->element_count; ++i)
- {
e = &s->elements[i];
if (e->sysval_semantic != target_sysval)
{
/* Compile a map of used registers. */
reg_mask |= ((1u << e->register_count) - 1) << e->register_index;
This is not an unusual pattern, but we might think about adding a bitmap_set_range() helper to go with our other bitmap_* helpers.
More importantly, shouldn't that be e->target_location, not e->register_index?