diff options
Diffstat (limited to 'src/gallium/drivers/r300/r300_texture.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_texture.c | 9 |
1 files changed, 9 insertions, 0 deletions
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); } |