[Mesa-dev] [PATCH 1/2] draw: don't assume fixed offset for data in struct vertex_info

Jose Fonseca jfonseca at vmware.com
Fri Dec 11 08:15:06 PST 2015


On 11/12/15 04:43, sroland at vmware.com wrote:
> From: Roland Scheidegger <sroland at vmware.com>
>
> Otherwise, if struct vertex_info is changed, you're in for some surprises...
> ---
>   src/gallium/auxiliary/draw/draw_pt_fetch.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c
> index 3f028ce..84fd6bf 100644
> --- a/src/gallium/auxiliary/draw/draw_pt_fetch.c
> +++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c
> @@ -71,12 +71,10 @@ draw_pt_fetch_prepare(struct pt_fetch *fetch,
>
>      fetch->vertex_size = vertex_size;
>
> -   /* Leave the clipmask/edgeflags/pad/vertex_id untouched
> +   /* Leave the clipmask/edgeflags/pad/vertex_id,
> +    * clip[] and whatever else in the header untouched.
>       */
> -   dst_offset += 1 * sizeof(float);
> -   /* Just leave the clip[] and pre_clip_pos[] array untouched.
> -    */
> -   dst_offset += 8 * sizeof(float);
> +   dst_offset = offsetof(struct vertex_header, data);
>
>      if (instance_id_index != ~0) {
>         num_extra_inputs++;
>


Regardless of the rest, this patch seems to be a good idea on its own right.

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>


More information about the mesa-dev mailing list