Mesa (master): i965: Clear brw_compile on setup.

Eric Anholt anholt at kemper.freedesktop.org
Mon Sep 17 19:33:36 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Aug 30 16:22:52 2012 -0700

i965: Clear brw_compile on setup.

I noticed in valgrind that p->single_program_flow was used while
uninitialized.  Everything else zeroed out brw_compile, but this is better
API.

Reviewed-by: Paul Berry <stereotype441 at gmail.com>

---

 src/mesa/drivers/dri/i965/brw_eu.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
index acbf7c0..89091db 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -173,6 +173,8 @@ void brw_pop_insn_state( struct brw_compile *p )
 void
 brw_init_compile(struct brw_context *brw, struct brw_compile *p, void *mem_ctx)
 {
+   memset(p, 0, sizeof(*p));
+
    p->brw = brw;
    /*
     * Set the initial instruction store array size to 1024, if found that




More information about the mesa-commit mailing list