summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/common/driverfuncs.c1
-rw-r--r--src/mesa/main/dd.h8
-rw-r--r--src/mesa/vbo/vbo_exec_api.c3
3 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index 33da9346caf..263d4025ff3 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -208,6 +208,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->ProgramStringNotify = _tnl_program_string;
driver->FlushVertices = NULL;
driver->SaveFlushVertices = NULL;
+ driver->PrepareExecBegin = NULL;
driver->NotifySaveBegin = NULL;
driver->LightingSpaceChange = NULL;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 4e017ae3843..8607008dee6 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -861,6 +861,14 @@ struct dd_function_table {
void (*SaveFlushVertices)( struct gl_context *ctx );
/**
+ * \brief Hook for drivers to prepare for a glBegin/glEnd block
+ *
+ * This hook is called in vbo_exec_Begin() before any action, including
+ * state updates, occurs.
+ */
+ void (*PrepareExecBegin)( struct gl_context *ctx );
+
+ /**
* Give the driver the opportunity to hook in its own vtxfmt for
* compiling optimized display lists. This is called on each valid
* glBegin() during list compilation.
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 150589bec5e..5f3ed9d5db4 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -570,6 +570,9 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
return;
}
+ if (ctx->Driver.PrepareExecBegin)
+ ctx->Driver.PrepareExecBegin(ctx);
+
if (ctx->NewState) {
_mesa_update_state( ctx );