[Mesa-dev] [PATCH] util/primconvert: Avoid point arithmetic; apply offset on all cases.

Emil Velikov emil.l.velikov at gmail.com
Thu Dec 11 05:43:19 PST 2014


Hi Jose,

jfyi I've picked this fix alongside the commit that introduced the
pointer arithmetic.

-Emil

On 05/12/14 14:16, Jose Fonseca wrote:
> From: José Fonseca <jfonseca at vmware.com>
> 
> Matches what u_vbuf_get_minmax_index() does.
> ---
>  src/gallium/auxiliary/indices/u_primconvert.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/indices/u_primconvert.c b/src/gallium/auxiliary/indices/u_primconvert.c
> index 4632781..eba1f9e 100644
> --- a/src/gallium/auxiliary/indices/u_primconvert.c
> +++ b/src/gallium/auxiliary/indices/u_primconvert.c
> @@ -137,8 +137,9 @@ util_primconvert_draw_vbo(struct primconvert_context *pc,
>        src = ib->user_buffer;
>        if (!src) {
>           src = pipe_buffer_map(pc->pipe, ib->buffer,
> -                               PIPE_TRANSFER_READ, &src_transfer) + ib->offset;
> +                               PIPE_TRANSFER_READ, &src_transfer);
>        }
> +      src = (const uint8_t *)src + ib->offset;
>     }
>     else {
>        u_index_generator(pc->primtypes_mask,
> 



More information about the mesa-dev mailing list