VirtualBox

Ignore:
Timestamp:
Sep 13, 2010 5:59:01 PM (14 years ago)
Author:
vboxsync
Message:

wddm/3d: wine multi-swapchain fixes

File:
1 edited

Legend:

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

    r32281 r32461  
    462462    return ret;
    463463}
    464 
     464#ifdef VBOXWDDM
     465static HRESULT IDirect3DDevice9Impl_DoCreateAdditionalSwapChain(IDirect3DDevice9Ex *iface,
     466        D3DPRESENT_PARAMETERS *present_parameters, IDirect3DSwapChain9 **swapchain)
     467#else
    465468static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_CreateAdditionalSwapChain(IDirect3DDevice9Ex *iface,
    466469        D3DPRESENT_PARAMETERS *present_parameters, IDirect3DSwapChain9 **swapchain)
     470#endif
    467471{
    468472    IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
     
    493497    return D3D_OK;
    494498}
     499
     500#ifdef VBOXWDDM
     501static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_CreateAdditionalSwapChain(IDirect3DDevice9Ex *iface,
     502        D3DPRESENT_PARAMETERS *present_parameters, IDirect3DSwapChain9 **swapchain)
     503{
     504    IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
     505    IDirect3DSwapChain9Impl *newSwapchain;
     506    HRESULT hr = IDirect3DDevice9Impl_DoCreateAdditionalSwapChain(iface, present_parameters, &newSwapchain);
     507    if (FAILED(hr))
     508    {
     509        ERR("Failed to create additional swapchain, hr %#x.\n", hr);
     510        return hr;
     511    }
     512
     513    /* add swapchain to the swapchain list */
     514    wined3d_mutex_lock();
     515    hr = IWineD3DDevice_AddSwapChain(This->WineD3DDevice, newSwapchain->wineD3DSwapChain);
     516    wined3d_mutex_unlock();
     517    if (FAILED(hr))
     518    {
     519        ERR("Failed to add additional swapchain, hr %#x.\n", hr);
     520        IUnknown_Release(newSwapchain);
     521        return hr;
     522    }
     523
     524    *swapchain = (IDirect3DSwapChain9 *)newSwapchain;
     525    return D3D_OK;
     526}
     527#endif
    495528
    496529static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data) {
     
    28982931    local_parameters.PresentationInterval = present_parameters->PresentationInterval;
    28992932
     2933#ifdef VBOXWDDM
     2934    hr = IDirect3DDevice9Impl_DoCreateAdditionalSwapChain((IDirect3DDevice9Ex *)This,
     2935            &local_parameters, (IDirect3DSwapChain9 **)&d3d_swapchain);
     2936#else
    29002937    hr = IDirect3DDevice9Impl_CreateAdditionalSwapChain((IDirect3DDevice9Ex *)This,
    29012938            &local_parameters, (IDirect3DSwapChain9 **)&d3d_swapchain);
     2939#endif
    29022940    if (FAILED(hr))
    29032941    {
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