summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2012-05-01 00:01:08 -0700
committerIan Romanick <ian.d.romanick@intel.com>2012-05-18 16:08:34 -0700
commit3eaa27789dd46d09e40087f781d7eb9b9721edf5 (patch)
tree81135f0daa3965eae8f303ccedf1afdbba0fa17e
parent6e8c30304e25dc3bd5a357de34e414fe12ce5ca2 (diff)
mesa: Add primitive restart support to glArrayElement
When primitive restart is enabled, and glArrayElement is called with the restart index value, then call glPrimitiveRestartNV. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Brian Paul<brianp@vmware.com> (cherry picked from commit 5795d3b5aec767dc2d7901b432f9182121b8e46f)
-rw-r--r--src/mesa/main/api_arrayelt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index 7bf55f3198b..6de6de2b765 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -1643,12 +1643,20 @@ void GLAPIENTRY _ae_ArrayElement( GLint elt )
const struct _glapi_table * const disp = GET_DISPATCH();
GLboolean do_map;
+ /* If PrimitiveRestart is enabled and the index is the RestartIndex
+ * then we call PrimitiveRestartNV and return.
+ */
+ if (ctx->Array.PrimitiveRestart && (elt == ctx->Array.RestartIndex)) {
+ CALL_PrimitiveRestartNV((struct _glapi_table *)disp, ());
+ return;
+ }
+
if (actx->NewState) {
assert(!actx->mapped_vbos);
_ae_update_state( ctx );
}
- /* Determine if w need to map/unmap VBOs */
+ /* Determine if we need to map/unmap VBOs */
do_map = actx->nr_vbos && !actx->mapped_vbos;
if (do_map)