intel/blorp: Initialize texture_data[0]

Avoids warning with GCC 10:

../src/intel/blorp/blorp_blit.c: In function 'blorp_nir_combine_samples':
../src/intel/blorp/blorp_blit.c:702:25: error: 'texture_data[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  702 |       texture_data[0] = nir_fmul(b, texture_data[0],
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  703 |                                  nir_imm_float(b, 1.0 / tex_samples));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>
This commit is contained in:
Michel Dänzer 2021-04-01 15:16:35 +02:00 committed by Marge Bot
parent 8ad26e6715
commit efcdc7f7d8

View file

@ -635,6 +635,7 @@ blorp_nir_combine_samples(nir_builder *b, struct brw_blorp_blit_vars *v,
* operations and skip the final division.
*/
nir_ssa_def *texture_data[5];
texture_data[0] = NULL; /* Avoid maybe-uninitialized warning with GCC 10 */
unsigned stack_depth = 0;
for (unsigned i = 0; i < tex_samples; ++i) {
assert(stack_depth == util_bitcount(i)); /* Loop invariant */