broadcom/vc4: Use pipe_resource_reference in sampler views.
authorEric Anholt <eric@anholt.net>
Wed, 7 Feb 2018 11:16:12 +0000 (11:16 +0000)
committerEric Anholt <eric@anholt.net>
Fri, 23 Feb 2018 16:42:13 +0000 (08:42 -0800)
Improves u_debug_refcount output.

src/gallium/drivers/vc4/vc4_state.c

index ed8d404a4f3601d27ed5f78a273a9cf1a1bec21e..b4696ed7981f583f56ad685554143511eb4965e5 100644 (file)
@@ -567,8 +567,8 @@ vc4_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc,
 
         so->base = *cso;
 
-        pipe_reference(NULL, &prsc->reference);
-        so->base.texture = prsc;
+        so->base.texture = NULL;
+        pipe_resource_reference(&so->base.texture, prsc);
         so->base.reference.count = 1;
         so->base.context = pctx;