Mesa (master): r600g: fix invalid ref count handling in r600_set_constant_buffer

Christian König deathsimple at kemper.freedesktop.org
Mon Jan 31 22:43:04 UTC 2011


Module: Mesa
Branch: master
Commit: 7fb722c35c2d2cb74b14417a8ddc0684ed6dd838
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7fb722c35c2d2cb74b14417a8ddc0684ed6dd838

Author: Christian König <deathsimple at vodafone.de>
Date:   Mon Jan 31 23:38:10 2011 +0100

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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index e086e27..d82985e 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);
 }
 




More information about the mesa-commit mailing list