[Mesa-dev] [PATCH 4/5] i965: Initialize intel_context::vtbl after calling intelInitContext()

Chad Versace chad at chad-versace.us
Mon Oct 17 07:45:26 PDT 2011


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 <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 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



More information about the mesa-dev mailing list