VirtualBox

Changeset 26565 in vbox


Ignore:
Timestamp:
Feb 16, 2010 10:57:04 AM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: fixed host crashes when using GL_EXT_compiled_vertex_array and array element calls (#6165)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_beginend.py

    r20083 r26565  
    2424    /* XXX comparing mode >= 0 here is not needed since mode is unsigned */
    2525    CRASSERT( mode >= GL_POINTS && mode <= GL_POLYGON );
     26
     27#if CR_ARB_vertex_buffer_object
     28    {
     29        GLboolean serverArrays = GL_FALSE;
     30        GET_CONTEXT(ctx);
     31        if (ctx->clientState->extensions.ARB_vertex_buffer_object)
     32            serverArrays = crStateUseServerArrays();
     33        if (serverArrays) {
     34            CRClientState *clientState = &(ctx->clientState->client);
     35            if (clientState->array.locked && !clientState->array.synced)
     36            {
     37                crPackLockArraysEXT(clientState->array.lockFirst, clientState->array.lockCount);
     38                clientState->array.synced = GL_TRUE;
     39            }
     40        }
     41    }
     42#endif
    2643
    2744    if (pack_spu.swap)
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_client.c

    r26121 r26565  
    192192        CRClientState *clientState = &(ctx->clientState->client);
    193193
    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         }
     194        /* LockArraysEXT can not be executed between glBegin/glEnd pair, it also
     195         * leads to vertexpointers being adjusted on the host side between glBegin/glEnd calls which
     196         * produces unpredictable results. Locking is done before the glBegin call instead.
     197         */
     198        CRASSERT(!clientState->array.locked || clientState->array.synced);
    200199
    201200        /* Send the DrawArrays command over the wire */
     
    492491        /*Note: this is a workaround for quake3 based apps.
    493492          It's modifying vertex data between glLockArraysEXT and glDrawElements calls,
    494           so we'd pass data to host right before the glDrawSomething call.
     493          so we'd pass data to host right before the glDrawSomething or glBegin call.
    495494        */
    496495        /*crPackLockArraysEXT(first, count);*/
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