[Mesa-dev] [RFC 1/4] mesa: add driver callback "InitializeVersionFeatures"

Jordan Justen jordan.l.justen at intel.com
Wed Nov 14 10:32:19 PST 2012


During context initialization, this callback allows the driver
to configure features of the context so the correct GL/GLES
version will be calculated.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/drivers/common/driverfuncs.c |    1 +
 src/mesa/main/dd.h                    |    6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index 93fa3c7..2f6384c 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -71,6 +71,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
 {
    memset(driver, 0, sizeof(*driver));
 
+   driver->InitializeVersionFeatures = NULL;  /* REQUIRED! */
    driver->GetString = NULL;  /* REQUIRED! */
    driver->UpdateState = NULL;  /* REQUIRED! */
    driver->GetBufferSize = NULL;  /* REQUIRED! */
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 70c5324..60122bb 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -78,6 +78,12 @@ struct gl_texture_object;
  */
 struct dd_function_table {
    /**
+    * During context creation, this function allows the driver to initialize
+    * context features (ctx->Extensions, ctx->Const...)
+    */
+   void (*InitializeVersionFeatures)( struct gl_context *ctx );
+
+   /**
     * Return a string as needed by glGetString().
     * Only the GL_RENDERER query must be implemented.  Otherwise, NULL can be
     * returned.
-- 
1.7.9.5



More information about the mesa-dev mailing list