VirtualBox

Ignore:
Timestamp:
Oct 6, 2009 6:07:06 AM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: update to wine 1.1.30

File:
1 edited

Legend:

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

    r22496 r23571  
    7979
    8080    if (ref == 0) {
    81         EnterCriticalSection(&d3d9_cs);
     81        wined3d_mutex_lock();
    8282        IWineD3D_Release(This->WineD3D);
    83         LeaveCriticalSection(&d3d9_cs);
     83        wined3d_mutex_unlock();
     84
    8485        HeapFree(GetProcessHeap(), 0, This);
    8586    }
     
    9495    TRACE("(%p)->(%p)\n", This, pInitializeFunction);
    9596
    96     EnterCriticalSection(&d3d9_cs);
     97    wined3d_mutex_lock();
    9798    hr = IWineD3D_RegisterSoftwareDevice(This->WineD3D, pInitializeFunction);
    98     LeaveCriticalSection(&d3d9_cs);
     99    wined3d_mutex_unlock();
     100
    99101    return hr;
    100102}
     
    105107    TRACE("%p\n", This);
    106108
    107     EnterCriticalSection(&d3d9_cs);
     109    wined3d_mutex_lock();
    108110    hr = IWineD3D_GetAdapterCount(This->WineD3D);
    109     LeaveCriticalSection(&d3d9_cs);
     111    wined3d_mutex_unlock();
     112
    110113    return hr;
    111114}
     
    123126    adapter_id.device_name_size = sizeof(pIdentifier->DeviceName);
    124127
    125     EnterCriticalSection(&d3d9_cs);
     128    wined3d_mutex_lock();
    126129    hr = IWineD3D_GetAdapterIdentifier(This->WineD3D, Adapter, Flags, &adapter_id);
    127     LeaveCriticalSection(&d3d9_cs);
     130    wined3d_mutex_unlock();
    128131
    129132    pIdentifier->DriverVersion = adapter_id.driver_version;
     
    148151    }
    149152
    150     EnterCriticalSection(&d3d9_cs);
     153    wined3d_mutex_lock();
    151154    hr = IWineD3D_GetAdapterModeCount(This->WineD3D, Adapter, wined3dformat_from_d3dformat(Format));
    152     LeaveCriticalSection(&d3d9_cs);
     155    wined3d_mutex_unlock();
     156
    153157    return hr;
    154158}
     
    163167        return D3DERR_INVALIDCALL;
    164168
    165     EnterCriticalSection(&d3d9_cs);
     169    wined3d_mutex_lock();
    166170    hr = IWineD3D_EnumAdapterModes(This->WineD3D, Adapter, wined3dformat_from_d3dformat(Format),
    167171            Mode, (WINED3DDISPLAYMODE *) pMode);
    168     LeaveCriticalSection(&d3d9_cs);
     172    wined3d_mutex_unlock();
    169173
    170174    if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
     
    177181    HRESULT hr;
    178182
    179     EnterCriticalSection(&d3d9_cs);
     183    wined3d_mutex_lock();
    180184    hr = IWineD3D_GetAdapterDisplayMode(This->WineD3D, Adapter, (WINED3DDISPLAYMODE *) pMode);
    181     LeaveCriticalSection(&d3d9_cs);
     185    wined3d_mutex_unlock();
    182186
    183187    if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
     
    186190}
    187191
    188 static HRESULT WINAPI IDirect3D9Impl_CheckDeviceType(LPDIRECT3D9EX iface,
    189                                               UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat,
    190                                               D3DFORMAT BackBufferFormat, BOOL Windowed) {
     192static HRESULT WINAPI IDirect3D9Impl_CheckDeviceType(IDirect3D9Ex *iface, UINT Adapter,
     193        D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed)
     194{
    191195    IDirect3D9Impl *This = (IDirect3D9Impl *)iface;
    192196    HRESULT hr;
     
    194198          BackBufferFormat, Windowed ? "true" : "false");
    195199
    196     EnterCriticalSection(&d3d9_cs);
     200    wined3d_mutex_lock();
    197201    hr = IWineD3D_CheckDeviceType(This->WineD3D, Adapter, CheckType, wined3dformat_from_d3dformat(DisplayFormat),
    198202            wined3dformat_from_d3dformat(BackBufferFormat), Windowed);
    199     LeaveCriticalSection(&d3d9_cs);
    200     return hr;
    201 }
    202 
    203 static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9EX iface,
    204                                                   UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
    205                                                   DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) {
     203    wined3d_mutex_unlock();
     204
     205    return hr;
     206}
     207
     208static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(IDirect3D9Ex *iface, UINT Adapter, D3DDEVTYPE DeviceType,
     209        D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat)
     210{
    206211    IDirect3D9Impl *This = (IDirect3D9Impl *)iface;
    207212    HRESULT hr;
     
    232237    }
    233238
    234     EnterCriticalSection(&d3d9_cs);
     239    wined3d_mutex_lock();
    235240    hr = IWineD3D_CheckDeviceFormat(This->WineD3D, Adapter, DeviceType, wined3dformat_from_d3dformat(AdapterFormat),
    236241            Usage, WineD3DRType, wined3dformat_from_d3dformat(CheckFormat), SURFACE_OPENGL);
    237     LeaveCriticalSection(&d3d9_cs);
    238     return hr;
    239 }
    240 
    241 static HRESULT WINAPI IDirect3D9Impl_CheckDeviceMultiSampleType(LPDIRECT3D9EX iface,
    242                                                            UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat,
    243                                                            BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) {
     242    wined3d_mutex_unlock();
     243
     244    return hr;
     245}
     246
     247static HRESULT WINAPI IDirect3D9Impl_CheckDeviceMultiSampleType(IDirect3D9Ex *iface, UINT Adapter,
     248        D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType,
     249        DWORD *pQualityLevels)
     250{
    244251    IDirect3D9Impl *This = (IDirect3D9Impl *)iface;
    245252    HRESULT hr;
    246253    TRACE("%p\n", This);
    247254
    248     EnterCriticalSection(&d3d9_cs);
     255    wined3d_mutex_lock();
    249256    hr = IWineD3D_CheckDeviceMultiSampleType(This->WineD3D, Adapter, DeviceType,
    250257            wined3dformat_from_d3dformat(SurfaceFormat), Windowed, MultiSampleType, pQualityLevels);
    251     LeaveCriticalSection(&d3d9_cs);
    252     return hr;
    253 }
    254 
    255 static HRESULT WINAPI IDirect3D9Impl_CheckDepthStencilMatch(LPDIRECT3D9EX iface,
    256                                                        UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
    257                                                        D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) {
     258    wined3d_mutex_unlock();
     259
     260    return hr;
     261}
     262
     263static HRESULT WINAPI IDirect3D9Impl_CheckDepthStencilMatch(IDirect3D9Ex *iface, UINT Adapter,
     264        D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat)
     265{
    258266    IDirect3D9Impl *This = (IDirect3D9Impl *)iface;
    259267    HRESULT hr;
    260268    TRACE("%p\n", This);
    261269
    262     EnterCriticalSection(&d3d9_cs);
     270    wined3d_mutex_lock();
    263271    hr = IWineD3D_CheckDepthStencilMatch(This->WineD3D, Adapter, DeviceType,
    264272            wined3dformat_from_d3dformat(AdapterFormat), wined3dformat_from_d3dformat(RenderTargetFormat),
    265273            wined3dformat_from_d3dformat(DepthStencilFormat));
    266     LeaveCriticalSection(&d3d9_cs);
     274    wined3d_mutex_unlock();
     275
    267276    return hr;
    268277}
     
    273282    TRACE("%p\n", This);
    274283
    275     EnterCriticalSection(&d3d9_cs);
     284    wined3d_mutex_lock();
    276285    hr = IWineD3D_CheckDeviceFormatConversion(This->WineD3D, Adapter, DeviceType,
    277286            wined3dformat_from_d3dformat(SourceFormat), wined3dformat_from_d3dformat(TargetFormat));
    278     LeaveCriticalSection(&d3d9_cs);
     287    wined3d_mutex_unlock();
     288
    279289    return hr;
    280290}
     
    337347
    338348    pCaps->MaxVertexShaderConst = min(D3D9_MAX_VERTEX_SHADER_CONSTANTF, pCaps->MaxVertexShaderConst);
     349    pCaps->NumSimultaneousRTs = min(D3D9_MAX_SIMULTANEOUS_RENDERTARGETS, pCaps->NumSimultaneousRTs);
    339350}
    340351
     
    354365    }
    355366    memset(pCaps, 0, sizeof(*pCaps));
    356     EnterCriticalSection(&d3d9_cs);
     367
     368    wined3d_mutex_lock();
    357369    hrc = IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, pWineCaps);
    358     LeaveCriticalSection(&d3d9_cs);
     370    wined3d_mutex_unlock();
     371
    359372    WINECAPSTOD3D9CAPS(pCaps, pWineCaps)
    360373    HeapFree(GetProcessHeap(), 0, pWineCaps);
     
    374387    TRACE("%p\n", This);
    375388
    376     EnterCriticalSection(&d3d9_cs);
     389    wined3d_mutex_lock();
    377390    ret = IWineD3D_GetAdapterMonitor(This->WineD3D, Adapter);
    378     LeaveCriticalSection(&d3d9_cs);
     391    wined3d_mutex_unlock();
     392
    379393    return ret;
    380 }
    381 
    382 ULONG WINAPI D3D9CB_DestroyRenderTarget(IWineD3DSurface *pSurface) {
    383     IDirect3DSurface9Impl* surfaceParent;
    384     TRACE("(%p) call back\n", pSurface);
    385 
    386     IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
    387     surfaceParent->isImplicit = FALSE;
    388     /* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
    389     return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent);
    390394}
    391395
     
    398402    /* Swap chain had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
    399403    return IDirect3DSwapChain9_Release((IDirect3DSwapChain9*) swapChainParent);
    400 }
    401 
    402 ULONG WINAPI D3D9CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) {
    403     IDirect3DSurface9Impl* surfaceParent;
    404     TRACE("(%p) call back\n", pSurface);
    405 
    406     IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
    407     surfaceParent->isImplicit = FALSE;
    408     /* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
    409     return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent);
    410404}
    411405
     
    442436
    443437    /* Allocate an associated WineD3DDevice object */
    444     EnterCriticalSection(&d3d9_cs);
     438    wined3d_mutex_lock();
    445439    hr = IWineD3D_CreateDevice(This->WineD3D, Adapter, DeviceType, hFocusWindow, BehaviourFlags,
    446440            (IUnknown *)object, (IWineD3DDeviceParent *)&object->device_parent_vtbl, &object->WineD3DDevice);
     
    448442        HeapFree(GetProcessHeap(), 0, object);
    449443        *ppReturnedDeviceInterface = NULL;
    450         LeaveCriticalSection(&d3d9_cs);
     444        wined3d_mutex_unlock();
     445
    451446        return hr;
    452447    }
     
    516511     */
    517512    object->convertedDecls = HeapAlloc(GetProcessHeap(), 0, 0);
    518     LeaveCriticalSection(&d3d9_cs);
     513    wined3d_mutex_unlock();
    519514
    520515    return hr;
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