radeonsi/compute: Update reference counts for buffers in si_set_global_binding()
authorTom Stellard <thomas.stellard@amd.com>
Fri, 8 Aug 2014 13:30:33 +0000 (09:30 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 13 Aug 2014 18:17:02 +0000 (14:17 -0400)
CC: "10.2" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/radeonsi/si_compute.c

index 12e4f5611c579b92134949d05c8bde6f960f3733..2ddd7c2bafd1cac3f732dd4a7d55588e20f96de0 100644 (file)
@@ -105,7 +105,7 @@ static void si_set_global_binding(
 
        if (!resources) {
                for (i = first; i < first + n; i++) {
-                       program->global_buffers[i] = NULL;
+                       pipe_resource_reference(&program->global_buffers[i], NULL);
                }
                return;
        }
@@ -113,7 +113,7 @@ static void si_set_global_binding(
        for (i = first; i < first + n; i++) {
                uint64_t va;
                uint32_t offset;
-               program->global_buffers[i] = resources[i];
+               pipe_resource_reference(&program->global_buffers[i], resources[i]);
                va = r600_resource(resources[i])->gpu_address;
                offset = util_le32_to_cpu(*handles[i]);
                va += offset;