panfrost: Simplify panfrost_bind_sampler_states
authorAlyssa Rosenzweig <alyssa@collabora.com>
Fri, 12 Mar 2021 01:20:52 +0000 (01:20 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 18 May 2021 22:51:56 +0000 (22:51 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>

src/gallium/drivers/panfrost/pan_context.c

index 78e5a32..0d15f34 100644 (file)
@@ -938,12 +938,9 @@ panfrost_bind_sampler_states(
 
         struct panfrost_context *ctx = pan_context(pctx);
 
-        /* XXX: Should upload, not just copy? */
-        ctx->sampler_count[shader] = num_sampler;
+        ctx->sampler_count[shader] = sampler ? num_sampler : 0;
         if (sampler)
                 memcpy(ctx->samplers[shader], sampler, num_sampler * sizeof (void *));
-        else
-                memset(ctx->samplers[shader], 0, num_sampler * sizeof (void *));
 }
 
 static bool