VirtualBox

Ignore:
Timestamp:
Jul 25, 2011 10:59:42 AM (14 years ago)
Author:
vboxsync
Message:

crogl: auto-flush on thread switch functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c

    r37986 r38143  
    401401}
    402402
     403static void packspuFluchOnThreadSwitch(GLboolean fEnable)
     404{
     405    GET_THREAD(thread);
     406    if (thread->currentContext->fAutoFlush == fEnable)
     407        return;
     408
     409    thread->currentContext->fAutoFlush = fEnable;
     410    thread->currentContext->currentThread = fEnable ? thread : NULL;
     411}
     412
    403413void PACKSPU_APIENTRY packspu_ChromiumParameteriCR(GLenum target, GLint value)
    404414{
     415    if (GL_FLUSH_ON_THREAD_SWITCH_CR==target)
     416    {
     417        /* this is a pure packspu state, don't propagate it any further */
     418        packspuFluchOnThreadSwitch(value);
     419        return;
     420    }
    405421    if (GL_SHARE_CONTEXT_RESOURCES_CR==target)
    406422    {
     
    555571        }
    556572
     573        for (i=0; i<CR_MAX_CONTEXTS; ++i)
     574        {
     575            ContextInfo *ctx = &pack_spu.context[i];
     576            if (ctx->currentThread == thread)
     577            {
     578                CRASSERT(ctx->fAutoFlush);
     579                ctx->currentThread = NULL;
     580            }
     581        }
     582
    557583        crUnlockMutex(&_PackMutex);
    558584    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette