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.

Signed-off-by: Chad Versace <c...@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 dc91852..3cd635d 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -70,7 +70,6 @@ GLboolean brwCreateContext( int api,
       return GL_FALSE;
    }
 
-   brwInitVtbl( brw );
    brwInitDriverFunctions( &functions );
 
    if (!intelInitContext( intel, api, mesaVis, driContextPriv,
@@ -80,6 +79,8 @@ GLboolean brwCreateContext( int api,
       return GL_FALSE;
    }
 
+   brwInitVtbl( brw );
+
    /* Initialize swrast, tnl driver tables: */
    intelInitSpanFuncs(ctx);
 
-- 
1.7.6.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to