vc4: Zero-initialize the hardware sampler view structure.
authorEric Anholt <eric@anholt.net>
Tue, 26 Jul 2016 22:32:11 +0000 (15:32 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 1 Aug 2016 02:23:03 +0000 (19:23 -0700)
Fixes failure to initialize the force_first_level flag, causing
failures in piglit levelclamp.

src/gallium/drivers/vc4/vc4_state.c

index df9e1a3ab03d4dd48494dd0754e95cc8b013735b..19aae35c65a37500c0f7d8f8213aa1aca5960450 100644 (file)
@@ -586,7 +586,7 @@ static struct pipe_sampler_view *
 vc4_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc,
                         const struct pipe_sampler_view *cso)
 {
-        struct vc4_sampler_view *so = malloc(sizeof(*so));
+        struct vc4_sampler_view *so = CALLOC_STRUCT(vc4_sampler_view);
         struct vc4_resource *rsc = vc4_resource(prsc);
 
         if (!so)