mesa: code refactoring- new _mesa_finish(), _mesa_flush()

This commit is contained in:
Brian Paul 2009-10-22 18:16:10 -06:00
parent 61a96a2ac7
commit 4837e01bcd
2 changed files with 37 additions and 8 deletions

View file

@ -1543,6 +1543,33 @@ _mesa_record_error(GLcontext *ctx, GLenum error)
}
/**
* Flush commands and wait for completion.
*/
void
_mesa_finish(GLcontext *ctx)
{
FLUSH_CURRENT( ctx, 0 );
if (ctx->Driver.Finish) {
ctx->Driver.Finish(ctx);
}
}
/**
* Flush commands.
*/
void
_mesa_flush(GLcontext *ctx)
{
FLUSH_CURRENT( ctx, 0 );
if (ctx->Driver.Flush) {
ctx->Driver.Flush(ctx);
}
}
/**
* Execute glFinish().
*
@ -1554,10 +1581,7 @@ _mesa_Finish(void)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
FLUSH_CURRENT( ctx, 0 );
if (ctx->Driver.Finish) {
ctx->Driver.Finish(ctx);
}
_mesa_finish(ctx);
}
@ -1572,10 +1596,7 @@ _mesa_Flush(void)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
FLUSH_CURRENT( ctx, 0 );
if (ctx->Driver.Flush) {
ctx->Driver.Flush(ctx);
}
_mesa_flush(ctx);
}

View file

@ -170,6 +170,14 @@ _mesa_valid_to_render(GLcontext *ctx, const char *where);
extern void
_mesa_record_error( GLcontext *ctx, GLenum error );
extern void
_mesa_finish(GLcontext *ctx);
extern void
_mesa_flush(GLcontext *ctx);
extern void GLAPIENTRY
_mesa_Finish( void );