Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
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);
}
}
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;