VirtualBox

Ignore:
Timestamp:
Sep 1, 2010 4:37:20 PM (14 years ago)
Author:
vboxsync
Message:

wine: shared render target support; wddm/d3d: aero multi-monitor fixes (still buggy)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/device.c

    r31868 r32184  
    935935}
    936936
    937 #ifdef VBOXWDDM
    938 HRESULT VBoxWineExD3DDev9CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,
     937static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,
    939938        D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface,
    940939        UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality
     940#ifdef VBOXWDDM
    941941        , HANDLE *shared_handle
    942942        , void *pvClientMem
     943#endif
    943944        )
    944945{
     
    960961
    961962    hr = surface_init(object, This, Width, Height, Format, Lockable, Discard,
    962             Level, Usage, Pool, MultiSample, MultisampleQuality,
    963             shared_handle, pvClientMem);
     963            Level, Usage, Pool, MultiSample, MultisampleQuality
     964#ifdef VBOXWDDM
     965            , shared_handle
     966            , pvClientMem
     967#endif
     968            );
    964969    if (FAILED(hr))
    965970    {
     
    973978
    974979    return D3D_OK;
    975 }
    976 #endif
    977 static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,
    978         D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface,
    979         UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality)
    980 {
    981 #ifdef VBOXWDDM
    982     return VBoxWineExD3DDev9CreateSurface(iface, Width, Height, Format, Lockable, Discard, Level, ppSurface,
    983             Usage, Pool, MultiSample, MultisampleQuality, NULL, NULL);
    984 #else
    985     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
    986     IDirect3DSurface9Impl *object;
    987     HRESULT hr;
    988 
    989     TRACE("iface %p, width %u, height %u, format %#x, lockable %#x, discard %#x, level %u, surface %p.\n"
    990             "usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n",
    991             iface, Width, Height, Format, Lockable, Discard, Level, ppSurface,
    992             Usage, Pool, MultiSample, MultisampleQuality);
    993 
    994     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface9Impl));
    995     if (!object)
    996     {
    997         FIXME("Failed to allocate surface memory.\n");
    998         return D3DERR_OUTOFVIDEOMEMORY;
    999     }
    1000 
    1001     hr = surface_init(object, This, Width, Height, Format, Lockable, Discard,
    1002             Level, Usage, Pool, MultiSample, MultisampleQuality);
    1003     if (FAILED(hr))
    1004     {
    1005         WARN("Failed to initialize surface, hr %#x.\n", hr);
    1006         HeapFree(GetProcessHeap(), 0, object);
    1007         return hr;
    1008     }
    1009 
    1010     TRACE("Created surface %p.\n", object);
    1011     *ppSurface = (IDirect3DSurface9 *)object;
    1012 
    1013     return D3D_OK;
    1014 #endif
    1015980}
    1016981
     
    1027992
    1028993    hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, Lockable, FALSE /* Discard */,
    1029             0 /* Level */, ppSurface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality);
     994            0 /* Level */, ppSurface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality
     995#ifdef VBOXWDDM
     996            , pSharedHandle
     997            , NULL
     998#endif
     999            );
    10301000
    10311001    return hr;
     
    10441014
    10451015    hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, Discard,
    1046             0 /* Level */, ppSurface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality);
     1016            0 /* Level */, ppSurface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality
     1017#ifdef VBOXWDDM
     1018            , pSharedHandle
     1019            , NULL
     1020#endif
     1021            );
    10471022
    10481023    return hr;
     
    11791154    hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, FALSE /* Discard */,
    11801155            0 /* Level */, ppSurface, 0 /* Usage (undefined/none) */, (WINED3DPOOL)Pool, D3DMULTISAMPLE_NONE,
    1181             0 /* MultisampleQuality */);
     1156            0 /* MultisampleQuality */
     1157#ifdef VBOXWDDM
     1158            , pSharedHandle
     1159            , NULL
     1160#endif
     1161            );
    11821162
    11831163    return hr;
     
    27562736        lockable = FALSE;
    27572737
    2758 #ifdef VBOXWDDM
    2759     hr = VBoxWineExD3DDev9CreateSurface((IDirect3DDevice9Ex *)This, width, height,
    2760             d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level,
    2761             (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */
    2762             , shared_handle
    2763             , pvClientMem
    2764             );
    2765 
    2766 #else
    27672738    hr = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)This, width, height,
    27682739            d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level,
    27692740            (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */
     2741#ifdef VBOXWDDM
     2742            , shared_handle
     2743            , pvClientMem
     2744#endif
    27702745            );
    2771 #endif
    27722746    if (FAILED(hr))
    27732747    {
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