lavapipe: use the component offset directly for xfb
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 14 Jul 2023 16:19:45 +0000 (12:19 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 28 Jul 2023 13:14:35 +0000 (13:14 +0000)
the mask is only indicative of the components being used, not the offset
from which they start

cc: mesa-stable

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24163>

src/gallium/frontends/lavapipe/lvp_pipeline.c

index 609a941..eab2c1d 100644 (file)
@@ -561,7 +561,7 @@ lvp_shader_xfb_init(struct lvp_shader *shader)
          shader->stream_output.output[i].dst_offset = xfb_info->outputs[i].offset / 4;
          shader->stream_output.output[i].register_index = output_mapping[xfb_info->outputs[i].location];
          shader->stream_output.output[i].num_components = util_bitcount(xfb_info->outputs[i].component_mask);
-         shader->stream_output.output[i].start_component = ffs(xfb_info->outputs[i].component_mask) - 1;
+         shader->stream_output.output[i].start_component = xfb_info->outputs[i].component_offset;
          shader->stream_output.output[i].stream = xfb_info->buffer_to_stream[xfb_info->outputs[i].buffer];
       }