st/mesa: fix uninitialized/random clip plane state vars in lower_ucp
authorMarek Olšák <marek.olsak@amd.com>
Thu, 12 Nov 2020 21:37:40 +0000 (16:37 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Dec 2020 11:52:11 +0000 (11:52 +0000)
Fixes: 584f27326c1 - st/mesa: factor ucp-lowering logic into helper

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>

src/mesa/state_tracker/st_program.c

index e6d0c6c..46c3943 100644 (file)
@@ -666,7 +666,7 @@ lower_ucp(struct st_context *st,
                                            PIPE_CAP_NIR_COMPACT_ARRAYS);
       bool use_eye = st->ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX] != NULL;
 
-      gl_state_index16 clipplane_state[MAX_CLIP_PLANES][STATE_LENGTH];
+      gl_state_index16 clipplane_state[MAX_CLIP_PLANES][STATE_LENGTH] = {{0}};
       for (int i = 0; i < MAX_CLIP_PLANES; ++i) {
          if (use_eye) {
             clipplane_state[i][0] = STATE_CLIPPLANE;