OSDN Git Service

r600g: fix invalid ref count handling in r600_set_constant_buffer
authorChristian König <deathsimple@vodafone.de>
Mon, 31 Jan 2011 22:38:10 +0000 (23:38 +0100)
committerChristian König <deathsimple@vodafone.de>
Mon, 31 Jan 2011 22:38:10 +0000 (23:38 +0100)
Only decrement ref count if r600_upload_const_buffer
really changes the buffer.

src/gallium/drivers/r600/r600_state_common.c

index e086e27..d82985e 100644 (file)
@@ -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);
 }