VirtualBox

Ignore:
Timestamp:
Feb 4, 2011 2:31:32 PM (14 years ago)
Author:
vboxsync
Message:

crOpenGL: don't allow locking arrays with a bound vbo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_client.c

    r31808 r35852  
    14451445}
    14461446
     1447static GLboolean crStateCanLockClientPointer(CRClientPointer* cp)
     1448{
     1449    return !(cp->enabled && cp->buffer && cp->buffer->id);
     1450}
     1451
    14471452void STATE_APIENTRY crStateLockArraysEXT(GLint first, GLint count)
    14481453{
    14491454    CRContext *g = GetCurrentContext();
    14501455    CRClientState *c = &(g->client);
    1451     unsigned int i;
     1456    int i;
     1457
     1458    for (i=0; i<CRSTATECLIENT_MAX_VERTEXARRAYS; ++i)
     1459    {
     1460        if (!crStateCanLockClientPointer(crStateGetClientPointerByIndex(i, &c->array)))
     1461        {
     1462            break;
     1463        }
     1464    }
     1465    if (i<CRSTATECLIENT_MAX_VERTEXARRAYS)
     1466    {
     1467        crDebug("crStateLockArraysEXT ignored because array %i have a bound VBO", i);
     1468        return;
     1469    }
    14521470
    14531471    c->array.locked = GL_TRUE;
     
    14581476#endif
    14591477
    1460     crStateLockClientPointer(&c->array.v);
    1461     crStateLockClientPointer(&c->array.c);
    1462     crStateLockClientPointer(&c->array.f);
    1463     crStateLockClientPointer(&c->array.s);
    1464     crStateLockClientPointer(&c->array.e);
    1465     crStateLockClientPointer(&c->array.i);
    1466     crStateLockClientPointer(&c->array.n);
    1467     for (i = 0 ; i < CR_MAX_TEXTURE_UNITS ; i++)
    1468     {
    1469         crStateLockClientPointer(&c->array.t[i]);
    1470     }
    1471     for (i = 0; i < CR_MAX_VERTEX_ATTRIBS; i++)
    1472     {
    1473         crStateLockClientPointer(&c->array.a[i]);
     1478    for (i=0; i<CRSTATECLIENT_MAX_VERTEXARRAYS; ++i)
     1479    {
     1480        crStateLockClientPointer(crStateGetClientPointerByIndex(i, &c->array));
    14741481    }
    14751482}
     
    14791486    CRContext *g = GetCurrentContext();
    14801487    CRClientState *c = &(g->client);
    1481     unsigned int i;
     1488    int i;
    14821489
    14831490    c->array.locked = GL_FALSE;
     
    14861493#endif
    14871494
    1488     crStateUnlockClientPointer(&c->array.v);
    1489     crStateUnlockClientPointer(&c->array.c);
    1490     crStateUnlockClientPointer(&c->array.f);
    1491     crStateUnlockClientPointer(&c->array.s);
    1492     crStateUnlockClientPointer(&c->array.e);
    1493     crStateUnlockClientPointer(&c->array.i);
    1494     crStateUnlockClientPointer(&c->array.n);
    1495     for (i = 0 ; i < CR_MAX_TEXTURE_UNITS ; i++)
    1496     {
    1497         crStateUnlockClientPointer(&c->array.t[i]);
    1498     }
    1499     for (i = 0; i < CR_MAX_VERTEX_ATTRIBS; i++)
    1500     {
    1501         crStateUnlockClientPointer(&c->array.a[i]);
     1495    for (i=0; i<CRSTATECLIENT_MAX_VERTEXARRAYS; ++i)
     1496    {
     1497        crStateUnlockClientPointer(crStateGetClientPointerByIndex(i, &c->array));
    15021498    }
    15031499}
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