On Wed, 30 Jun 2021 at 05:05, Conor McCarthy cmccarthy@codeweavers.com wrote:
+static void shader_sm4_read_descriptor_register_range(struct vkd3d_sm4_data *priv, const DWORD **ptr,
const DWORD *end, struct vkd3d_shader_register *reg, struct vkd3d_shader_register_range *range)
+{
- shader_sm4_read_register_space(priv, ptr, end, &range->space);
- range->first = reg->idx[shader_is_sm_5_1(priv) ? 1 : 0].offset;
- range->last = reg->idx[shader_is_sm_5_1(priv) ? 2 : 0].offset;
- if (range->last < range->first)
FIXME("Invalid register range [%u:%u].\n", range->first, range->last);
+}
That function is not reading the register range though; it first reads the register space, and then subsequently resolves the range from the previously read indices. I'd suggest to keep those separate.