freedreno/ir3: Initialize the unused dwords of the immediates consts.
authorEric Anholt <eric@anholt.net>
Wed, 29 Apr 2020 23:55:16 +0000 (16:55 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 30 Apr 2020 19:23:39 +0000 (19:23 +0000)
Avoids having spurious differences (and weird values to look at!) in
traces from uninitialized memory.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4824>

src/freedreno/ir3/ir3_cp.c

index 22023b0ac674b92fdc9ae6530cd8a934921880e9..cb5f88630b1bcef3f68d3fd608a92db7b97295cb 100644 (file)
@@ -343,6 +343,9 @@ lower_immed(struct ir3_cp_ctx *ctx, struct ir3_register *reg, unsigned new_flags
                const_state->immediates_size += 4;
                const_state->immediates = realloc (const_state->immediates,
                        const_state->immediates_size * sizeof(const_state->immediates[0]));
+
+               for (int i = const_state->immediate_idx; i < const_state->immediates_size * 4; i++)
+                       const_state->immediates[i / 4].val[i % 4] = 0xd0d0d0d0;
        }
 
        for (i = 0; i < const_state->immediate_idx; i++) {