struct gl_texture_image *texImage,
struct pipe_surface *ps)
{
+ struct st_context *st = st_context(ctx);
struct st_texture_object *stObj;
struct st_texture_image *stImage;
GLenum internalFormat;
/* FIXME create a non-default sampler view from the pipe_surface? */
pipe_resource_reference(&stObj->pt, ps->texture);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
pipe_resource_reference(&stImage->pt, stObj->pt);
stObj->width0 = ps->width;
st_DeleteTextureObject(struct gl_context *ctx,
struct gl_texture_object *texObj)
{
+ struct st_context *st = st_context(ctx);
struct st_texture_object *stObj = st_texture_object(texObj);
pipe_resource_reference(&stObj->pt, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
st_texture_free_sampler_views(stObj);
_mesa_delete_texture_object(ctx, texObj);
}
/* The parent texture object does not have space for this image */
pipe_resource_reference(&stObj->pt, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
if (!guess_and_alloc_texture(st, stObj, stImage)) {
/* Probably out of memory.
if (!st_obj) {
pipe_resource_reference(&stObj->pt, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
return GL_TRUE;
}
if (st_obj->buffer != stObj->pt) {
pipe_resource_reference(&stObj->pt, st_obj->buffer);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
stObj->width0 = stObj->pt->width0 / _mesa_get_format_bytes(tObj->_BufferObjectFormat);
stObj->height0 = 1;
stObj->depth0 = 1;
firstImage->pt != stObj->pt &&
(!stObj->pt || firstImage->pt->last_level >= stObj->pt->last_level)) {
pipe_resource_reference(&stObj->pt, firstImage->pt);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
}
/* If this texture comes from a window system, there is nothing else to do. */
* gallium texture now. We'll make a new one below.
*/
pipe_resource_reference(&stObj->pt, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
st->dirty.st |= ST_NEW_FRAMEBUFFER;
}
}
}
void
-st_texture_release_all_sampler_views(struct st_texture_object *stObj)
+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_reference(&stObj->sampler_views[i], NULL);
+ pipe_sampler_view_release(st->pipe, &stObj->sampler_views[i]);
}
texFormat);
pipe_resource_reference(&stObj->pt, res);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
pipe_resource_reference(&stImage->pt, res);
u_sampler_view_default_template(&templ, res, res->format);
struct st_texture_image *stImage = st_texture_image(texImage);
pipe_resource_reference(&stObj->pt, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
pipe_resource_reference(&stImage->pt, NULL);
_mesa_dirty_texobj(ctx, texObj);