summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Girlin <[email protected]>2011-11-12 22:23:34 +0400
committerAlex Deucher <[email protected]>2011-11-13 17:25:16 -0500
commitd5e91a2364a497efb75aefe6538e64d4e5ada51a (patch)
tree5af02ac31f42a3e79fc8349fe44e3817f2d7f251 /src
parent8e366dc365d01213b71b87ace47d30938db74845 (diff)
r600g: fix stencil buffer ref counting on evergreen
Signed-off-by: Vadim Girlin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r600/r600_texture.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 50a96b4d4da..8fe1118d19d 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -350,6 +350,9 @@ static void r600_texture_destroy(struct pipe_screen *screen,
if (rtex->flushed_depth_texture)
pipe_resource_reference((struct pipe_resource **)&rtex->flushed_depth_texture, NULL);
+ if (rtex->stencil)
+ pipe_resource_reference((struct pipe_resource **)&rtex->stencil, NULL);
+
pb_reference(&resource->buf, NULL);
FREE(rtex);
}
@@ -469,7 +472,7 @@ r600_texture_create_object(struct pipe_screen *screen,
}
if (rtex->stencil) {
- rtex->stencil->resource.buf = rtex->resource.buf;
+ pb_reference(&rtex->stencil->resource.buf, rtex->resource.buf);
rtex->stencil->resource.cs_buf = rtex->resource.cs_buf;
}
return rtex;