diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index e7e67830fdf..3ef83c3f4e1 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1376,6 +1376,12 @@ panfrost_emit_texture_descriptors(struct panfrost_batch *batch, for (int i = 0; i < ctx->sampler_view_count[stage]; ++i) { struct panfrost_sampler_view *view = ctx->sampler_views[stage][i]; + + if (!view) { + memset(&out[i], 0, sizeof(out[i])); + continue; + } + struct pipe_sampler_view *pview = &view->base; struct panfrost_resource *rsrc = pan_resource(pview->texture); @@ -1388,11 +1394,14 @@ panfrost_emit_texture_descriptors(struct panfrost_batch *batch, return T.gpu; #else - uint64_t trampolines[PIPE_MAX_SHADER_SAMPLER_VIEWS]; + uint64_t trampolines[PIPE_MAX_SHADER_SAMPLER_VIEWS] = { 0 }; for (int i = 0; i < ctx->sampler_view_count[stage]; ++i) { struct panfrost_sampler_view *view = ctx->sampler_views[stage][i]; + if (!view) + continue; + panfrost_update_sampler_view(view, &ctx->base); trampolines[i] = panfrost_get_tex_desc(batch, stage, view);