VirtualBox

Ignore:
Timestamp:
Aug 17, 2009 8:44:47 AM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: add compiled vertex array support

Location:
trunk/src/VBox/Additions/common/crOpenGL/pack
Files:
2 edited

Legend:

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

    r21564 r22284  
    137137}
    138138
     139void PACKSPU_APIENTRY packspu_IndexPointer( GLenum type, GLsizei stride, const GLvoid *pointer )
     140{
     141#if CR_ARB_vertex_buffer_object
     142    GET_CONTEXT(ctx);
     143    if (ctx->clientState->extensions.ARB_vertex_buffer_object) {
     144        if (pack_spu.swap)
     145            crPackIndexPointerSWAP( type, stride, pointer );
     146        else
     147            crPackIndexPointer( type, stride, pointer );
     148    }
     149#endif
     150    crStateIndexPointer(type, stride, pointer);
     151}
     152
    139153void PACKSPU_APIENTRY packspu_GetPointerv( GLenum pname, GLvoid **params )
    140154{
     
    175189
    176190    if (serverArrays) {
     191        GET_CONTEXT(ctx);
     192        CRClientState *clientState = &(ctx->clientState->client);
     193
     194        /*Note the comment in packspu_LockArraysEXT*/
     195        if (clientState->array.locked && !clientState->array.synced)
     196        {
     197            crPackLockArraysEXT(clientState->array.lockFirst, clientState->array.lockCount);
     198            clientState->array.synced = GL_TRUE;
     199        }
     200
    177201        /* Send the DrawArrays command over the wire */
    178202        if (pack_spu.swap)
     
    211235
    212236    if (serverArrays) {
     237        GET_CONTEXT(ctx);
     238        CRClientState *clientState = &(ctx->clientState->client);
     239
     240        /*Note the comment in packspu_LockArraysEXT*/
     241        if (clientState->array.locked && !clientState->array.synced)
     242        {
     243            crPackLockArraysEXT(clientState->array.lockFirst, clientState->array.lockCount);
     244            clientState->array.synced = GL_TRUE;
     245        }
     246       
    213247        /* Send the DrawArrays command over the wire */
    214248        if (pack_spu.swap)
     
    246280
    247281    if (serverArrays) {
     282        GET_CONTEXT(ctx);
     283        CRClientState *clientState = &(ctx->clientState->client);
     284
     285        /*Note the comment in packspu_LockArraysEXT*/
     286        if (clientState->array.locked && !clientState->array.synced)
     287        {
     288            crPackLockArraysEXT(clientState->array.lockFirst, clientState->array.lockCount);
     289            clientState->array.synced = GL_TRUE;
     290        }
     291
    248292        /* Send the DrawRangeElements command over the wire */
    249293        if (pack_spu.swap)
     
    279323
    280324    if (serverArrays) {
     325        GET_CONTEXT(ctx);
     326        CRClientState *clientState = &(ctx->clientState->client);
     327
     328        /*Note the comment in packspu_LockArraysEXT*/
     329        if (clientState->array.locked && !clientState->array.synced)
     330        {
     331            crPackLockArraysEXT(clientState->array.lockFirst, clientState->array.lockCount);
     332            clientState->array.synced = GL_TRUE;
     333        }
     334
    281335        /* Send the DrawArrays command over the wire */
    282336        if (pack_spu.swap)
     
    402456    crPackPopClientAttrib();
    403457}
     458
     459void PACKSPU_APIENTRY packspu_LockArraysEXT(GLint first, GLint count)
     460{
     461    if (first>=0 && count>0)
     462    {
     463        crStateLockArraysEXT(first, count);
     464        /*Note: this is a workaround for quake3 based apps.
     465          It's modifying vertex data between glLockArraysEXT and glDrawElements calls,
     466          so we'd pass data to host right before the glDrawSomething call.
     467        */
     468        /*crPackLockArraysEXT(first, count);*/
     469    }
     470    else crDebug("Ignoring packspu_LockArraysEXT: first:%i, count:%i", first, count);
     471}
     472
     473void PACKSPU_APIENTRY packspu_UnlockArraysEXT()
     474{
     475    crStateUnlockArraysEXT();
     476    crPackUnlockArraysEXT();
     477}
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special

    r21308 r22284  
    2222TexCoordPointer
    2323EdgeFlagPointer
     24IndexPointer
    2425ArrayElement
    2526DrawArrays
     
    7778GetBufferSubDataARB
    7879IsEnabled
     80LockArraysEXT
     81UnlockArraysEXT
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