VirtualBox

Changeset 54641 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 5, 2015 3:15:13 AM (10 years ago)
Author:
vboxsync
Message:

Corrected wrong assertion in vmsvga3dDrawPrimitives that would trigger all the time both texture units were active. Copied some more code from the windows version that invalidates surfaces references in context in vmsvga3dSurfaceDestroy.

Location:
trunk/src/VBox/Devices/Graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp

    r54570 r54641  
    20992099            LogRelMax(16, ("vmsvgaFIFOGetCmdPayload: Invalid offNextCmd=%#x (offFifoMin=%#x offFifoMax=%#x)\n",
    21002100                           offNextCmd, offFifoMin, offFifoMax));
    2101             /** @todo release counter.   */
    21022101            cbAfter = offFifoMax - offCurrentCmd;
    21032102        }
     
    21142113            LogRelMax(16, ("vmsvgaFIFOGetCmdPayload: Invalid offNextCmd=%#x (offFifoMin=%#x offFifoMax=%#x)\n",
    21152114                           offNextCmd, offFifoMin, offFifoMax));
    2116             /** @todo release counter.   */
    21172115            cbBefore = 0;
    21182116        }
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r54639 r54641  
    25912591        Log(("vmsvga3dSurfaceDestroy id %x\n", sid));
    25922592
     2593#if 1 /* Windows is doing this, guess it makes sense here as well... */
     2594        /* Check all contexts if this surface is used as a render target or active texture. */
     2595        for (uint32_t cid = 0; cid < pState->cContexts; cid++)
     2596        {
     2597            PVMSVGA3DCONTEXT pContext = &pState->paContext[cid];
     2598            if (pContext->id == cid)
     2599            {
     2600                for (uint32_t i = 0; i < RT_ELEMENTS(pContext->aSidActiveTexture); i++)
     2601                    if (pContext->aSidActiveTexture[i] == sid)
     2602                        pContext->aSidActiveTexture[i] = SVGA3D_INVALID_ID;
     2603                if (pContext->sidRenderTarget == sid)
     2604                    pContext->sidRenderTarget = SVGA3D_INVALID_ID;
     2605            }
     2606        }
     2607#endif
     2608
    25932609        /* @todo stricter checks for associated context */
    25942610        uint32_t cid = pSurface->idAssociatedContext;
     
    55885604            if (pTextureState[i].value == SVGA3D_INVALID_ID)
    55895605            {
    5590                 Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x\n", pTextureState[i].stage, pTextureState[i].value));
     5606                Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x replacing=%x\n",
     5607                     pTextureState[i].stage, pTextureState[i].value, pContext->aSidActiveTexture[currentStage]));
    55915608
    55925609                pContext->aSidActiveTexture[currentStage] = SVGA3D_INVALID_ID;
     
    56075624                PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];
    56085625
    5609                 Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x (%d,%d)\n", pTextureState[i].stage, pTextureState[i].value, pSurface->pMipmapLevels[0].size.width, pSurface->pMipmapLevels[0].size.height));
     5626                Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x (%d,%d) replacing=%x\n",
     5627                     pTextureState[i].stage, pTextureState[i].value, pSurface->pMipmapLevels[0].size.width,
     5628                     pSurface->pMipmapLevels[0].size.height, pContext->aSidActiveTexture[currentStage]));
    56105629
    56115630                if (pSurface->oglId.texture == OPENGL_INVALID_ID)
     
    67356754
    67366755            glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTextureUnit);
     6756            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
    67376757            pState->ext.glActiveTexture(GL_TEXTURE0 + i);
     6758            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
    67386759
    67396760            glGetIntegerv(GL_TEXTURE_BINDING_2D, &activeTexture);
     6761            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
    67406762            pState->ext.glActiveTexture(activeTextureUnit);
    6741 
     6763            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
     6764
     6765# if 0 /* Aren't we checking whether 'activeTexture' on texture unit 'i' matches what we expected?  This works if only one unit is active, but if both are it _will_ fail for one of them. */
    67426766            if (pContext->aSidActiveTexture[activeTextureUnit - GL_TEXTURE0] != SVGA3D_INVALID_ID)
    67436767            {
     
    67476771                AssertMsg(pTexture->oglId.texture == (GLuint)activeTexture, ("%x vs %x unit %d - %d\n", pTexture->oglId.texture, activeTexture, i, activeTextureUnit - GL_TEXTURE0));
    67486772            }
     6773# else
     6774            PVMSVGA3DSURFACE pTexture = &pState->paSurface[pContext->aSidActiveTexture[i]];
     6775            AssertMsg(pTexture->id == pContext->aSidActiveTexture[i], ("%x vs %x\n", pTexture->id == pContext->aSidActiveTexture[i]));
     6776            AssertMsg(pTexture->oglId.texture == (GLuint)activeTexture,
     6777                      ("%x vs %x unit %d (active unit %d) sid=%x\n", pTexture->oglId.texture, activeTexture, i,
     6778                       activeTextureUnit - GL_TEXTURE0, pContext->aSidActiveTexture[i]));
     6779# endif
    67496780        }
    67506781    }
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