VirtualBox

Ignore:
Timestamp:
Mar 16, 2015 2:38:46 PM (10 years ago)
Author:
vboxsync
Message:

VMSVGA3D: Check stage range.

File:
1 edited

Legend:

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

    r54785 r54786  
    61166116
    61176117        /* Active the right texture unit for subsequent texture state changes. */
    6118         if (pTextureState[i].stage != currentStage)
    6119         {
    6120             pState->ext.glActiveTexture(GL_TEXTURE0 + pTextureState[i].stage);
    6121             VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
    6122             currentStage = pTextureState[i].stage;
     6118        if (pTextureState[i].stage != currentStage || i == 0)
     6119        {
     6120            /** @todo Is this the appropriate limit for all kinds of textures?  It is the
     6121             * size of aSidActiveTexture and for binding/unbinding we cannot exceed it. */
     6122            if (pTextureState[i].stage < SVGA3D_MAX_TEXTURE_STAGE)
     6123            {
     6124                pState->ext.glActiveTexture(GL_TEXTURE0 + pTextureState[i].stage);
     6125                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     6126                currentStage = pTextureState[i].stage;
     6127            }
     6128            else
     6129            {
     6130                AssertMsgFailed(("pTextureState[%d].stage=%#x name=%#x\n", i, pTextureState[i].stage, pTextureState[i].name));
     6131                continue;
     6132            }
    61236133        }
    61246134
     
    61626172            {
    61636173                Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x replacing=%x\n",
    6164                      pTextureState[i].stage, pTextureState[i].value, pContext->aSidActiveTexture[currentStage]));
     6174                     currentStage, pTextureState[i].value, pContext->aSidActiveTexture[currentStage]));
    61656175
    61666176                pContext->aSidActiveTexture[currentStage] = SVGA3D_INVALID_ID;
     
    61826192
    61836193                Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x (%d,%d) replacing=%x\n",
    6184                      pTextureState[i].stage, pTextureState[i].value, pSurface->pMipmapLevels[0].size.width,
     6194                     currentStage, pTextureState[i].value, pSurface->pMipmapLevels[0].size.width,
    61856195                     pSurface->pMipmapLevels[0].size.height, pContext->aSidActiveTexture[currentStage]));
    61866196
     
    62646274            else
    62656275                val = vmsvga3dTextureFilter2OGL((SVGA3dTextureFilter)minFilter);
    6266 
    62676276            break;
    62686277        }
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