Mesa (master): freedreno/ir3: Initialize the unused dwords of the immediates consts.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 30 19:45:44 UTC 2020


Module: Mesa
Branch: master
Commit: 4715502975410855cf9997075fa9c598df0c5211
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4715502975410855cf9997075fa9c598df0c5211

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Apr 29 16:55:16 2020 -0700

freedreno/ir3: Initialize the unused dwords of the immediates consts.

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 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/freedreno/ir3/ir3_cp.c b/src/freedreno/ir3/ir3_cp.c
index 22023b0ac67..cb5f88630b1 100644
--- a/src/freedreno/ir3/ir3_cp.c
+++ b/src/freedreno/ir3/ir3_cp.c
@@ -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++) {



More information about the mesa-commit mailing list