VirtualBox

Ignore:
Timestamp:
May 20, 2014 7:12:20 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
93791
Message:

crOpenGL: bugfixes and work-arounds for wine issues

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu.h

    r51200 r51313  
    2828typedef struct thread_info_t ThreadInfo;
    2929typedef struct context_info_t ContextInfo;
     30typedef struct zvabuffer_info_t ZvaBufferInfo;
     31
     32struct zvabuffer_info_t
     33{
     34    /* GL_ARRAY_BUFFER_ARB buffer */
     35    GLuint idBuffer;
     36    /* buffer length */
     37    GLuint cbBuffer;
     38    /* number of values stored in the buffer currently */
     39    GLuint cValues;
     40    /* current buffer value */
     41    union
     42    {
     43        GLfloat f[4];
     44        GLuint ui[4];
     45        GLubyte ub[4];
     46        GLshort s[4];
     47        GLushort us[4];
     48    } Value;
     49};
    3050
    3151struct thread_info_t {
     
    4868    GLint serverCtx;         /* context ID returned by server */
    4969    GLboolean  fAutoFlush;
     70    GLboolean  fCheckZerroVertAttr;
    5071    ThreadInfo *currentThread;
     72    ZvaBufferInfo zvaBufferInfo;
    5173    GLubyte glVersion[100];     /* GL_VERSION string */
    5274    GLubyte pszRealVendor[100];
     
    7698#endif
    7799
    78 #ifdef VBOX_WITH_CRPACKSPU_DUMPER
    79100    SPUDispatchTable self;
    80101
     102#ifdef VBOX_WITH_CRPACKSPU_DUMPER
    81103    CR_RECORDER Recorder;
    82104    CR_DBGPRINT_DUMPER Dumper;
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_client.c

    r47079 r51313  
    99#include "cr_glstate.h"
    1010#include "packspu_proto.h"
     11#include "cr_mem.h"
    1112
    1213void PACKSPU_APIENTRY packspu_FogCoordPointerEXT( GLenum type, GLsizei stride, const GLvoid *pointer )
     
    173174}
    174175
     176#ifdef DEBUG_misha
     177/* debugging */
     178//# define CR_FORCE_ZVA_SERVER_ARRAY
     179#endif
     180# define CR_FORCE_ZVA_EXPAND
     181
     182
     183GLboolean packspuZvaCreate(ContextInfo *pCtx, const GLfloat *pValue, GLuint cValues)
     184{
     185    ZvaBufferInfo *pInfo = &pCtx->zvaBufferInfo;
     186    GLuint cbValue = 4 * sizeof (*pValue);
     187    GLuint cbValues = cValues * cbValue;
     188    GLfloat *pBuffer;
     189    uint8_t *pu8Buf;
     190    GLuint i;
     191
     192    /* quickly sort out if we can use the current value */
     193    if (pInfo->idBuffer
     194            && pInfo->cValues >= cValues
     195            && !memcmp(pValue, &pInfo->Value, cbValue))
     196        return GL_FALSE;
     197
     198    pBuffer = (GLfloat*)crAlloc(cbValues);
     199    if (!pBuffer)
     200    {
     201        WARN(("crAlloc for pBuffer failed"));
     202        return GL_FALSE;
     203    }
     204
     205    pu8Buf = (uint8_t *)pBuffer;
     206    for (i = 0; i < cValues; ++i)
     207    {
     208        memcpy(pu8Buf, pValue, cbValue);
     209        pu8Buf += cbValue;
     210    }
     211
     212    /* */
     213    if (!pInfo->idBuffer)
     214    {
     215        pack_spu.self.GenBuffersARB(1, &pInfo->idBuffer);
     216        Assert(pInfo->idBuffer);
     217    }
     218
     219    pack_spu.self.BindBufferARB(GL_ARRAY_BUFFER_ARB, pInfo->idBuffer);
     220
     221    if (pInfo->cbBuffer < cbValues)
     222    {
     223        pack_spu.self.BufferDataARB(GL_ARRAY_BUFFER_ARB, cbValues, pBuffer, GL_DYNAMIC_DRAW_ARB);
     224        pInfo->cbBuffer = cbValues;
     225    }
     226    else
     227    {
     228        pack_spu.self.BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, cbValues, pBuffer);
     229    }
     230
     231    pInfo->cValues = cValues;
     232    memcpy(&pInfo->Value, pValue, cbValue);
     233
     234    crFree(pBuffer);
     235
     236    return GL_TRUE;
     237}
     238
     239typedef struct
     240{
     241    ContextInfo *pCtx;
     242    GLuint idBuffer;
     243    CRClientPointer cp;
     244} CR_ZVA_RESTORE_CTX;
     245
     246void packspuZvaEnable(ContextInfo *pCtx, const GLfloat *pValue, GLuint cValues, CR_ZVA_RESTORE_CTX *pRestoreCtx)
     247{
     248    CRContext *g = pCtx->clientState;
     249
     250    Assert(0);
     251
     252#ifdef DEBUG
     253    {
     254        CRContext *pCurState = crStateGetCurrent();
     255
     256        Assert(g == pCurState);
     257    }
     258#endif
     259
     260    pRestoreCtx->pCtx = pCtx;
     261    pRestoreCtx->idBuffer = g->bufferobject.arrayBuffer ? g->bufferobject.arrayBuffer->id : 0;
     262    pRestoreCtx->cp = g->client.array.a[0];
     263
     264    Assert(!pRestoreCtx->cp.enabled);
     265
     266    /* buffer ref count mechanism does not work actually atm,
     267     * still ensure the buffer does not get destroyed if we fix it in the future */
     268    if (pRestoreCtx->cp.buffer)
     269        pRestoreCtx->cp.buffer->refCount++;
     270
     271    packspuZvaCreate(pCtx, pValue, cValues);
     272
     273    pack_spu.self.BindBufferARB(GL_ARRAY_BUFFER_ARB, pCtx->zvaBufferInfo.idBuffer);
     274
     275    pack_spu.self.VertexAttribPointerARB(0, 4, GL_FLOAT,
     276            GL_FALSE, /*normalized*/
     277            0, /*stride*/
     278            NULL /*addr*/);
     279
     280    pack_spu.self.EnableVertexAttribArrayARB(0);
     281}
     282
     283void packspuZvaDisable(CR_ZVA_RESTORE_CTX *pRestoreCtx)
     284{
     285    if (pRestoreCtx->cp.buffer)
     286        pack_spu.self.BindBufferARB(GL_ARRAY_BUFFER_ARB, pRestoreCtx->cp.buffer->id);
     287    else
     288        pack_spu.self.BindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
     289
     290    pack_spu.self.VertexAttribPointerARB(0, pRestoreCtx->cp.size, pRestoreCtx->cp.type,
     291            pRestoreCtx->cp.normalized, /*normalized*/
     292            pRestoreCtx->cp.stride, /*stride*/
     293            pRestoreCtx->cp.p);
     294
     295    if (pRestoreCtx->cp.enabled)
     296        pack_spu.self.EnableVertexAttribArrayARB(0);
     297    else
     298        pack_spu.self.DisableVertexAttribArrayARB(0);
     299
     300    if (pRestoreCtx->cp.buffer)
     301    {
     302        if (pRestoreCtx->cp.buffer->id != pRestoreCtx->idBuffer)
     303            pack_spu.self.BindBufferARB(GL_ARRAY_BUFFER_ARB, pRestoreCtx->idBuffer);
     304
     305        /* we have increased the refcount above, decrease it back */
     306        pRestoreCtx->cp.buffer->refCount--;
     307    }
     308    else
     309    {
     310        if (pRestoreCtx->idBuffer)
     311            pack_spu.self.BindBufferARB(GL_ARRAY_BUFFER_ARB, pRestoreCtx->idBuffer);
     312    }
     313
     314#ifdef DEBUG
     315    {
     316        CRContext *g = pRestoreCtx->pCtx->clientState;
     317        CRContext *pCurState = crStateGetCurrent();
     318
     319        Assert(g == pCurState);
     320
     321        Assert(pRestoreCtx->cp.p == g->client.array.a[0].p);
     322        Assert(pRestoreCtx->cp.size == g->client.array.a[0].size);
     323        Assert(pRestoreCtx->cp.type == g->client.array.a[0].type);
     324        Assert(pRestoreCtx->cp.stride == g->client.array.a[0].stride);
     325        Assert(pRestoreCtx->cp.enabled == g->client.array.a[0].enabled);
     326        Assert(pRestoreCtx->cp.normalized == g->client.array.a[0].normalized);
     327        Assert(pRestoreCtx->cp.bytesPerIndex == g->client.array.a[0].bytesPerIndex);
     328# ifdef CR_ARB_vertex_buffer_object
     329        Assert(pRestoreCtx->cp.buffer == g->client.array.a[0].buffer);
     330# endif
     331# ifdef CR_EXT_compiled_vertex_array
     332        Assert(pRestoreCtx->cp.locked == g->client.array.a[0].locked);
     333# endif
     334        Assert(pRestoreCtx->idBuffer == (g->bufferobject.arrayBuffer ? g->bufferobject.arrayBuffer->id : 0));
     335    }
     336#endif
     337}
    175338
    176339void PACKSPU_APIENTRY
     
    180343#if 1
    181344    GLboolean serverArrays = GL_FALSE;
     345    GLuint cZvaValues = 0;
     346    GLfloat aAttrib[4];
    182347
    183348#if CR_ARB_vertex_buffer_object
     
    185350    /*crDebug("packspu_ArrayElement index:%i", index);*/
    186351    if (ctx->clientState->extensions.ARB_vertex_buffer_object)
     352    {
    187353        serverArrays = crStateUseServerArrays();
    188 #endif
    189 
    190     if (serverArrays) {
     354        if (ctx->fCheckZerroVertAttr)
     355            cZvaValues = crStateNeedDummyZeroVertexArray(thread->currentContext->clientState, &thread->packer->current, aAttrib);
     356    }
     357#endif
     358
     359    if (serverArrays
     360#ifdef CR_FORCE_ZVA_EXPAND
     361            && !cZvaValues
     362#endif
     363            ) {
     364        CR_ZVA_RESTORE_CTX RestoreCtx;
    191365        GET_CONTEXT(ctx);
    192366        CRClientState *clientState = &(ctx->clientState->client);
     367
     368        Assert(cZvaValues < UINT32_MAX/2);
    193369
    194370        /* LockArraysEXT can not be executed between glBegin/glEnd pair, it also
     
    198374        CRASSERT(!clientState->array.locked || clientState->array.synced);
    199375
     376        if (cZvaValues)
     377            packspuZvaEnable(ctx, aAttrib, cZvaValues, &RestoreCtx);
     378
    200379        /* Send the DrawArrays command over the wire */
    201380        if (pack_spu.swap)
     
    203382        else
    204383            crPackArrayElement( index );
     384
     385        if (cZvaValues)
     386            packspuZvaDisable(&RestoreCtx);
    205387    }
    206388    else {
     
    208390        GET_CONTEXT(ctx);
    209391        CRClientState *clientState = &(ctx->clientState->client);
    210         if (pack_spu.swap)
    211             crPackExpandArrayElementSWAP( index, clientState );
    212         else
    213             crPackExpandArrayElement( index, clientState );
     392
     393#ifdef CR_FORCE_ZVA_SERVER_ARRAY
     394        CR_ZVA_RESTORE_CTX RestoreCtx;
     395
     396        if (cZvaValues && cZvaValues < UINT32_MAX/2)
     397            packspuZvaEnable(ctx, aAttrib, cZvaValues, &RestoreCtx);
     398#endif
     399
     400        if (pack_spu.swap)
     401            crPackExpandArrayElementSWAP( index, clientState, cZvaValues ? aAttrib : NULL );
     402        else
     403            crPackExpandArrayElement( index, clientState, cZvaValues ? aAttrib : NULL );
     404
     405#ifdef CR_FORCE_ZVA_SERVER_ARRAY
     406        if (cZvaValues && cZvaValues < UINT32_MAX/2)
     407            packspuZvaDisable(&RestoreCtx);
     408#endif
    214409    }
    215410#else
    216411    GET_CONTEXT(ctx);
    217412    CRClientState *clientState = &(ctx->clientState->client);
    218     crPackExpandArrayElement(index, clientState);
     413    crPackExpandArrayElement(index, clientState, NULL);
    219414#endif
    220415}
    221416
    222417/*#define CR_USE_LOCKARRAYS*/
     418#ifdef CR_USE_LOCKARRAYS
     419# error "check Zero Vertex Attrib hack is supported properly!"
     420#endif
    223421
    224422void PACKSPU_APIENTRY
     
    226424{
    227425    GLboolean serverArrays = GL_FALSE;
     426    GLuint cZvaValues = 0;
     427    GLfloat aAttrib[4];
    228428
    229429#if CR_ARB_vertex_buffer_object
     
    233433    /*crDebug("DrawElements count=%d, indices=%p", count, indices);*/
    234434    if (ctx->clientState->extensions.ARB_vertex_buffer_object)
     435    {
    235436        serverArrays = crStateUseServerArrays();
     437        if (ctx->fCheckZerroVertAttr)
     438            cZvaValues = crStateNeedDummyZeroVertexArray(thread->currentContext->clientState, &thread->packer->current, aAttrib);
     439    }
    236440
    237441# ifdef CR_USE_LOCKARRAYS
     
    298502#endif
    299503
    300     if (serverArrays) {
     504    if (serverArrays
     505#ifdef CR_FORCE_ZVA_EXPAND
     506            && !cZvaValues
     507#endif
     508            ) {
     509        CR_ZVA_RESTORE_CTX RestoreCtx;
    301510        GET_CONTEXT(ctx);
    302511        CRClientState *clientState = &(ctx->clientState->client);
    303512
     513        Assert(cZvaValues < UINT32_MAX/2);
     514
     515        if (cZvaValues)
     516            packspuZvaEnable(ctx, aAttrib, cZvaValues, &RestoreCtx);
     517
    304518        /*Note the comment in packspu_LockArraysEXT*/
    305519        if (clientState->array.locked && !clientState->array.synced)
     
    308522            clientState->array.synced = GL_TRUE;
    309523        }
     524
    310525        /* Send the DrawArrays command over the wire */
    311526        if (pack_spu.swap)
     
    313528        else
    314529            crPackDrawElements( mode, count, type, indices );
     530
     531        if (cZvaValues)
     532            packspuZvaDisable(&RestoreCtx);
    315533    }
    316534    else {
     
    318536        GET_CONTEXT(ctx);
    319537        CRClientState *clientState = &(ctx->clientState->client);
    320         if (pack_spu.swap)
    321             crPackExpandDrawElementsSWAP( mode, count, type, indices, clientState );
     538
     539#ifdef CR_FORCE_ZVA_SERVER_ARRAY
     540        CR_ZVA_RESTORE_CTX RestoreCtx;
     541
     542        if (cZvaValues && cZvaValues < UINT32_MAX/2)
     543            packspuZvaEnable(ctx, aAttrib, cZvaValues, &RestoreCtx);
     544#endif
     545
     546        if (pack_spu.swap)
     547            crPackExpandDrawElementsSWAP( mode, count, type, indices, clientState, cZvaValues ? aAttrib : NULL );
    322548        else
    323549        {
    324550            //packspu_Begin(mode);
    325             crPackExpandDrawElements( mode, count, type, indices, clientState );
     551            crPackExpandDrawElements( mode, count, type, indices, clientState, cZvaValues ? aAttrib : NULL );
    326552            //packspu_End();
    327553        }
     554
     555#ifdef CR_FORCE_ZVA_SERVER_ARRAY
     556        if (cZvaValues && cZvaValues < UINT32_MAX/2)
     557            packspuZvaDisable(&RestoreCtx);
     558#endif
    328559    }
    329560
     
    341572{
    342573    GLboolean serverArrays = GL_FALSE;
     574    GLuint cZvaValues = 0;
     575    GLfloat aAttrib[4];
    343576
    344577#if CR_ARB_vertex_buffer_object
     
    346579    /*crDebug("DrawRangeElements count=%d", count);*/
    347580    if (ctx->clientState->extensions.ARB_vertex_buffer_object)
     581    {
    348582         serverArrays = crStateUseServerArrays();
    349 #endif
    350 
    351     if (serverArrays) {
     583         if (ctx->fCheckZerroVertAttr)
     584             cZvaValues = crStateNeedDummyZeroVertexArray(thread->currentContext->clientState, &thread->packer->current, aAttrib);
     585    }
     586#endif
     587
     588    if (serverArrays
     589#ifdef CR_FORCE_ZVA_EXPAND
     590            && !cZvaValues
     591#endif
     592            ) {
     593        CR_ZVA_RESTORE_CTX RestoreCtx;
    352594        GET_CONTEXT(ctx);
    353595        CRClientState *clientState = &(ctx->clientState->client);
    354596
     597        Assert(cZvaValues < UINT32_MAX/2);
     598
     599        if (cZvaValues)
     600            packspuZvaEnable(ctx, aAttrib, cZvaValues, &RestoreCtx);
     601
    355602        /*Note the comment in packspu_LockArraysEXT*/
    356603        if (clientState->array.locked && !clientState->array.synced)
     
    365612        else
    366613            crPackDrawRangeElements( mode, start, end, count, type, indices );
     614
     615        if (cZvaValues)
     616            packspuZvaDisable(&RestoreCtx);
    367617    }
    368618    else {
     
    370620        GET_CONTEXT(ctx);
    371621        CRClientState *clientState = &(ctx->clientState->client);
    372         if (pack_spu.swap)
    373             crPackExpandDrawRangeElementsSWAP( mode, start, end, count, type, indices, clientState );
    374         else
    375         {
    376             crPackExpandDrawRangeElements( mode, start, end, count, type, indices, clientState );
    377         }
     622#ifdef CR_FORCE_ZVA_SERVER_ARRAY
     623        CR_ZVA_RESTORE_CTX RestoreCtx;
     624
     625        if (cZvaValues && cZvaValues < UINT32_MAX/2)
     626            packspuZvaEnable(ctx, aAttrib, cZvaValues, &RestoreCtx);
     627#endif
     628
     629        if (pack_spu.swap)
     630            crPackExpandDrawRangeElementsSWAP( mode, start, end, count, type, indices, clientState, cZvaValues ? aAttrib : NULL );
     631        else
     632        {
     633            crPackExpandDrawRangeElements( mode, start, end, count, type, indices, clientState, cZvaValues ? aAttrib : NULL );
     634        }
     635
     636#ifdef CR_FORCE_ZVA_SERVER_ARRAY
     637        if (cZvaValues && cZvaValues < UINT32_MAX/2)
     638            packspuZvaDisable(&RestoreCtx);
     639#endif
    378640    }
    379641}
     
    384646{
    385647    GLboolean serverArrays = GL_FALSE;
     648    GLuint cZvaValues = 0;
     649    GLfloat aAttrib[4];
    386650
    387651#if CR_ARB_vertex_buffer_object
     
    390654    /*crDebug("DrawArrays count=%d", count);*/
    391655    if (ctx->clientState->extensions.ARB_vertex_buffer_object)
     656    {
    392657         serverArrays = crStateUseServerArrays();
     658         if (ctx->fCheckZerroVertAttr)
     659             cZvaValues = crStateNeedDummyZeroVertexArray(thread->currentContext->clientState, &thread->packer->current, aAttrib);
     660    }
    393661
    394662# ifdef CR_USE_LOCKARRAYS
     
    409677#endif
    410678
    411     if (serverArrays)
    412     {
     679    if (serverArrays
     680#ifdef CR_FORCE_ZVA_EXPAND
     681            && !cZvaValues
     682#endif
     683            )
     684    {
     685        CR_ZVA_RESTORE_CTX RestoreCtx;
    413686        GET_CONTEXT(ctx);
    414687        CRClientState *clientState = &(ctx->clientState->client);
    415688
     689        Assert(cZvaValues < UINT32_MAX/2);
     690
     691        if (cZvaValues)
     692            packspuZvaEnable(ctx, aAttrib, cZvaValues, &RestoreCtx);
     693
    416694        /*Note the comment in packspu_LockArraysEXT*/
    417695        if (clientState->array.locked && !clientState->array.synced)
     
    426704        else
    427705            crPackDrawArrays( mode, first, count );
     706
     707        if (cZvaValues)
     708            packspuZvaDisable(&RestoreCtx);
    428709    }
    429710    else
     
    432713        GET_CONTEXT(ctx);
    433714        CRClientState *clientState = &(ctx->clientState->client);
    434         if (pack_spu.swap)
    435             crPackExpandDrawArraysSWAP( mode, first, count, clientState );
    436         else
    437             crPackExpandDrawArrays( mode, first, count, clientState );
     715#ifdef CR_FORCE_ZVA_SERVER_ARRAY
     716        CR_ZVA_RESTORE_CTX RestoreCtx;
     717
     718        if (cZvaValues && cZvaValues < UINT32_MAX/2)
     719            packspuZvaEnable(ctx, aAttrib, cZvaValues, &RestoreCtx);
     720#endif
     721
     722        if (pack_spu.swap)
     723            crPackExpandDrawArraysSWAP( mode, first, count, clientState, cZvaValues ? aAttrib : NULL );
     724        else
     725            crPackExpandDrawArrays( mode, first, count, clientState, cZvaValues ? aAttrib : NULL );
     726
     727#ifdef CR_FORCE_ZVA_SERVER_ARRAY
     728        if (cZvaValues && cZvaValues < UINT32_MAX/2)
     729            packspuZvaDisable(&RestoreCtx);
     730#endif
     731
    438732    }
    439733
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c

    r49260 r51313  
    419419    context->serverCtx = 0;
    420420    context->currentThread = NULL;
     421
     422    memset (&context->zvaBufferInfo, 0, sizeof (context->zvaBufferInfo));
    421423
    422424    if (curContext == context)
     
    500502            }
    501503
     504            if (thread->currentContext && newCtx != thread->currentContext && thread->currentContext->fCheckZerroVertAttr)
     505            {
     506                crStateCurrentRecoverNew(thread->currentContext->clientState, &thread->packer->current);
     507                crStateResetCurrentPointers(&thread->packer->current);
     508            }
    502509            thread->currentContext = newCtx;
    503510            crPackSetContext( thread->packer );
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_get.py

    r51202 r51313  
    5858simple_funcs = [ 'GetIntegerv', 'GetFloatv', 'GetDoublev', 'GetBooleanv' ]
    5959simple_swaps = [ 'SWAP32', 'SWAPFLOAT', 'SWAPDOUBLE', '(GLboolean) SWAP32' ]
     60
     61vertattr_get_funcs = [ 'GetVertexAttribdv' 'GetVertexAttribfv' 'GetVertexAttribiv' ]
    6062
    6163hard_funcs = {
     
    122124        || pname == GL_DRAW_FRAMEBUFFER_BINDING_EXT
    123125#endif
     126        || pname == GL_ARRAY_BUFFER_BINDING
     127        || pname == GL_ELEMENT_ARRAY_BUFFER_BINDING
     128        || pname == GL_PIXEL_PACK_BUFFER_BINDING
     129        || pname == GL_PIXEL_UNPACK_BUFFER_BINDING
    124130        )
    125131        {
     
    157163        }
    158164            """ % (params[-1][1], params[-1][1], func_name, func_name, apiutil.MakeCallString(params), func_name, func_name)
     165           
     166        if func_name in vertattr_get_funcs:
     167            print """
     168    if (pname != GL_CURRENT_VERTEX_ATTRIB_ARB)
     169    {
     170#ifdef DEBUG
     171        %s localparams;
     172        localparams = (%s) crAlloc(__numValues(pname) * sizeof(*localparams));
     173        crState%s(index, pname, localparams);
     174        crPack%s(index, %s, &writeback);
     175        packspuFlush( (void *) thread );
     176        CRPACKSPU_WRITEBACK_WAIT(thread, writeback);
     177        for (i=0; i<crStateHlpComponentsCount(pname); ++i)
     178        {
     179            if (localparams[i] != params[i])
     180            {
     181                crWarning("Incorrect local state in %s for %%x param %%i", pname, i);
     182                crWarning("Expected %%i but got %%i", (int)localparams[i], (int)params[i]);
     183            }
     184        }
     185        crFree(localparams);
     186#else
     187        crState%s(pname, params);
     188#endif
     189        return;
     190    }
     191            """ % (params[-1][1], params[-1][1], func_name, func_name, apiutil.MakeCallString(params), func_name, func_name)
     192
    159193        params.append( ("&writeback", "foo", 0) )
    160194        print '\tif (pack_spu.swap)'
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_init.c

    r49264 r51313  
    8080packSPUSelfDispatch(SPUDispatchTable *self)
    8181{
    82 #ifdef VBOX_WITH_CRPACKSPU_DUMPER
    8382    crSPUInitDispatchTable( &(pack_spu.self) );
    8483    crSPUCopyDispatchTable( &(pack_spu.self), self );
    85 #else
    86     (void)self;
    87 #endif
    8884}
    8985
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c

    r50095 r51313  
    435435}
    436436
     437static void packspuCheckZerroVertAttr(GLboolean fEnable)
     438{
     439    GET_THREAD(thread);
     440
     441    thread->currentContext->fCheckZerroVertAttr = fEnable;
     442}
     443
    437444void PACKSPU_APIENTRY packspu_ChromiumParameteriCR(GLenum target, GLint value)
    438445{
     
    442449            /* this is a pure packspu state, don't propagate it any further */
    443450            packspuFluchOnThreadSwitch(value);
     451            return;
     452        case GL_CHECK_ZERO_VERT_ARRT:
     453            packspuCheckZerroVertAttr(value);
    444454            return;
    445455        case GL_SHARE_CONTEXT_RESOURCES_CR:
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_net.c

    r51200 r51313  
    131131    CRASSERT(buf);
    132132
     133    if (ctx && ctx->fCheckZerroVertAttr)
     134    {
     135        crStateCurrentRecoverNew(ctx->clientState, &thread->packer->current);
     136        crStateResetCurrentPointers(&thread->packer->current);
     137    }
     138
    133139    /* We're done packing into the current buffer, unbind it */
    134140    crPackReleaseBuffer( thread->packer );
Note: See TracChangeset for help on using the changeset viewer.

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