From: Christian König Date: Mon, 31 Jan 2011 22:38:10 +0000 (+0100) Subject: r600g: fix invalid ref count handling in r600_set_constant_buffer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7fb722c35c2d2cb74b14417a8ddc0684ed6dd838;p=mesa.git r600g: fix invalid ref count handling in r600_set_constant_buffer Only decrement ref count if r600_upload_const_buffer really changes the buffer. --- diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index e086e272c8e..d82985e1b1f 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -433,7 +433,7 @@ void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint index, return; } - if (!rbuffer->user_buffer) + if (buffer != &rbuffer->r.base.b) pipe_resource_reference((struct pipe_resource**)&rbuffer, NULL); }