nir: mark unused space in packed_tex_data
authorTapani Pälli <tapani.palli@intel.com>
Fri, 26 Jan 2018 09:26:18 +0000 (11:26 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 29 Jan 2018 06:11:22 +0000 (08:11 +0200)
This change cleans following scary warnings in valgrind output
when disk cache is being written:

   ==6532== Uninitialised byte(s) found during client check request
   ==6532==    at 0x14423FAD: blob_write_bytes (blob.c:152)
   ==6532==    by 0x144240FB: blob_write_uint32 (blob.c:194)
   ==6532==    by 0x144001A5: write_tex (nir_serialize.c:613)

and later (loads of):

   ==6532== Use of uninitialised value of size 8
   ==6532==    at 0x62FCD9E: crc32_z (in /usr/lib64/libz.so.1.2.11)
   ==6532==    by 0x13F65014: util_hash_crc32 (crc32.c:127)
   ==6532==    by 0x13F5DABA: cache_put (disk_cache.c:947)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/compiler/nir/nir_serialize.c

index 54a00c81d66c29da0ab604be837ac9bacb1b0862..9fe46a675f601b323b9163b3ba66e2a4fa42a146 100644 (file)
@@ -585,6 +585,7 @@ union packed_tex_data {
       unsigned component:2;
       unsigned has_texture_deref:1;
       unsigned has_sampler_deref:1;
+      unsigned unused:10; /* Mark unused for valgrind. */
    } u;
 };