i965: Silence brw_blorp uninitialized warning
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fri, 23 Aug 2019 16:12:02 +0000 (09:12 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fri, 23 Aug 2019 20:25:27 +0000 (13:25 -0700)
The variables level and start_layer are not initialized, then
initialized if we have a BUFFER_BIT_DEPTH set.  We assert on them
later using the same check.  This should be enough but GCC 9.1.1 is
not convinced, so let's initialize the variables.

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_blorp.c

index 044b9d045e359a40b7bbc643acacefd0cc52885b..dc7862b407d659c2b50ab37d28660dbc8a74bb87 100644 (file)
@@ -1405,7 +1405,7 @@ brw_blorp_clear_depth_stencil(struct brw_context *brw,
    if (x0 == x1 || y0 == y1)
       return;
 
-   uint32_t level, start_layer, num_layers;
+   uint32_t level = 0, start_layer = 0, num_layers;
    struct blorp_surf depth_surf, stencil_surf;
 
    struct intel_mipmap_tree *depth_mt = NULL;