VirtualBox

Ignore:
Timestamp:
May 9, 2023 5:28:22 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
157233
Message:

Devices/Graphics: common code for 3D backend initialization and termination. bugref:9830

File:
1 edited

Legend:

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

    r98103 r99688  
    201201    RT_NOREF(pDevIns, pThis);
    202202
    203     PVMSVGA3DSTATE pState;
    204     pThisCC->svga.p3dState = pState = (PVMSVGA3DSTATE)RTMemAllocZ(sizeof(VMSVGA3DSTATE));
    205     AssertReturn(pThisCC->svga.p3dState, VERR_NO_MEMORY);
     203    PVMSVGA3DSTATE pState = pThisCC->svga.p3dState;
    206204
    207205    /* Create event semaphore. */
     
    311309static DECLCALLBACK(int) vmsvga3dBackReset(PVGASTATECC pThisCC)
    312310{
     311    RT_NOREF(pThisCC);
     312    return VINF_SUCCESS;
     313}
     314
     315static DECLCALLBACK(int) vmsvga3dBackTerminate(PVGASTATECC pThisCC)
     316{
    313317    PVMSVGA3DSTATE pState = pThisCC->svga.p3dState;
    314318    AssertReturn(pThisCC->svga.p3dState, VERR_NO_MEMORY);
    315319
    316     /* Destroy all leftover surfaces. */
    317     for (uint32_t i = 0; i < pState->cSurfaces; i++)
    318     {
    319         if (pState->papSurfaces[i]->id != SVGA3D_INVALID_ID)
    320             vmsvga3dSurfaceDestroy(pThisCC, pState->papSurfaces[i]->id);
    321     }
    322 
    323     /* Destroy all leftover contexts. */
    324     for (uint32_t i = 0; i < pState->cContexts; i++)
    325     {
    326         if (pState->papContexts[i]->id != SVGA3D_INVALID_ID)
    327             vmsvga3dBackContextDestroy(pThisCC, pState->papContexts[i]->id);
    328     }
    329     return VINF_SUCCESS;
    330 }
    331 
    332 static DECLCALLBACK(int) vmsvga3dBackTerminate(PVGASTATECC pThisCC)
    333 {
    334     PVMSVGA3DSTATE pState = pThisCC->svga.p3dState;
    335     AssertReturn(pThisCC->svga.p3dState, VERR_NO_MEMORY);
    336 
    337     int rc = vmsvga3dBackReset(pThisCC);
    338     AssertRCReturn(rc, rc);
    339 
    340320    /* Terminate the window creation thread. */
    341     rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_EXIT, 0, 0);
     321    int rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_EXIT, 0, 0);
    342322    AssertRCReturn(rc, rc);
    343323
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