VirtualBox

Ignore:
Timestamp:
Mar 7, 2012 12:44:46 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
76694
Message:

wddm/3d: shared resource destroy handling fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp

    r40125 r40388  
    31303130            if (RT_SUCCESS(rc))
    31313131            {
    3132                 rc = VbglR3Init();
    3133                 AssertRC(rc);
    3134                 if (RT_SUCCESS(rc))
     3132//                rc = VbglR3Init();
     3133//                AssertRC(rc);
     3134//                if (RT_SUCCESS(rc))
    31353135                {
    31363136                    HRESULT hr = vboxDispCmInit();
     
    31463146                        }
    31473147                    }
    3148                     VbglR3Term();
     3148//                    VbglR3Term();
    31493149                }
    31503150            }
     
    31693169                if (hr == S_OK)
    31703170                {
    3171                     VbglR3Term();
     3171//                    VbglR3Term();
    31723172                    /// @todo RTR3Term();
    31733173                    return TRUE;
     
    56725672        for (UINT i = 0; i < pRc->cAllocations; ++i)
    56735673        {
    5674             BOOL fSetDontDelete = FALSE;
     5674            BOOL fSetDelete = FALSE;
    56755675            PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[i];
    56765676            if (pAlloc->hSharedHandle)
    56775677            {
     5678                /* using one and the same shared resource by different clients could lead to the situation where one client can still refer to the resource
     5679                 * while another one has deleted it
     5680                 * this could lead to gl state corruption on both host and guest side.
     5681                 * This is why we take extra care to avoid it.
     5682                 * Until we do a vboxWddmShRcRefAlloc call below the resource is guarantied to be present, however it can be removed any time after the call
     5683                 * if cShRcRefs is non-zero, i.e. the current cliet is not the one deleting it.
     5684                 * We first explicitely say to wine that resource must NOT be accessed any more and that all references to it should be cleaned */
     5685                pAdapter->D3D.pfnVBoxWineExD3DRc9SetShRcState((IDirect3DResource9*)pAlloc->pD3DIf, VBOXWINEEX_SHRC_STATE_GL_DISABLE);
     5686
    56785687                DWORD cShRcRefs;
    56795688                HRESULT tmpHr = vboxWddmShRcRefAlloc(pDevice, pAlloc, FALSE, &cShRcRefs);
    5680                 if (cShRcRefs)
    5681                 {
    5682                     fSetDontDelete = TRUE;
     5689                if (!cShRcRefs)
     5690                {
     5691                    /* the current client IS the one deleting this resource */
     5692                    fSetDelete = TRUE;
    56835693                }
    56845694#ifdef DEBUG_misha
     
    56925702            }
    56935703
    5694             if (fSetDontDelete)
     5704            if (fSetDelete)
    56955705            {
    56965706                Assert(pAlloc->pD3DIf);
    5697                 pAdapter->D3D.pfnVBoxWineExD3DRc9SetDontDeleteGl((IDirect3DResource9*)pAlloc->pD3DIf);
     5707                pAdapter->D3D.pfnVBoxWineExD3DRc9SetShRcState((IDirect3DResource9*)pAlloc->pD3DIf, VBOXWINEEX_SHRC_STATE_GL_DELETE);
    56985708            }
    56995709
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