aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo/vbo_exec_api.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-01-22 14:07:34 +0100
committermarha <marha@users.sourceforge.net>2013-01-22 14:07:34 +0100
commit470f7ca9f0be348faf2f03fc16811844c5eeffce (patch)
tree3071ab9b9fbabc772ee68c86fe587f260bde26c6 /mesalib/src/mesa/vbo/vbo_exec_api.c
parent4fc6b34d1c14cc61f553ca59264d0909656933f3 (diff)
downloadvcxsrv-470f7ca9f0be348faf2f03fc16811844c5eeffce.tar.gz
vcxsrv-470f7ca9f0be348faf2f03fc16811844c5eeffce.tar.bz2
vcxsrv-470f7ca9f0be348faf2f03fc16811844c5eeffce.zip
fontconfig libfontenc mesa mkfontscale pixman xserver xkeyboard-config
fontconfig: 000ca9ccb03013a5b151f0d21148ab0ca4c2f2de libfontenc: f5d1208172e965fdd7fae8927bd3e29b3cc3a975 mesa: 148fc6d53716f39971a453792570c2b8c207efb6 mkfontscale: 547517571e695728278a264eedbac47b6e1f43bc pixman: 2c6577476e5b18e17904ae8af244a39c352e2e33 xserver: 70b127c9f1c53bdb42f078265e67f76b464deae2 xkeyboard-config: 6b35b1b43d2fdff30f530d7cf65fffd6c3504690
Diffstat (limited to 'mesalib/src/mesa/vbo/vbo_exec_api.c')
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_api.c130
1 files changed, 68 insertions, 62 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c
index 657c9aaee..985f2209c 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_api.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_api.c
@@ -658,8 +658,6 @@ vbo_exec_EvalMesh1(GLenum mode, GLint i1, GLint i2)
GLfloat u, du;
GLenum prim;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
switch (mode) {
case GL_POINT:
prim = GL_POINTS;
@@ -696,8 +694,6 @@ vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
GLfloat u, du, v, dv, v1, u1;
GLint i, j;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
switch (mode) {
case GL_POINT:
case GL_LINE:
@@ -771,9 +767,6 @@ vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
static void GLAPIENTRY
vbo_exec_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
CALL_Begin(GET_DISPATCH(), (GL_QUADS));
CALL_Vertex2f(GET_DISPATCH(), (x1, y1));
CALL_Vertex2f(GET_DISPATCH(), (x2, y1));
@@ -789,54 +782,61 @@ vbo_exec_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
{
GET_CURRENT_CONTEXT( ctx );
+ struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
+ int i;
- if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) {
- struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
- int i;
-
- if (!_mesa_valid_prim_mode(ctx, mode, "glBegin")) {
- return;
- }
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBegin");
+ return;
+ }
- vbo_draw_method(vbo_context(ctx), DRAW_BEGIN_END);
+ if (!_mesa_valid_prim_mode(ctx, mode, "glBegin")) {
+ return;
+ }
- if (ctx->Driver.PrepareExecBegin)
- ctx->Driver.PrepareExecBegin(ctx);
+ vbo_draw_method(vbo_context(ctx), DRAW_BEGIN_END);
- if (ctx->NewState) {
- _mesa_update_state( ctx );
+ if (ctx->NewState) {
+ _mesa_update_state( ctx );
- CALL_Begin(ctx->Exec, (mode));
- return;
- }
+ CALL_Begin(ctx->Exec, (mode));
+ return;
+ }
- if (!_mesa_valid_to_render(ctx, "glBegin")) {
- return;
- }
+ if (!_mesa_valid_to_render(ctx, "glBegin")) {
+ return;
+ }
- /* Heuristic: attempt to isolate attributes occuring outside
- * begin/end pairs.
- */
- if (exec->vtx.vertex_size && !exec->vtx.attrsz[0])
- vbo_exec_FlushVertices_internal(exec, GL_FALSE);
-
- i = exec->vtx.prim_count++;
- exec->vtx.prim[i].mode = mode;
- exec->vtx.prim[i].begin = 1;
- exec->vtx.prim[i].end = 0;
- exec->vtx.prim[i].indexed = 0;
- exec->vtx.prim[i].weak = 0;
- exec->vtx.prim[i].pad = 0;
- exec->vtx.prim[i].start = exec->vtx.vert_count;
- exec->vtx.prim[i].count = 0;
- exec->vtx.prim[i].num_instances = 1;
- exec->vtx.prim[i].base_instance = 0;
-
- ctx->Driver.CurrentExecPrimitive = mode;
+ /* Heuristic: attempt to isolate attributes occuring outside
+ * begin/end pairs.
+ */
+ if (exec->vtx.vertex_size && !exec->vtx.attrsz[0])
+ vbo_exec_FlushVertices_internal(exec, GL_FALSE);
+
+ i = exec->vtx.prim_count++;
+ exec->vtx.prim[i].mode = mode;
+ exec->vtx.prim[i].begin = 1;
+ exec->vtx.prim[i].end = 0;
+ exec->vtx.prim[i].indexed = 0;
+ exec->vtx.prim[i].weak = 0;
+ exec->vtx.prim[i].pad = 0;
+ exec->vtx.prim[i].start = exec->vtx.vert_count;
+ exec->vtx.prim[i].count = 0;
+ exec->vtx.prim[i].num_instances = 1;
+ exec->vtx.prim[i].base_instance = 0;
+
+ ctx->Driver.CurrentExecPrimitive = mode;
+
+ ctx->Exec = ctx->BeginEnd;
+ /* We may have been called from a display list, in which case we should
+ * leave dlist.c's dispatch table in place.
+ */
+ if (ctx->CurrentDispatch == ctx->OutsideBeginEnd) {
+ ctx->CurrentDispatch = ctx->BeginEnd;
+ _glapi_set_dispatch(ctx->CurrentDispatch);
+ } else {
+ assert(ctx->CurrentDispatch == ctx->Save);
}
- else
- _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
-
}
@@ -846,26 +846,32 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
static void GLAPIENTRY vbo_exec_End( void )
{
GET_CURRENT_CONTEXT( ctx );
+ struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
- if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
- struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
-
- if (exec->vtx.prim_count > 0) {
- /* close off current primitive */
- int idx = exec->vtx.vert_count;
- int i = exec->vtx.prim_count - 1;
+ if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glEnd");
+ return;
+ }
- exec->vtx.prim[i].end = 1;
- exec->vtx.prim[i].count = idx - exec->vtx.prim[i].start;
- }
+ ctx->Exec = ctx->OutsideBeginEnd;
+ if (ctx->CurrentDispatch == ctx->BeginEnd) {
+ ctx->CurrentDispatch = ctx->OutsideBeginEnd;
+ _glapi_set_dispatch(ctx->CurrentDispatch);
+ }
- ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
+ if (exec->vtx.prim_count > 0) {
+ /* close off current primitive */
+ int idx = exec->vtx.vert_count;
+ int i = exec->vtx.prim_count - 1;
- if (exec->vtx.prim_count == VBO_MAX_PRIM)
- vbo_exec_vtx_flush( exec, GL_FALSE );
+ exec->vtx.prim[i].end = 1;
+ exec->vtx.prim[i].count = idx - exec->vtx.prim[i].start;
}
- else
- _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
+
+ ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
+
+ if (exec->vtx.prim_count == VBO_MAX_PRIM)
+ vbo_exec_vtx_flush( exec, GL_FALSE );
if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) {
_mesa_flush(ctx);