From 7fb722c35c2d2cb74b14417a8ddc0684ed6dd838 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Mon, 31 Jan 2011 23:38:10 +0100 Subject: [PATCH] r600g: fix invalid ref count handling in r600_set_constant_buffer Only decrement ref count if r600_upload_const_buffer really changes the buffer. --- src/gallium/drivers/r600/r600_state_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.30.2