VirtualBox

Changeset 32501 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Sep 15, 2010 8:51:16 AM (14 years ago)
Author:
vboxsync
Message:

wddm/3d: multiswapchain fixes

Location:
trunk/src/VBox/Additions/WINNT/Graphics
Files:
3 edited

Legend:

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

    r32496 r32501  
    13991399//    Buf.SwapchainInfo.SwapchainInfo.u32Reserved;
    14001400    Buf.SwapchainInfo.SwapchainInfo.cAllocs = pSwapchain->cRTs;
     1401    UINT cAllocsKm = 0;
    14011402    for (UINT i = 0; i < Buf.SwapchainInfo.SwapchainInfo.cAllocs; ++i)
    14021403    {
    1403         Assert(pSwapchain->aRTs[i].pAlloc->hAllocation);
     1404//        Assert(pSwapchain->aRTs[i].pAlloc->hAllocation);
    14041405        Buf.SwapchainInfo.SwapchainInfo.ahAllocs[i] = pSwapchain->aRTs[i].pAlloc->hAllocation;
    1405     }
    1406 
    1407     D3DDDICB_ESCAPE DdiEscape = {0};
    1408     DdiEscape.hContext = pDevice->DefaultContext.ContextInfo.hContext;
    1409     DdiEscape.hDevice = pDevice->hDevice;
    1410 //    DdiEscape.Flags.Value = 0;
    1411     DdiEscape.pPrivateDriverData = &Buf.SwapchainInfo;
    1412     DdiEscape.PrivateDriverDataSize = RT_OFFSETOF(VBOXDISPIFESCAPE_SWAPCHAININFO, SwapchainInfo.ahAllocs[Buf.SwapchainInfo.SwapchainInfo.cAllocs]);
    1413     HRESULT hr = pDevice->RtCallbacks.pfnEscapeCb(pDevice->pAdapter->hAdapter, &DdiEscape);
    1414     Assert(hr == S_OK);
    1415     if (hr == S_OK)
    1416     {
    1417         pSwapchain->hSwapchainKm = Buf.SwapchainInfo.SwapchainInfo.hSwapchainKm;
    1418     }
    1419 
    1420     return hr;
     1406        if (Buf.SwapchainInfo.SwapchainInfo.ahAllocs[i])
     1407            ++cAllocsKm;
     1408    }
     1409
     1410    Assert(cAllocsKm == Buf.SwapchainInfo.SwapchainInfo.cAllocs || !cAllocsKm);
     1411
     1412    if (cAllocsKm)
     1413    {
     1414        D3DDDICB_ESCAPE DdiEscape = {0};
     1415        DdiEscape.hContext = pDevice->DefaultContext.ContextInfo.hContext;
     1416        DdiEscape.hDevice = pDevice->hDevice;
     1417    //    DdiEscape.Flags.Value = 0;
     1418        DdiEscape.pPrivateDriverData = &Buf.SwapchainInfo;
     1419        DdiEscape.PrivateDriverDataSize = RT_OFFSETOF(VBOXDISPIFESCAPE_SWAPCHAININFO, SwapchainInfo.ahAllocs[Buf.SwapchainInfo.SwapchainInfo.cAllocs]);
     1420        HRESULT hr = pDevice->RtCallbacks.pfnEscapeCb(pDevice->pAdapter->hAdapter, &DdiEscape);
     1421        Assert(hr == S_OK);
     1422        if (hr == S_OK)
     1423        {
     1424            pSwapchain->hSwapchainKm = Buf.SwapchainInfo.SwapchainInfo.hSwapchainKm;
     1425        }
     1426
     1427        return hr;
     1428    }
     1429    return S_OK;
    14211430}
    14221431
     
    17381747    if (!pSwapchain)
    17391748    {
    1740         Assert(0);
     1749//        Assert(0);
    17411750        /* first search for the swapchain the alloc might be added to */
    17421751        PVBOXWDDMDISP_SWAPCHAIN pCur = RTListNodeGetFirst(&pDevice->SwapchainList, VBOXWDDMDISP_SWAPCHAIN, ListEntry);
     
    18981907    /* preserve the old one */
    18991908    IDirect3DSwapChain9 * pOldIf = pSwapchain->pSwapChainIf;
    1900     HWND hOldWnd = pSwapchain->hWnd;
    19011909    /* first create the new one */
    19021910    D3DPRESENT_PARAMETERS Params;
     
    19061914    PVBOXWDDMDISP_ADAPTER pAdapter = pDevice->pAdapter;
    19071915    UINT cSurfs = pSwapchain->cRTs;
    1908     HRESULT hr;
    1909     HWND hWnd = NULL;
     1916    HRESULT hr = S_OK;
    19101917    IDirect3DDevice9 *pDevice9If = NULL;
    1911     hr = VBoxDispWndCreate(pAdapter, Params.BackBufferWidth, Params.BackBufferHeight, &hWnd);
    1912     Assert(hr == S_OK);
     1918    HWND hOldWnd = pSwapchain->hWnd;
     1919#ifndef VBOXDISP_NEWWND_ON_SWAPCHAINUPDATE
     1920    if (!hOldWnd)
     1921#endif
     1922    {
     1923        hr = VBoxDispWndCreate(pAdapter, Params.BackBufferWidth, Params.BackBufferHeight, &pSwapchain->hWnd);
     1924        Assert(hr == S_OK);
     1925    }
    19131926    if (hr == S_OK)
    19141927    {
    1915         pSwapchain->hWnd = hWnd;
    19161928        DWORD fFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING;
    19171929        if (pDevice->fFlags.AllowMultithreading)
    19181930            fFlags |= D3DCREATE_MULTITHREADED;
    19191931
    1920         Params.hDeviceWindow = hWnd;
     1932        Params.hDeviceWindow = pSwapchain->hWnd;
    19211933                    /* @todo: it seems there should be a way to detect this correctly since
    19221934                     * our vboxWddmDDevSetDisplayMode will be called in case we are using full-screen */
     
    19291941        if (!pDevice->pDevice9If)
    19301942        {
    1931             hr = pAdapter->pD3D9If->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, fFlags, &Params, &pDevice9If);
     1943            hr = pAdapter->pD3D9If->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, pSwapchain->hWnd, fFlags, &Params, &pDevice9If);
    19321944            Assert(hr == S_OK);
    19331945            if (hr == S_OK)
     
    20142026                            Assert(hOldWnd);
    20152027                            pOldIf->Release();
     2028#ifdef VBOXDISP_NEWWND_ON_SWAPCHAINUPDATE
    20162029                            VBoxDispWndDestroy(pAdapter, hOldWnd);
     2030#endif
    20172031                        }
    20182032                        else
     
    20292043
    20302044        Assert(hr != S_OK);
    2031 
    2032         HRESULT tmpHr = VBoxDispWndDestroy(pAdapter, hWnd);
    2033         Assert(tmpHr == S_OK);
    2034         pSwapchain->hWnd = hOldWnd;
     2045#ifndef VBOXDISP_NEWWND_ON_SWAPCHAINUPDATE
     2046        if (!hOldWnd)
     2047#endif
     2048        {
     2049            HRESULT tmpHr = VBoxDispWndDestroy(pAdapter, pSwapchain->hWnd);
     2050            Assert(tmpHr == S_OK);
     2051            pSwapchain->hWnd = hOldWnd;
     2052        }
    20352053    }
    20362054
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.cpp

    r32496 r32501  
    7575        {
    7676            pTbl->paData[i] = pvData;
     77            ++pTbl->cData;
     78            Assert(pTbl->cData <= pTbl->cSize);
    7779            ++pTbl->iNext2Search;
    7880            pTbl->iNext2Search %= pTbl->cSize;
     
    9294        PVOID pvData = pTbl->paData[iIndex];
    9395        pTbl->paData[iIndex] = NULL;
     96        --pTbl->cData;
     97        Assert(pTbl->cData <= pTbl->cSize);
    9498        pTbl->iNext2Search = iIndex;
    9599        return pvData;
     
    449453    {
    450454        vboxWddmSwapchainDestroy(pDevExt, pSwapchain);
     455        pSwapchainInfo->SwapchainInfo.hSwapchainKm = 0;
    451456    }
    452457
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/context.c

    r32461 r32501  
    16011601    struct wined3d_context *context = NULL;
    16021602
    1603     Assert(0);
     1603//    Assert(0);
    16041604
    16051605    for(i = 0 ; i < swapchains ; i ++)
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