VirtualBox

Changeset 54771 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
Mar 16, 2015 1:13:47 AM (10 years ago)
Author:
vboxsync
Message:

vmsvga3dCreateTexture/ogl: Initializing the texture memory even in the non-dirty case seems to cure the texture corruption issues. It is also an good idea to not let the guest have access to uninitialized host video memory.

File:
1 edited

Legend:

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

    r54766 r54771  
    30853085    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
    30863086
     3087    /* Set the unpacking parameters. */
     3088    VMSVGAPACKPARAMS SavedParams;
     3089    vmsvga3dSetUnpackParams(pState, pContext, pSurface, &SavedParams);
     3090
    30873091    if (pSurface->fDirty)
    30883092    {
    3089         /* Set the unacpking parameters. */
    3090         VMSVGAPACKPARAMS SavedParams;
    3091         vmsvga3dSetUnpackParams(pState, pContext, pSurface, &SavedParams);
    3092 
    30933093        Log(("vmsvga3dCreateTexture: sync dirty texture\n"));
    30943094        for (uint32_t i = 0; i < pSurface->faces[0].numMipLevels; i++)
    30953095        {
    3096             if (pSurface->pMipmapLevels[i].fDirty)
     3096            /* Paranoia: Always do level 0 here to mirror the non-dirty case. */
     3097            if (pSurface->pMipmapLevels[i].fDirty || i == 0)
    30973098            {
    3098                 Log(("vmsvga3dCreateTexture: sync dirty texture mipmap level %d (pitch %x)\n", i, pSurface->pMipmapLevels[i].cbSurfacePitch));
     3099                if (pSurface->pMipmapLevels[i].fDirty)
     3100                    Log(("vmsvga3dCreateTexture: sync dirty texture mipmap level %d (pitch %x)\n", i, pSurface->pMipmapLevels[i].cbSurfacePitch));
    30993101
    31003102                glTexImage2D(GL_TEXTURE_2D,
     
    31143116        }
    31153117        pSurface->fDirty = false;
    3116 
    3117         /* Restore packing parameters. */
    3118         vmsvga3dRestoreUnpackParams(pState, pContext, pSurface, &SavedParams);
    31193118    }
    31203119    else
    31213120    {
    3122         /* Reserve texture memory. */
     3121        /* Allocate and initialize texture memory.  (Passing the zero filled pSurfaceData solves
     3122           the fedora 21 corruption issues (launchpad, background, search field, login).) */
    31233123        glTexImage2D(GL_TEXTURE_2D,
    31243124                     0,
     
    31293129                     pSurface->formatGL,
    31303130                     pSurface->typeGL,
    3131                      NULL);
     3131                     pSurface->pMipmapLevels[0].pSurfaceData);
    31323132        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
    31333133    }
     3134
     3135    /* Restore unpacking parameters. */
     3136    vmsvga3dRestoreUnpackParams(pState, pContext, pSurface, &SavedParams);
    31343137
    31353138    /* Restore the old active texture. */
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