Mesa (master): i965: Initialize intel_context:: vtbl after calling intelInitContext()

Chad Versace chadversary at kemper.freedesktop.org
Tue Oct 18 11:44:27 PDT 2011


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

Author: Chad Versace <chad at chad-versace.us>
Date:   Wed Aug 31 12:16:13 2011 -0700

i965: Initialize intel_context::vtbl after calling intelInitContext()

intel_context::gen field is set by intelInitContext(). So, by calling
intelInitContext() before initializing the vtable, we can can construct
different vtables for different gens.

Specifically, this allows us to set the HiZ operations to be no-ops for
contexts for which HiZ is not enabled.

Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Chad Versace <chad at chad-versace.us>

---

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

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 502b023..c1b274f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -71,7 +71,6 @@ brwCreateContext(int api,
       return false;
    }
 
-   brwInitVtbl( brw );
    brwInitDriverFunctions( &functions );
 
    if (!intelInitContext( intel, api, mesaVis, driContextPriv,
@@ -81,6 +80,8 @@ brwCreateContext(int api,
       return false;
    }
 
+   brwInitVtbl( brw );
+
    /* Initialize swrast, tnl driver tables: */
    intelInitSpanFuncs(ctx);
 



More information about the mesa-commit mailing list