summaryrefslogtreecommitdiff
path: root/xc/extras/Mesa/src/tnl/t_imm_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/extras/Mesa/src/tnl/t_imm_api.c')
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_api.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/xc/extras/Mesa/src/tnl/t_imm_api.c b/xc/extras/Mesa/src/tnl/t_imm_api.c
index 0544496a7..9b6c6cf43 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_api.c
+++ b/xc/extras/Mesa/src/tnl/t_imm_api.c
@@ -84,7 +84,9 @@ void _tnl_flush_vertices( GLcontext *ctx, GLuint flags )
IM->Flag[IM->Start]);
if (IM->Flag[IM->Start])
- if ((flags & FLUSH_UPDATE_CURRENT) || IM->Count > IM->Start)
+ if ((flags & FLUSH_UPDATE_CURRENT) ||
+ IM->Count > IM->Start ||
+ (IM->Flag[IM->Start] & (VERT_BEGIN|VERT_END)))
_tnl_flush_immediate( IM );
}
@@ -144,16 +146,9 @@ _tnl_save_Begin( GLenum mode )
ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
IM->BeginState = state;
- if (ctx->ExecuteFlag) {
- if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "_tnl_Begin" );
- }
- else
- ctx->Driver.CurrentExecPrimitive = mode;
- }
-
-
- /* Update save_primitive now.
+ /* Update save_primitive now. Don't touch ExecPrimitive as this is
+ * updated in the replay of this cassette if we are in
+ * COMPILE_AND_EXECUTE mode.
*/
if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN)
ctx->Driver.CurrentSavePrimitive = PRIM_INSIDE_UNKNOWN_PRIM;
@@ -189,8 +184,9 @@ _tnl_Begin( GLenum mode )
if (IM->Start == IM->Count &&
tnl->Driver.NotifyBegin &&
- tnl->Driver.NotifyBegin( ctx, mode ))
+ tnl->Driver.NotifyBegin( ctx, mode )) {
return;
+ }
assert( IM->SavedBeginState == 0 );
assert( IM->BeginState == 0 );
@@ -209,8 +205,6 @@ _tnl_Begin( GLenum mode )
IM->LastPrimitive = count;
IM->BeginState = (VERT_BEGIN_0|VERT_BEGIN_1);
-/* fprintf(stderr, "%s: %x\n", __FUNCTION__, IM->BeginState); */
-
ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
ctx->Driver.CurrentExecPrimitive = mode;
}
@@ -344,7 +338,11 @@ _tnl_end( GLcontext *ctx )
IM->BeginState = state;
- if (ctx->ExecuteFlag) {
+ /* Only update CurrentExecPrimitive if not compiling. If we are in
+ * COMPILE_AND_EXECUTE mode, it will be done on replay of this
+ * cassette.
+ */
+ if (!ctx->CompileFlag) {
if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END)
_mesa_error( ctx, GL_INVALID_OPERATION, "_tnl_End" );
else