v3d: Fix -Wmaybe-uninitialized compiler warning in the v33 code.
authorEric Anholt <eric@anholt.net>
Fri, 26 Jun 2020 23:31:55 +0000 (16:31 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 29 Jun 2020 16:07:23 +0000 (09:07 -0700)
We weren't initializing the VCM bits in the !gs path, but v33 doesn't have
GS so we can just mark it unreachable.

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2952>

src/gallium/drivers/v3d/v3dx_draw.c

index f4377e79d4a272446ce99c1183ef64bd79fee3cc..9a5da07ec809c876fc9c9fcdf3b842e528ea51fe 100644 (file)
@@ -706,8 +706,8 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d,
                 vpm_cfg.Ve = 0;
                 vpm_cfg.Vc = v3d->prog.vs->prog_data.vs->vcm_cache_size;
         }
-#if V3D_VERSION >= 41
         else {
+#if V3D_VERSION >= 41
                 v3d_emit_gs_state_record(v3d->job,
                                          v3d->prog.gs_bin, gs_bin_uniforms,
                                          v3d->prog.gs, gs_uniforms);
@@ -738,8 +738,10 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d,
                                               vpm_cfg.gs_width,
                                               vpm_cfg.Gd,
                                               vpm_cfg.Gv);
-        }
+#else
+                unreachable("No GS support pre-4.1");
 #endif
+        }
 
         cl_emit(&job->indirect, GL_SHADER_STATE_RECORD, shader) {
                 shader.enable_clipping = true;