VirtualBox

Ignore:
Timestamp:
Oct 14, 2013 3:38:39 PM (11 years ago)
Author:
vboxsync
Message:

crOpenGL: fix hgcm fallback

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c

    r44529 r49088  
    19991999            {
    20002000                VBOXUHGSMI_BUFFER_TYPE_FLAGS Flags = {0};
    2001                 PVBOXUHGSMI_BUFFER pOldBuf = pClient->pHGBuffer;
     2001                PVBOXUHGSMI_BUFFER pNewBuf;
    20022002                CRASSERT(!pClient->pvHGBuffer);
    20032003                CRASSERT(cbWriteback>pClient->pHGBuffer->cbBuffer);
    20042004                crDebug("Reallocating host buffer from %d to %d bytes", conn->cbHostBufferAllocated, cbWriteback);
    20052005
    2006                 rc = pClient->pHgsmi->pfnBufferCreate(pClient->pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(cbWriteback), Flags, &pClient->pHGBuffer);
     2006                rc = pClient->pHgsmi->pfnBufferCreate(pClient->pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(cbWriteback), Flags, &pNewBuf);
    20072007                if (RT_SUCCESS(rc))
    20082008                {
    2009                     rc = pOldBuf->pfnDestroy(pOldBuf);
     2009                    rc = pClient->pHGBuffer->pfnDestroy(pClient->pHGBuffer);
    20102010                    CRASSERT(RT_SUCCESS(rc));
     2011
     2012                    pClient->pHGBuffer = pNewBuf;
    20112013
    20122014                    _crVBoxHGSMIReadExact(conn, pClient/*, cbWriteback*/);
     
    20152017                {
    20162018                    crWarning("_crVBoxHGSMIWriteReadExact: pfnBufferCreate(%d) failed!", CRVBOXHGSMI_PAGE_ALIGN(cbWriteback));
    2017                     crFree(conn->pHostBuffer);
    2018                     conn->cbHostBufferAllocated = cbWriteback;
    2019                     conn->pHostBuffer = crAlloc(conn->cbHostBufferAllocated);
     2019                    if (conn->cbHostBufferAllocated < cbWriteback)
     2020                    {
     2021                        crFree(conn->pHostBuffer);
     2022                        conn->cbHostBufferAllocated = cbWriteback;
     2023                        conn->pHostBuffer = crAlloc(conn->cbHostBufferAllocated);
     2024                    }
    20202025                    crVBoxHGCMReadExact(conn, NULL, cbWriteback);
    20212026                }
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