[Mesa-dev] [PATCH] st/mesa: Fix an incorrect user vertex buffer reference

Thomas Hellstrom thellstrom at vmware.com
Mon Mar 7 09:12:02 PST 2011


On 03/07/2011 05:55 PM, Marek Olšák wrote:
> Thank you very much for looking into this. It looks good to me, but it 
> still doesn't fix bug 34378 (tested with sauerbraten), so the second 
> hunk shouldn't be committed yet.

Ouch. The problem is that without the second hunk, redefine_user_buffers 
will never get called, and googleearth will still show random triangles 
with svga.

What usage of new_array causes saurebraten to brake? Is it safe to use 
the real value to determine whether to call redefine_user_buffers?

Thanks,
Thomas



>
> Marek
>
> On Mon, Mar 7, 2011 at 11:24 AM, Thomas Hellstrom 
> <thellstrom at vmware.com <mailto:thellstrom at vmware.com>> wrote:
>
>     st->user_vb[attr] was always pointing to the same user vb, regardless
>     of the value of attr. Together with reverting the temporary workaround
>     for bug 34378, and a fix in the svga driver, this fixes
>     googleearth on svga.
>
>     Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com
>     <mailto:thellstrom at vmware.com>>
>     ---
>      src/mesa/state_tracker/st_draw.c |    6 ++----
>      1 files changed, 2 insertions(+), 4 deletions(-)
>
>     diff --git a/src/mesa/state_tracker/st_draw.c
>     b/src/mesa/state_tracker/st_draw.c
>     index d6e67b7..40afa43 100644
>     --- a/src/mesa/state_tracker/st_draw.c
>     +++ b/src/mesa/state_tracker/st_draw.c
>     @@ -429,7 +429,7 @@ setup_non_interleaved_attribs(struct
>     gl_context *ctx,
>              vbuffer[attr].buffer_offset = 0;
>
>              /* Track user vertex buffers. */
>     -         pipe_resource_reference(&st->user_vb[attr],
>     vbuffer->buffer);
>     +         pipe_resource_reference(&st->user_vb[attr],
>     vbuffer[attr].buffer);
>              st->user_vb_stride[attr] = stride;
>              st->num_user_vbs = MAX2(st->num_user_vbs, attr+1);
>           }
>     @@ -632,10 +632,8 @@ st_draw_vbo(struct gl_context *ctx,
>        struct pipe_index_buffer ibuffer;
>        struct pipe_draw_info info;
>        unsigned i, num_instances = 1;
>     -   GLboolean new_array = GL_TRUE;
>     -   /* Fix this (Bug 34378):
>        GLboolean new_array =
>     -         st->dirty.st <http://dirty.st> && (st->dirty.mesa &
>     (_NEW_ARRAY | _NEW_PROGRAM)) != 0;*/
>     +         st->dirty.st <http://dirty.st> && (st->dirty.mesa &
>     (_NEW_ARRAY | _NEW_PROGRAM)) != 0;
>
>        /* Mesa core state should have been validated already */
>        assert(ctx->NewState == 0x0);
>     --
>     1.6.2.5
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110307/77613dd9/attachment.html>


More information about the mesa-dev mailing list