[Mesa-dev] Using the right context in st_texture_release_all_sampler_views()

Brian Paul brianp at vmware.com
Wed Jul 22 15:32:32 PDT 2015


Hi Marek,

This is regarding your commit "st/mesa: use pipe_sampler_view_release 
for releasing sampler views" from last October.

Basically, we have:

void
st_texture_release_all_sampler_views(struct st_context *st,
                                      struct st_texture_object *stObj)
{
    GLuint i;

    /* XXX This should use sampler_views[i]->pipe, not st->pipe */
    for (i = 0; i < stObj->num_sampler_views; ++i)
       pipe_sampler_view_release(st->pipe, &stObj->sampler_views[i]);
}

Our VMware/svga driver has an issue when 
pipe_context::sampler_view_destroy() is called with one context and a 
sampler view which was created with another context.  I can hack around 
it in our driver code, but it would be nice to fix this in the state 
tracker.

Ideally, the above code should be something like:

    for (i = 0; i < stObj->num_sampler_views; ++i)
       pipe_sampler_view_reference(&stObj->sampler_views[i], NULL);

The current code which uses the st->pipe context came from the bug
https://bugs.freedesktop.org/show_bug.cgi?id=81680

AFAICT, you were just working around an R600 driver issue.  Any chance 
we could fix the state tracker and re-test Firefox on R600?

-Brian


More information about the mesa-dev mailing list