nvc0: unreference images when the context is destroyed
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 6 May 2016 14:25:45 +0000 (16:25 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 6 May 2016 13:15:32 +0000 (15:15 +0200)
Like other resources, we need to unreference all images.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_context.c

index f6c58f2b88f2b799742f2722910711b20ed255ea..428b33d3318f21bc9fda0e97cb88b709bb85dfd6 100644 (file)
@@ -161,6 +161,10 @@ nvc0_context_unreference_resources(struct nvc0_context *nvc0)
       for (i = 0; i < NVC0_MAX_BUFFERS; ++i)
          pipe_resource_reference(&nvc0->buffers[s][i].buffer, NULL);
 
+   for (s = 0; s < 6; ++s)
+      for (i = 0; i < NVC0_MAX_IMAGES; ++i)
+         pipe_resource_reference(&nvc0->images[s][i].resource, NULL);
+
    for (i = 0; i < nvc0->num_tfbbufs; ++i)
       pipe_so_target_reference(&nvc0->tfbbuf[i], NULL);