X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fr300%2Fr300_texture.c;h=6816fd01ab36a79dff8506dfab223bbd977ee4fc;hb=ca2c28859eca83f8fbf1f43616f5ef861e95e8d6;hp=4be6d5067d218054c6210102766f0431301092ff;hpb=1dfe8eead95613a7db62dd17d3da56884b5a887e;p=mesa.git diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 4be6d5067d2..6816fd01ab3 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -906,14 +906,23 @@ static void r300_texture_setup_fb_state(struct r300_surface *surf) surf->format = r300_translate_out_fmt(surf->base.format); surf->colormask_swizzle = r300_translate_colormask_swizzle(surf->base.format); + surf->pitch_cmask = tex->tex.cmask_stride_in_pixels; } } static void r300_texture_destroy(struct pipe_screen *screen, struct pipe_resource* texture) { + struct r300_screen *rscreen = r300_screen(screen); struct r300_resource* tex = (struct r300_resource*)texture; + if (tex->tex.cmask_dwords) { + pipe_mutex_lock(rscreen->cmask_mutex); + if (texture == rscreen->cmask_resource) { + rscreen->cmask_resource = NULL; + } + pipe_mutex_unlock(rscreen->cmask_mutex); + } pb_reference(&tex->buf, NULL); FREE(tex); }