summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/dd.h
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2011-09-28 17:06:35 -0700
committerChad Versace <[email protected]>2011-10-18 11:42:53 -0700
commitfd7c46f53f3a7ae5c67f3c44ba283eeb4f72b366 (patch)
tree66d5389cde9c5bd181489afde376aee453c07747 /src/mesa/main/dd.h
parent4b6311978f6710cfb2e9d77a2ca7a30f709c1f37 (diff)
mesa: Add dd_function_table::PrepareExecBegin
This hook allows the driver to prepare for a glBegin/glEnd. i965 will use the hook to avoid avoid recursive calls to FLUSH_VERTICES during a buffer resolve meta-op. Detailed Justification ---------------------- When vertices are queued during a glBegin/glEnd block, those vertices must of course be drawn before any rendering state changes. To enusure this, Mesa calls FLUSH_VERTICES as a prehook to such state changes. Therefore, FLUSH_VERTICES itself cannot change rendering state without falling into a recursive trap. This precludes meta-ops, namely i965 buffer resolves, from occuring while any vertices are queued. To avoid that situation, i965 must satisfy the following condition: that it queues no vertex if a buffer needs resolving. To satisfy this, i965 will use the PrepareExecBegin hook to resolve all buffers on entering a glBegin/glEnd block. -------- v2: Don't add dd_function_table::CleanupExecEnd. Anholt and I discovered that hook to be unnecessary. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/main/dd.h')
-rw-r--r--src/mesa/main/dd.h8
1 files changed, 8 insertions, 0 deletions
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.