VirtualBox

Ignore:
Timestamp:
Jan 21, 2010 9:26:23 AM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: update to wine 1.1.36 and disable unnecessary fbo state poll

File:
1 edited

Legend:

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

    r23571 r25949  
    8484        case WINED3DFMT_D32_UNORM: return D3DFMT_D32;
    8585        case WINED3DFMT_S1_UINT_D15_UNORM: return D3DFMT_D15S1;
    86         case WINED3DFMT_S8_UINT_D24_UNORM: return D3DFMT_D24S8;
     86        case WINED3DFMT_D24_UNORM_S8_UINT: return D3DFMT_D24S8;
    8787        case WINED3DFMT_X8D24_UNORM: return D3DFMT_D24X8;
    8888        case WINED3DFMT_S4X4_UINT_D24_UNORM: return D3DFMT_D24X4S4;
     
    135135        case D3DFMT_D32: return WINED3DFMT_D32_UNORM;
    136136        case D3DFMT_D15S1: return WINED3DFMT_S1_UINT_D15_UNORM;
    137         case D3DFMT_D24S8: return WINED3DFMT_S8_UINT_D24_UNORM;
     137        case D3DFMT_D24S8: return WINED3DFMT_D24_UNORM_S8_UINT;
    138138        case D3DFMT_D24X8: return WINED3DFMT_X8D24_UNORM;
    139139        case D3DFMT_D24X4S4: return WINED3DFMT_S4X4_UINT_D24_UNORM;
     
    263263}
    264264
     265static ULONG WINAPI D3D8CB_DestroySwapChain(IWineD3DSwapChain *swapchain)
     266{
     267    IUnknown *parent;
     268
     269    TRACE("swapchain %p.\n", swapchain);
     270
     271    IWineD3DSwapChain_GetParent(swapchain, &parent);
     272    IUnknown_Release(parent);
     273    return IUnknown_Release(parent);
     274}
     275
    265276/* IDirect3D IUnknown parts follow: */
    266277static HRESULT WINAPI IDirect3DDevice8Impl_QueryInterface(LPDIRECT3DDEVICE8 iface,REFIID riid,LPVOID *ppobj)
    267278{
    268279    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
     280
     281    TRACE("iface %p, riid %s, object %p.\n",
     282            iface, debugstr_guid(riid), ppobj);
    269283
    270284    if (IsEqualGUID(riid, &IID_IUnknown)
     
    291305    ULONG ref = InterlockedIncrement(&This->ref);
    292306
    293     TRACE("(%p) : AddRef from %d\n", This, ref - 1);
     307    TRACE("%p increasing refcount to %u.\n", iface, ref);
    294308
    295309    return ref;
     
    303317    ref = InterlockedDecrement(&This->ref);
    304318
    305     TRACE("(%p) : ReleaseRef to %d\n", This, ref);
     319    TRACE("%p decreasing refcount to %u.\n", iface, ref);
    306320
    307321    if (ref == 0) {
     
    330344
    331345/* IDirect3DDevice Interface follow: */
    332 static HRESULT WINAPI IDirect3DDevice8Impl_TestCooperativeLevel(LPDIRECT3DDEVICE8 iface) {
    333     IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    334     HRESULT hr;
    335 
    336     TRACE("(%p) : Relay\n", This);
    337 
    338     wined3d_mutex_lock();
    339     hr = IWineD3DDevice_TestCooperativeLevel(This->WineD3DDevice);
    340     wined3d_mutex_unlock();
    341 
    342     return hr;
     346static HRESULT WINAPI IDirect3DDevice8Impl_TestCooperativeLevel(IDirect3DDevice8 *iface)
     347{
     348    TRACE("iface %p.\n", iface);
     349
     350    return D3D_OK;
    343351}
    344352
     
    347355    HRESULT hr;
    348356
    349     TRACE("(%p) Relay\n", This);
     357    TRACE("iface %p.\n", iface);
    350358
    351359    wined3d_mutex_lock();
     
    360368    HRESULT hr;
    361369
    362     TRACE("(%p) : Relay bytes(%d)\n", This, Bytes);
     370    TRACE("iface %p, byte_count %u.\n", iface, Bytes);
     371    FIXME("Byte count ignored.\n");
    363372
    364373    wined3d_mutex_lock();
     
    374383    IWineD3D* pWineD3D;
    375384
    376     TRACE("(%p) Relay\n", This);
     385    TRACE("iface %p, d3d8 %p.\n", iface, ppD3D8);
    377386
    378387    if (NULL == ppD3D8) {
     
    402411    WINED3DCAPS *pWineCaps;
    403412
    404     TRACE("(%p) : Relay pCaps %p\n", This, pCaps);
     413    TRACE("iface %p, caps %p.\n", iface, pCaps);
     414
    405415    if(NULL == pCaps){
    406416        return D3DERR_INVALIDCALL;
     
    426436    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    427437    HRESULT hr;
    428     TRACE("(%p) Relay\n", This);
     438
     439    TRACE("iface %p, mode %p.\n", iface, pMode);
    429440
    430441    wined3d_mutex_lock();
     
    440451    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    441452    HRESULT hr;
    442     TRACE("(%p) Relay\n", This);
     453
     454    TRACE("iface %p, parameters %p.\n", iface, pParameters);
    443455
    444456    wined3d_mutex_lock();
     
    453465    IDirect3DSurface8Impl *pSurface = (IDirect3DSurface8Impl*)pCursorBitmap;
    454466    HRESULT hr;
    455     TRACE("(%p) Relay\n", This);
     467
     468    TRACE("iface %p, hotspot_x %u, hotspot_y %u, bitmap %p.\n",
     469            iface, XHotSpot, YHotSpot, pCursorBitmap);
     470
    456471    if(!pCursorBitmap) {
    457472        WARN("No cursor bitmap, returning WINED3DERR_INVALIDCALL\n");
     
    468483static void WINAPI IDirect3DDevice8Impl_SetCursorPosition(LPDIRECT3DDEVICE8 iface, UINT XScreenSpace, UINT YScreenSpace, DWORD Flags) {
    469484    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    470     TRACE("(%p) Relay\n", This);
     485
     486    TRACE("iface %p, x %u, y %u, flags %#x.\n",
     487            iface, XScreenSpace, YScreenSpace, Flags);
    471488
    472489    wined3d_mutex_lock();
     
    478495    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    479496    BOOL ret;
    480     TRACE("(%p) Relay\n", This);
     497
     498    TRACE("iface %p, show %#x.\n", iface, bShow);
    481499
    482500    wined3d_mutex_lock();
     
    487505}
    488506
    489 static HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain8** pSwapChain) {
    490     IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    491     IDirect3DSwapChain8Impl* object;
    492     HRESULT hrc = D3D_OK;
     507static HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(IDirect3DDevice8 *iface,
     508        D3DPRESENT_PARAMETERS *present_parameters, IDirect3DSwapChain8 **swapchain)
     509{
     510    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
     511    IDirect3DSwapChain8Impl *object;
     512    HRESULT hr;
     513
     514    TRACE("iface %p, present_parameters %p, swapchain %p.\n",
     515            iface, present_parameters, swapchain);
     516
     517    object = HeapAlloc(GetProcessHeap(),  HEAP_ZERO_MEMORY, sizeof(*object));
     518    if (!object)
     519    {
     520        ERR("Failed to allocate swapchain memory.\n");
     521        return E_OUTOFMEMORY;
     522    }
     523
     524    hr = swapchain_init(object, This, present_parameters);
     525    if (FAILED(hr))
     526    {
     527        WARN("Failed to initialize swapchain, hr %#x.\n", hr);
     528        HeapFree(GetProcessHeap(), 0, object);
     529        return hr;
     530    }
     531
     532    TRACE("Created swapchain %p.\n", object);
     533    *swapchain = (IDirect3DSwapChain8 *)object;
     534
     535    return D3D_OK;
     536}
     537
     538static HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) {
     539    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    493540    WINED3DPRESENT_PARAMETERS localParameters;
    494 
    495     TRACE("(%p) Relay\n", This);
    496 
    497     /* Fix the back buffer count */
    498     if(pPresentationParameters->BackBufferCount == 0) {
    499         pPresentationParameters->BackBufferCount = 1;
    500     }
    501 
    502     object = HeapAlloc(GetProcessHeap(),  HEAP_ZERO_MEMORY, sizeof(*object));
    503     if (NULL == object) {
    504         FIXME("Allocation of memory failed\n");
    505         *pSwapChain = NULL;
    506         return D3DERR_OUTOFVIDEOMEMORY;
    507     }
    508     object->ref = 1;
    509     object->lpVtbl = &Direct3DSwapChain8_Vtbl;
    510 
    511     /* Allocate an associated WineD3DDevice object */
     541    HRESULT hr;
     542
     543    TRACE("iface %p, present_parameters %p.\n", iface, pPresentationParameters);
     544
    512545    localParameters.BackBufferWidth                             = pPresentationParameters->BackBufferWidth;
    513546    localParameters.BackBufferHeight                            = pPresentationParameters->BackBufferHeight;
     
    527560
    528561    wined3d_mutex_lock();
    529     hrc = IWineD3DDevice_CreateSwapChain(This->WineD3DDevice, &localParameters,
    530             &object->wineD3DSwapChain, (IUnknown *)object, SURFACE_OPENGL);
     562    hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters);
     563    if(SUCCEEDED(hr)) {
     564        hr = IWineD3DDevice_SetRenderState(This->WineD3DDevice, WINED3DRS_POINTSIZE_MIN, 0);
     565    }
    531566    wined3d_mutex_unlock();
    532567
     
    545580    pPresentationParameters->FullScreen_PresentationInterval    = localParameters.PresentationInterval;
    546581
    547     if (hrc != D3D_OK) {
    548         FIXME("(%p) call to IWineD3DDevice_CreateSwapChain failed\n", This);
    549         HeapFree(GetProcessHeap(), 0 , object);
    550         *pSwapChain = NULL;
    551     }else{
    552         IUnknown_AddRef(iface);
    553         object->parentDevice = iface;
    554         *pSwapChain = (IDirect3DSwapChain8 *)object;
    555     }
    556     TRACE("(%p) returning %p\n", This, *pSwapChain);
    557     return hrc;
    558 }
    559 
    560 static HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) {
    561     IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    562     WINED3DPRESENT_PARAMETERS localParameters;
    563     HRESULT hr;
    564 
    565     TRACE("(%p) Relay pPresentationParameters(%p)\n", This, pPresentationParameters);
    566 
    567     localParameters.BackBufferWidth                             = pPresentationParameters->BackBufferWidth;
    568     localParameters.BackBufferHeight                            = pPresentationParameters->BackBufferHeight;
    569     localParameters.BackBufferFormat                            = wined3dformat_from_d3dformat(pPresentationParameters->BackBufferFormat);
    570     localParameters.BackBufferCount                             = pPresentationParameters->BackBufferCount;
    571     localParameters.MultiSampleType                             = pPresentationParameters->MultiSampleType;
    572     localParameters.MultiSampleQuality                          = 0; /* d3d9 only */
    573     localParameters.SwapEffect                                  = pPresentationParameters->SwapEffect;
    574     localParameters.hDeviceWindow                               = pPresentationParameters->hDeviceWindow;
    575     localParameters.Windowed                                    = pPresentationParameters->Windowed;
    576     localParameters.EnableAutoDepthStencil                      = pPresentationParameters->EnableAutoDepthStencil;
    577     localParameters.AutoDepthStencilFormat                      = wined3dformat_from_d3dformat(pPresentationParameters->AutoDepthStencilFormat);
    578     localParameters.Flags                                       = pPresentationParameters->Flags;
    579     localParameters.FullScreen_RefreshRateInHz                  = pPresentationParameters->FullScreen_RefreshRateInHz;
    580     localParameters.PresentationInterval                        = pPresentationParameters->FullScreen_PresentationInterval;
    581     localParameters.AutoRestoreDisplayMode                      = TRUE;
    582 
    583     wined3d_mutex_lock();
    584     hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters);
    585     wined3d_mutex_unlock();
    586 
    587     pPresentationParameters->BackBufferWidth                    = localParameters.BackBufferWidth;
    588     pPresentationParameters->BackBufferHeight                   = localParameters.BackBufferHeight;
    589     pPresentationParameters->BackBufferFormat                   = d3dformat_from_wined3dformat(localParameters.BackBufferFormat);
    590     pPresentationParameters->BackBufferCount                    = localParameters.BackBufferCount;
    591     pPresentationParameters->MultiSampleType                    = localParameters.MultiSampleType;
    592     pPresentationParameters->SwapEffect                         = localParameters.SwapEffect;
    593     pPresentationParameters->hDeviceWindow                      = localParameters.hDeviceWindow;
    594     pPresentationParameters->Windowed                           = localParameters.Windowed;
    595     pPresentationParameters->EnableAutoDepthStencil             = localParameters.EnableAutoDepthStencil;
    596     pPresentationParameters->AutoDepthStencilFormat             = d3dformat_from_wined3dformat(localParameters.AutoDepthStencilFormat);
    597     pPresentationParameters->Flags                              = localParameters.Flags;
    598     pPresentationParameters->FullScreen_RefreshRateInHz         = localParameters.FullScreen_RefreshRateInHz;
    599     pPresentationParameters->FullScreen_PresentationInterval    = localParameters.PresentationInterval;
    600 
    601582    return hr;
    602583}
     
    605586    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    606587    HRESULT hr;
    607     TRACE("(%p) Relay\n", This);
     588
     589    TRACE("iface %p, src_rect %p, dst_rect %p, dst_window_override %p, dirty_region %p.\n",
     590            iface, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
    608591
    609592    wined3d_mutex_lock();
     
    619602    HRESULT rc = D3D_OK;
    620603
    621     TRACE("(%p) Relay\n", This);
     604    TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
     605            iface, BackBuffer, Type, ppBackBuffer);
    622606
    623607    wined3d_mutex_lock();
     
    635619    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    636620    HRESULT hr;
    637     TRACE("(%p) Relay\n", This);
     621
     622    TRACE("iface %p, raster_status %p.\n", iface, pRasterStatus);
    638623
    639624    wined3d_mutex_lock();
     
    646631static void WINAPI IDirect3DDevice8Impl_SetGammaRamp(LPDIRECT3DDEVICE8 iface, DWORD Flags, CONST D3DGAMMARAMP* pRamp) {
    647632    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    648     TRACE("(%p) Relay\n", This);
     633
     634    TRACE("iface %p, flags %#x, ramp %p.\n", iface, Flags, pRamp);
    649635
    650636    /* Note: D3DGAMMARAMP is compatible with WINED3DGAMMARAMP */
     
    656642static void WINAPI IDirect3DDevice8Impl_GetGammaRamp(LPDIRECT3DDEVICE8 iface, D3DGAMMARAMP* pRamp) {
    657643    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    658     TRACE("(%p) Relay\n", This);
     644
     645    TRACE("iface %p, ramp %p.\n", iface, pRamp);
    659646
    660647    /* Note: D3DGAMMARAMP is compatible with WINED3DGAMMARAMP */
     
    829816    HRESULT hr;
    830817
    831     TRACE("(%p) : w(%d) h(%d) fmt(%d) surf@%p\n", This, Width, Height, Format, *ppSurface);
     818    TRACE("iface %p, width %u, height %u, format %#x, lockable %#x, discard %#x, level %u, surface %p,\n"
     819            "\tusage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n",
     820            iface, Width, Height, Format, Lockable, Discard, Level, ppSurface,
     821            Usage, Pool, MultiSample, MultisampleQuality);
    832822
    833823    object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface8Impl));
     
    855845static HRESULT WINAPI IDirect3DDevice8Impl_CreateRenderTarget(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, BOOL Lockable, IDirect3DSurface8** ppSurface) {
    856846    HRESULT hr;
    857     TRACE("Relay\n");
     847
     848    TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, lockable %#x, surface %p.\n",
     849            iface, Width, Height, Format, MultiSample, Lockable, ppSurface);
    858850
    859851    hr = IDirect3DDevice8Impl_CreateSurface(iface, Width, Height, Format, Lockable, FALSE /* Discard */,
     
    865857static HRESULT WINAPI IDirect3DDevice8Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, IDirect3DSurface8** ppSurface) {
    866858    HRESULT hr;
    867     TRACE("Relay\n");
     859
     860    TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, surface %p.\n",
     861            iface, Width, Height, Format, MultiSample, ppSurface);
    868862
    869863    /* TODO: Verify that Discard is false */
     
    877871static HRESULT WINAPI IDirect3DDevice8Impl_CreateImageSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, IDirect3DSurface8** ppSurface) {
    878872    HRESULT hr;
    879     TRACE("Relay\n");
     873
     874    TRACE("iface %p, width %u, height %u, format %#x, surface %p.\n",
     875            iface, Width, Height, Format, ppSurface);
    880876
    881877    hr = IDirect3DDevice8Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, FALSE /* Discard */,
     
    892888    HRESULT              hr = WINED3D_OK;
    893889    WINED3DFORMAT        srcFormat, destFormat;
    894     UINT                 srcWidth,  destWidth;
    895     UINT                 srcHeight, destHeight;
    896     UINT                 srcSize;
    897890    WINED3DSURFACE_DESC  winedesc;
    898891
    899     TRACE("(%p) pSrcSur=%p, pSourceRects=%p, cRects=%d, pDstSur=%p, pDestPtsArr=%p\n", iface,
    900           pSourceSurface, pSourceRects, cRects, pDestinationSurface, pDestPoints);
    901 
    902 
    903     /* Check that the source texture is in WINED3DPOOL_SYSTEMMEM and the destination texture is in WINED3DPOOL_DEFAULT */
     892    TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n",
     893            iface, pSourceSurface, pSourceRects, cRects, pDestinationSurface, pDestPoints);
     894
     895    /* Check that the source texture is in WINED3DPOOL_SYSTEMMEM and the
     896     * destination texture is in WINED3DPOOL_DEFAULT. */
    904897
    905898    wined3d_mutex_lock();
    906899    IWineD3DSurface_GetDesc(Source->wineD3DSurface, &winedesc);
    907900    srcFormat = winedesc.format;
    908     srcWidth = winedesc.width;
    909     srcHeight = winedesc.height;
    910     srcSize = winedesc.size;
    911901
    912902    IWineD3DSurface_GetDesc(Dest->wineD3DSurface, &winedesc);
    913903    destFormat = winedesc.format;
    914     destWidth = winedesc.width;
    915     destHeight = winedesc.height;
    916904
    917905    /* Check that the source and destination formats match */
     
    923911        TRACE("(%p) : Converting destination surface from WINED3DFMT_UNKNOWN to the source format\n", iface);
    924912        IWineD3DSurface_SetFormat(Dest->wineD3DSurface, srcFormat);
    925         destFormat = srcFormat;
    926913    }
    927914
     
    950937    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    951938    HRESULT hr;
    952     TRACE("(%p) Relay\n" , This);
     939
     940    TRACE("iface %p, src_texture %p, dst_texture %p.\n", iface, pSourceTexture, pDestinationTexture);
    953941
    954942    wined3d_mutex_lock();
     
    964952    HRESULT hr;
    965953
    966     TRACE("(%p) Relay\n" , This);
     954    TRACE("iface %p, dst_surface %p.\n", iface, pDestSurface);
    967955
    968956    if (pDestSurface == NULL) {
     
    984972    IWineD3DSurface *original_ds = NULL;
    985973    HRESULT hr;
    986     TRACE("(%p) Relay\n" , This);
     974
     975    TRACE("iface %p, render_target %p, depth_stencil %p.\n", iface, pRenderTarget, pNewZStencil);
    987976
    988977    wined3d_mutex_lock();
     
    993982        hr = IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, pZSurface ? pZSurface->wineD3DSurface : NULL);
    994983        if (SUCCEEDED(hr) && pSurface)
    995             hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, 0, pSurface->wineD3DSurface);
     984            hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, 0, pSurface->wineD3DSurface, TRUE);
    996985        if (FAILED(hr)) IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, original_ds);
    997986    }
     
    1008997    IWineD3DSurface *pRenderTarget;
    1009998
    1010     TRACE("(%p) Relay\n" , This);
     999    TRACE("iface %p, render_target %p.\n", iface, ppRenderTarget);
    10111000
    10121001    if (ppRenderTarget == NULL) {
     
    10341023    IWineD3DSurface *pZStencilSurface;
    10351024
    1036     TRACE("(%p) Relay\n" , This);
     1025    TRACE("iface %p, depth_stencil %p.\n", iface, ppZStencilSurface);
     1026
    10371027    if(ppZStencilSurface == NULL){
    10381028        return D3DERR_INVALIDCALL;
     
    10571047    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    10581048    HRESULT hr;
    1059     TRACE("(%p) Relay\n" , This);
     1049
     1050    TRACE("iface %p.\n", iface);
    10601051
    10611052    wined3d_mutex_lock();
     
    10661057}
    10671058
    1068 static HRESULT WINAPI IDirect3DDevice8Impl_EndScene(LPDIRECT3DDEVICE8 iface) {
    1069     IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    1070     HRESULT hr;
    1071     TRACE("(%p) Relay\n" , This);
     1059static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice8Impl_EndScene(LPDIRECT3DDEVICE8 iface) {
     1060    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
     1061    HRESULT hr;
     1062
     1063    TRACE("iface %p.\n", iface);
    10721064
    10731065    wined3d_mutex_lock();
     
    10811073    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    10821074    HRESULT hr;
    1083     TRACE("(%p) Relay\n" , This);
     1075
     1076    TRACE("iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.\n",
     1077            iface, Count, pRects, Flags, Color, Z, Stencil);
    10841078
    10851079    /* Note: D3DRECT is compatible with WINED3DRECT */
     
    10941088    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    10951089    HRESULT hr;
    1096     TRACE("(%p) Relay\n" , This);
     1090
     1091    TRACE("iface %p, state %#x, matrix %p.\n", iface, State, lpMatrix);
    10971092
    10981093    /* Note: D3DMATRIX is compatible with WINED3DMATRIX */
     
    11071102    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    11081103    HRESULT hr;
    1109     TRACE("(%p) Relay\n" , This);
     1104
     1105    TRACE("iface %p, state %#x, matrix %p.\n", iface, State, pMatrix);
    11101106
    11111107    /* Note: D3DMATRIX is compatible with WINED3DMATRIX */
     
    11201116    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    11211117    HRESULT hr;
    1122     TRACE("(%p) Relay\n" , This);
     1118
     1119    TRACE("iface %p, state %#x, matrix %p.\n", iface, State, pMatrix);
    11231120
    11241121    /* Note: D3DMATRIX is compatible with WINED3DMATRIX */
     
    11331130    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    11341131    HRESULT hr;
    1135     TRACE("(%p) Relay\n" , This);
     1132
     1133    TRACE("iface %p, viewport %p.\n", iface, pViewport);
    11361134
    11371135    /* Note: D3DVIEWPORT8 is compatible with WINED3DVIEWPORT */
     
    11461144    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    11471145    HRESULT hr;
    1148     TRACE("(%p) Relay\n" , This);
     1146
     1147    TRACE("iface %p, viewport %p.\n", iface, pViewport);
    11491148
    11501149    /* Note: D3DVIEWPORT8 is compatible with WINED3DVIEWPORT */
     
    11591158    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    11601159    HRESULT hr;
    1161     TRACE("(%p) Relay\n" , This);
     1160
     1161    TRACE("iface %p, material %p.\n", iface, pMaterial);
    11621162
    11631163    /* Note: D3DMATERIAL8 is compatible with WINED3DMATERIAL */
     
    11721172    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    11731173    HRESULT hr;
    1174     TRACE("(%p) Relay\n" , This);
     1174
     1175    TRACE("iface %p, material %p.\n", iface, pMaterial);
    11751176
    11761177    /* Note: D3DMATERIAL8 is compatible with WINED3DMATERIAL */
     
    11851186    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    11861187    HRESULT hr;
    1187     TRACE("(%p) Relay\n" , This);
     1188
     1189    TRACE("iface %p, index %u, light %p.\n", iface, Index, pLight);
    11881190
    11891191    /* Note: D3DLIGHT8 is compatible with WINED3DLIGHT */
     
    11981200    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    11991201    HRESULT hr;
    1200     TRACE("(%p) Relay\n" , This);
     1202
     1203    TRACE("iface %p, index %u, light %p.\n", iface, Index, pLight);
    12011204
    12021205    /* Note: D3DLIGHT8 is compatible with WINED3DLIGHT */
     
    12111214    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    12121215    HRESULT hr;
    1213     TRACE("(%p) Relay\n" , This);
     1216
     1217    TRACE("iface %p, index %u, enable %#x.\n", iface, Index, Enable);
    12141218
    12151219    wined3d_mutex_lock();
     
    12231227    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    12241228    HRESULT hr;
    1225     TRACE("(%p) Relay\n" , This);
     1229
     1230    TRACE("iface %p, index %u, enable %p.\n", iface, Index, pEnable);
    12261231
    12271232    wined3d_mutex_lock();
     
    12351240    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    12361241    HRESULT hr;
    1237     TRACE("(%p) Relay\n" , This);
     1242
     1243    TRACE("iface %p, index %u, plane %p.\n", iface, Index, pPlane);
    12381244
    12391245    wined3d_mutex_lock();
     
    12471253    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    12481254    HRESULT hr;
    1249     TRACE("(%p) Relay\n" , This);
     1255
     1256    TRACE("iface %p, index %u, plane %p.\n", iface, Index, pPlane);
    12501257
    12511258    wined3d_mutex_lock();
     
    12591266    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    12601267    HRESULT hr;
    1261     TRACE("(%p) Relay\n" , This);
     1268
     1269    TRACE("iface %p, state %#x, value %#x.\n", iface, State, Value);
    12621270
    12631271    wined3d_mutex_lock();
     
    12711279    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    12721280    HRESULT hr;
    1273     TRACE("(%p) Relay\n" , This);
     1281
     1282    TRACE("iface %p, state %#x, value %p.\n", iface, State, pValue);
    12741283
    12751284    wined3d_mutex_lock();
     
    12831292    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    12841293    HRESULT hr;
    1285     TRACE("(%p)\n", This);
     1294
     1295    TRACE("iface %p.\n", iface);
    12861296
    12871297    wined3d_mutex_lock();
     
    12941304static HRESULT WINAPI IDirect3DDevice8Impl_EndStateBlock(LPDIRECT3DDEVICE8 iface, DWORD* pToken) {
    12951305    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    1296     HRESULT hr;
    1297     IWineD3DStateBlock* wineD3DStateBlock;
    1298     IDirect3DStateBlock8Impl* object;
    1299 
    1300     TRACE("(%p) Relay\n", This);
     1306    IWineD3DStateBlock *stateblock;
     1307    HRESULT hr;
     1308
     1309    TRACE("iface %p, token %p.\n", iface, pToken);
    13011310
    13021311    /* Tell wineD3D to endstateblock before anything else (in case we run out
     
    13041313     */
    13051314    wined3d_mutex_lock();
    1306     hr = IWineD3DDevice_EndStateBlock(This->WineD3DDevice , &wineD3DStateBlock);
     1315    hr = IWineD3DDevice_EndStateBlock(This->WineD3DDevice , &stateblock);
    13071316    if (hr != D3D_OK) {
    13081317        WARN("IWineD3DDevice_EndStateBlock returned an error\n");
     
    13111320    }
    13121321
    1313     /* allocate a new IDirectD3DStateBlock */
    1314     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY ,sizeof(IDirect3DStateBlock8Impl));
    1315     object->ref = 1;
    1316     object->lpVtbl = &Direct3DStateBlock8_Vtbl;
    1317 
    1318     object->wineD3DStateBlock = wineD3DStateBlock;
    1319 
    1320     *pToken = d3d8_allocate_handle(&This->handle_table, object, D3D8_HANDLE_SB);
     1322    *pToken = d3d8_allocate_handle(&This->handle_table, stateblock, D3D8_HANDLE_SB);
    13211323    wined3d_mutex_unlock();
    13221324
     
    13241326    {
    13251327        ERR("Failed to create a handle\n");
    1326         IDirect3DStateBlock8_Release((IDirect3DStateBlock8 *)object);
     1328        wined3d_mutex_lock();
     1329        IWineD3DStateBlock_Release(stateblock);
     1330        wined3d_mutex_unlock();
    13271331        return E_FAIL;
    13281332    }
    13291333    ++*pToken;
    13301334
    1331     TRACE("Returning %#x (%p).\n", *pToken, object);
     1335    TRACE("Returning %#x (%p).\n", *pToken, stateblock);
    13321336
    13331337    return hr;
     
    13361340static HRESULT WINAPI IDirect3DDevice8Impl_ApplyStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token) {
    13371341    IDirect3DDevice8Impl     *This = (IDirect3DDevice8Impl *)iface;
    1338     IDirect3DStateBlock8Impl *pSB;
    1339     HRESULT hr;
    1340 
    1341     TRACE("(%p) %#x Relay\n", This, Token);
    1342 
    1343     wined3d_mutex_lock();
    1344     pSB = d3d8_get_object(&This->handle_table, Token - 1, D3D8_HANDLE_SB);
    1345     if (!pSB)
     1342    IWineD3DStateBlock *stateblock;
     1343    HRESULT hr;
     1344
     1345    TRACE("iface %p, token %#x.\n", iface, Token);
     1346
     1347    wined3d_mutex_lock();
     1348    stateblock = d3d8_get_object(&This->handle_table, Token - 1, D3D8_HANDLE_SB);
     1349    if (!stateblock)
    13461350    {
    13471351        WARN("Invalid handle (%#x) passed.\n", Token);
     
    13491353        return D3DERR_INVALIDCALL;
    13501354    }
    1351     hr = IWineD3DStateBlock_Apply(pSB->wineD3DStateBlock);
     1355    hr = IWineD3DStateBlock_Apply(stateblock);
    13521356    wined3d_mutex_unlock();
    13531357
     
    13571361static HRESULT WINAPI IDirect3DDevice8Impl_CaptureStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token) {
    13581362    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    1359     IDirect3DStateBlock8Impl *pSB;
    1360     HRESULT hr;
    1361 
    1362     TRACE("(%p) %#x Relay\n", This, Token);
    1363 
    1364     wined3d_mutex_lock();
    1365     pSB = d3d8_get_object(&This->handle_table, Token - 1, D3D8_HANDLE_SB);
    1366     if (!pSB)
     1363    IWineD3DStateBlock *stateblock;
     1364    HRESULT hr;
     1365
     1366    TRACE("iface %p, token %#x.\n", iface, Token);
     1367
     1368    wined3d_mutex_lock();
     1369    stateblock = d3d8_get_object(&This->handle_table, Token - 1, D3D8_HANDLE_SB);
     1370    if (!stateblock)
    13671371    {
    13681372        WARN("Invalid handle (%#x) passed.\n", Token);
     
    13701374        return D3DERR_INVALIDCALL;
    13711375    }
    1372     hr = IWineD3DStateBlock_Capture(pSB->wineD3DStateBlock);
     1376    hr = IWineD3DStateBlock_Capture(stateblock);
    13731377    wined3d_mutex_unlock();
    13741378
     
    13781382static HRESULT WINAPI IDirect3DDevice8Impl_DeleteStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token) {
    13791383    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    1380     IDirect3DStateBlock8Impl *pSB;
    1381 
    1382     TRACE("(%p) Relay\n", This);
    1383 
    1384     wined3d_mutex_lock();
    1385     pSB = d3d8_free_handle(&This->handle_table, Token - 1, D3D8_HANDLE_SB);
    1386     wined3d_mutex_unlock();
    1387 
    1388     if (!pSB)
     1384    IWineD3DStateBlock *stateblock;
     1385
     1386    TRACE("iface %p, token %#x.\n", iface, Token);
     1387
     1388    wined3d_mutex_lock();
     1389    stateblock = d3d8_free_handle(&This->handle_table, Token - 1, D3D8_HANDLE_SB);
     1390
     1391    if (!stateblock)
    13891392    {
    13901393        WARN("Invalid handle (%#x) passed.\n", Token);
     1394        wined3d_mutex_unlock();
    13911395        return D3DERR_INVALIDCALL;
    13921396    }
    13931397
    1394     if (IUnknown_Release((IUnknown *)pSB))
    1395     {
    1396         ERR("Stateblock %p has references left, this shouldn't happen.\n", pSB);
    1397     }
     1398    if (IWineD3DStateBlock_Release((IUnknown *)stateblock))
     1399    {
     1400        ERR("Stateblock %p has references left, this shouldn't happen.\n", stateblock);
     1401    }
     1402    wined3d_mutex_unlock();
    13981403
    13991404    return D3D_OK;
     
    14041409{
    14051410    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    1406     IDirect3DStateBlock8Impl *object;
    1407     HRESULT hr;
    1408 
    1409     TRACE("(%p) Relay\n", This);
     1411    IWineD3DStateBlock *stateblock;
     1412    HRESULT hr;
     1413
     1414    TRACE("iface %p, type %#x, handle %p.\n", iface, Type, handle);
    14101415
    14111416    if (Type != D3DSBT_ALL
     
    14171422    }
    14181423
    1419     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DStateBlock8Impl));
    1420     if (!object)
    1421     {
    1422         ERR("Failed to allocate memory.\n");
    1423         return E_OUTOFMEMORY;
    1424     }
    1425 
    1426     object->lpVtbl = &Direct3DStateBlock8_Vtbl;
    1427     object->ref = 1;
    1428 
    14291424    wined3d_mutex_lock();
    14301425    hr = IWineD3DDevice_CreateStateBlock(This->WineD3DDevice, (WINED3DSTATEBLOCKTYPE)Type,
    1431             &object->wineD3DStateBlock, (IUnknown *)object);
     1426            &stateblock, NULL);
    14321427    if (FAILED(hr))
    14331428    {
    14341429        wined3d_mutex_unlock();
    14351430        ERR("IWineD3DDevice_CreateStateBlock failed, hr %#x\n", hr);
    1436         HeapFree(GetProcessHeap(), 0, object);
    14371431        return hr;
    14381432    }
    14391433
    1440     *handle = d3d8_allocate_handle(&This->handle_table, object, D3D8_HANDLE_SB);
     1434    *handle = d3d8_allocate_handle(&This->handle_table, stateblock, D3D8_HANDLE_SB);
    14411435    wined3d_mutex_unlock();
    14421436
     
    14441438    {
    14451439        ERR("Failed to allocate a handle.\n");
    1446         IDirect3DStateBlock8_Release((IDirect3DStateBlock8 *)object);
     1440        wined3d_mutex_lock();
     1441        IWineD3DStateBlock_Release(stateblock);
     1442        wined3d_mutex_unlock();
    14471443        return E_FAIL;
    14481444    }
    14491445    ++*handle;
    14501446
    1451     TRACE("Returning %#x (%p).\n", *handle, object);
     1447    TRACE("Returning %#x (%p).\n", *handle, stateblock);
    14521448
    14531449    return hr;
     
    14571453    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    14581454    HRESULT hr;
    1459     TRACE("(%p) Relay\n" , This);
     1455
     1456    TRACE("iface %p, clip_status %p.\n", iface, pClipStatus);
    14601457/* FIXME: Verify that D3DCLIPSTATUS8 ~= WINED3DCLIPSTATUS */
    14611458
     
    14701467    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    14711468    HRESULT hr;
    1472     TRACE("(%p) Relay\n" , This);
     1469
     1470    TRACE("iface %p, clip_status %p.\n", iface, pClipStatus);
    14731471
    14741472    wined3d_mutex_lock();
     
    14841482    HRESULT hr;
    14851483
    1486     TRACE("(%p) Relay\n" , This);
     1484    TRACE("iface %p, stage %u, texture %p.\n", iface, Stage, ppTexture);
    14871485
    14881486    if(ppTexture == NULL){
     
    15171515    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    15181516    HRESULT hr;
    1519     TRACE("(%p) Relay %d %p\n" , This, Stage, pTexture);
     1517
     1518    TRACE("iface %p, stage %u, texture %p.\n", iface, Stage, pTexture);
    15201519
    15211520    wined3d_mutex_lock();
     
    15691568    const struct tss_lookup *l = &tss_lookup[Type];
    15701569    HRESULT hr;
    1571     TRACE("(%p) Relay\n" , This);
     1570
     1571    TRACE("iface %p, stage %u, state %#x, value %p.\n", iface, Stage, Type, pValue);
    15721572
    15731573    wined3d_mutex_lock();
     
    15831583    const struct tss_lookup *l = &tss_lookup[Type];
    15841584    HRESULT hr;
    1585     TRACE("(%p) Relay\n" , This);
     1585
     1586    TRACE("iface %p, stage %u, state %#x, value %#x.\n", iface, Stage, Type, Value);
    15861587
    15871588    wined3d_mutex_lock();
     
    15961597    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    15971598    HRESULT hr;
    1598     TRACE("(%p) Relay\n" , This);
     1599
     1600    TRACE("iface %p, pass_count %p.\n", iface, pNumPasses);
    15991601
    16001602    wined3d_mutex_lock();
     
    16051607}
    16061608
    1607 static HRESULT WINAPI IDirect3DDevice8Impl_GetInfo(LPDIRECT3DDEVICE8 iface, DWORD DevInfoID, void* pDevInfoStruct, DWORD DevInfoStructSize) {
    1608     IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    1609     FIXME("(%p) : stub\n", This);
     1609static HRESULT WINAPI IDirect3DDevice8Impl_GetInfo(IDirect3DDevice8 *iface,
     1610        DWORD info_id, void *info, DWORD info_size)
     1611{
     1612    FIXME("iface %p, info_id %#x, info %p, info_size %u stub!\n", iface, info_id, info, info_size);
     1613
    16101614    return D3D_OK;
    16111615}
     
    16141618    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    16151619    HRESULT hr;
    1616     TRACE("(%p) Relay\n" , This);
     1620
     1621    TRACE("iface %p, palette_idx %u, entries %p.\n", iface, PaletteNumber, pEntries);
    16171622
    16181623    wined3d_mutex_lock();
     
    16261631    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    16271632    HRESULT hr;
    1628     TRACE("(%p) Relay\n" , This);
     1633
     1634    TRACE("iface %p, palette_idx %u, entries %p.\n", iface, PaletteNumber, pEntries);
    16291635
    16301636    wined3d_mutex_lock();
     
    16381644    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    16391645    HRESULT hr;
    1640     TRACE("(%p) Relay\n" , This);
     1646
     1647    TRACE("iface %p, palette_idx %u.\n", iface, PaletteNumber);
    16411648
    16421649    wined3d_mutex_lock();
     
    16501657    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    16511658    HRESULT hr;
    1652     TRACE("(%p) Relay\n" , This);
     1659
     1660    TRACE("iface %p, palette_idx %p.\n", iface, PaletteNumber);
    16531661
    16541662    wined3d_mutex_lock();
     
    16641672    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    16651673    HRESULT hr;
    1666     TRACE("(%p) Relay\n" , This);
     1674
     1675    TRACE("iface %p, primitive_type %#x, start_vertex %u, primitive_count %u.\n",
     1676            iface, PrimitiveType, StartVertex, PrimitiveCount);
    16671677
    16681678    wined3d_mutex_lock();
     
    16791689    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    16801690    HRESULT hr;
    1681     TRACE("(%p) Relay\n" , This);
     1691
     1692    TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, start_idx %u, primitive_count %u.\n",
     1693            iface, PrimitiveType, MinVertexIndex, NumVertices, startIndex, primCount);
    16821694
    16831695    wined3d_mutex_lock();
     
    16931705    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    16941706    HRESULT hr;
    1695     TRACE("(%p) Relay\n" , This);
     1707
     1708    TRACE("iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.\n",
     1709            iface, PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
    16961710
    16971711    wined3d_mutex_lock();
     
    17111725    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    17121726    HRESULT hr;
    1713     TRACE("(%p) Relay\n" , This);
     1727
     1728    TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, index_count %u, primitive_count %u,\n"
     1729            "index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n",
     1730            iface, PrimitiveType, MinVertexIndex, NumVertexIndices, PrimitiveCount,
     1731            pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
    17141732
    17151733    wined3d_mutex_lock();
     
    17271745    HRESULT hr;
    17281746    IDirect3DVertexBuffer8Impl *dest = (IDirect3DVertexBuffer8Impl *) pDestBuffer;
    1729     TRACE("(%p) Relay\n" , This);
     1747
     1748    TRACE("iface %p, src_start_idx %u, dst_idx %u, vertex_count %u, dst_buffer %p, flags %#x.\n",
     1749            iface, SrcStartIndex, DestIndex, VertexCount, pDestBuffer, Flags);
    17301750
    17311751    wined3d_mutex_lock();
     
    18541874    HRESULT hr;
    18551875
    1856     TRACE("(%p) : Relay\n", This);
     1876    TRACE("iface %p, shader %#x.\n", iface, pShader);
    18571877
    18581878    if (VS_HIGHESTFIXEDFXF >= pShader) {
     
    18961916    HRESULT hrc;
    18971917
    1898     TRACE("(%p) : Relay  device@%p\n", This, This->WineD3DDevice);
     1918    TRACE("iface %p, shader %p.\n", iface, ppShader);
    18991919
    19001920    wined3d_mutex_lock();
     
    19341954    IWineD3DVertexShader *cur = NULL;
    19351955
    1936     TRACE("(%p) : pShader %#x\n", This, pShader);
     1956    TRACE("iface %p, shader %#x.\n", iface, pShader);
    19371957
    19381958    wined3d_mutex_lock();
     
    19671987    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    19681988    HRESULT hr;
    1969     TRACE("(%p) : Relay\n", This);
     1989
     1990    TRACE("iface %p, register %u, data %p, count %u.\n",
     1991            iface, Register, pConstantData, ConstantCount);
    19701992
    19711993    if(Register + ConstantCount > D3D8_MAX_VERTEX_SHADER_CONSTANTF) {
     
    19852007    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    19862008    HRESULT hr;
    1987     TRACE("(%p) : Relay\n", This);
     2009
     2010    TRACE("iface %p, register %u, data %p, count %u.\n",
     2011            iface, Register, pConstantData, ConstantCount);
    19882012
    19892013    if(Register + ConstantCount > D3D8_MAX_VERTEX_SHADER_CONSTANTF) {
     
    20052029    IDirect3DVertexShader8Impl *shader;
    20062030
    2007     TRACE("(%p) : pVertexShader 0x%08x, pData %p, *pSizeOfData %u\n", This, pVertexShader, pData, *pSizeOfData);
     2031    TRACE("iface %p, shader %#x, data %p, data_size %p.\n",
     2032            iface, pVertexShader, pData, pSizeOfData);
    20082033
    20092034    wined3d_mutex_lock();
     
    20412066    HRESULT hr;
    20422067
    2043     TRACE("(%p) : pVertexShader %#x, pData %p, pSizeOfData %p\n", This, pVertexShader, pData, pSizeOfData);
     2068    TRACE("iface %p, shader %#x, data %p, data_size %p.\n",
     2069            iface, pVertexShader, pData, pSizeOfData);
    20442070
    20452071    wined3d_mutex_lock();
     
    20702096    HRESULT hr;
    20712097    IDirect3DIndexBuffer8Impl *ib = (IDirect3DIndexBuffer8Impl *)pIndexData;
    2072     TRACE("(%p) Relay\n", This);
     2098
     2099    TRACE("iface %p, buffer %p, base_vertex_idx %u.\n", iface, pIndexData, baseVertexIndex);
    20732100
    20742101    /* WineD3D takes an INT(due to d3d9), but d3d8 uses UINTs. Do I have to add a check here that
     
    20932120    HRESULT rc = D3D_OK;
    20942121
    2095     TRACE("(%p) Relay\n", This);
     2122    TRACE("iface %p, buffer %p, base_vertex_index %p.\n", iface, ppIndexData, pBaseVertexIndex);
    20962123
    20972124    if(ppIndexData == NULL){
     
    21742201    HRESULT hr;
    21752202
    2176     TRACE("(%p) : pShader %#x\n", This, pShader);
     2203    TRACE("iface %p, shader %#x.\n", iface, pShader);
    21772204
    21782205    wined3d_mutex_lock();
     
    22032230    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    22042231    IWineD3DPixelShader *object;
    2205 
    22062232    HRESULT hrc = D3D_OK;
    2207     TRACE("(%p) Relay\n", This);
     2233
     2234    TRACE("iface %p, shader %p.\n", iface, ppShader);
     2235
    22082236    if (NULL == ppShader) {
    22092237        TRACE("(%p) Invalid call\n", This);
     
    22342262    IWineD3DPixelShader *cur = NULL;
    22352263
    2236     TRACE("(%p) : pShader %#x\n", This, pShader);
     2264    TRACE("iface %p, shader %#x.\n", iface, pShader);
    22372265
    22382266    wined3d_mutex_lock();
     
    22432271        WARN("Invalid handle (%#x) passed.\n", pShader);
    22442272        wined3d_mutex_unlock();
    2245         return D3D_OK;
     2273        return D3DERR_INVALIDCALL;
    22462274    }
    22472275
     
    22672295    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    22682296    HRESULT hr;
    2269     TRACE("(%p) Relay\n", This);
     2297
     2298    TRACE("iface %p, register %u, data %p, count %u.\n",
     2299            iface, Register, pConstantData, ConstantCount);
    22702300
    22712301    wined3d_mutex_lock();
     
    22792309    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    22802310    HRESULT hr;
    2281     TRACE("(%p) Relay\n", This);
     2311
     2312    TRACE("iface %p, register %u, data %p, count %u.\n",
     2313            iface, Register, pConstantData, ConstantCount);
    22822314
    22832315    wined3d_mutex_lock();
     
    22932325    HRESULT hr;
    22942326
    2295     TRACE("(%p) : pPixelShader %#x, pData %p, pSizeOfData %p\n", This, pPixelShader, pData, pSizeOfData);
     2327    TRACE("iface %p, shader %#x, data %p, data_size %p.\n",
     2328            iface, pPixelShader, pData, pSizeOfData);
    22962329
    22972330    wined3d_mutex_lock();
     
    23142347    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    23152348    HRESULT hr;
    2316     TRACE("(%p) Relay\n", This);
     2349
     2350    TRACE("iface %p, handle %#x, segment_count %p, patch_info %p.\n",
     2351            iface, Handle, pNumSegs, pRectPatchInfo);
    23172352
    23182353    wined3d_mutex_lock();
     
    23262361    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    23272362    HRESULT hr;
    2328     TRACE("(%p) Relay\n", This);
     2363
     2364    TRACE("iface %p, handle %#x, segment_count %p, patch_info %p.\n",
     2365            iface, Handle, pNumSegs, pTriPatchInfo);
    23292366
    23302367    wined3d_mutex_lock();
     
    23382375    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    23392376    HRESULT hr;
    2340     TRACE("(%p) Relay\n", This);
     2377
     2378    TRACE("iface %p, handle %#x.\n", iface, Handle);
    23412379
    23422380    wined3d_mutex_lock();
     
    23502388    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
    23512389    HRESULT hr;
    2352     TRACE("(%p) Relay\n" , This);
     2390
     2391    TRACE("iface %p, stream_idx %u, buffer %p, stride %u.\n",
     2392            iface, StreamNumber, pStreamData, Stride);
    23532393
    23542394    wined3d_mutex_lock();
     
    23662406    HRESULT rc = D3D_OK;
    23672407
    2368     TRACE("(%p) Relay\n" , This);
     2408    TRACE("iface %p, stream_idx %u, buffer %p, stride %p.\n",
     2409            iface, StreamNumber, pStream, pStride);
    23692410
    23702411    if(pStream == NULL){
     
    23882429}
    23892430
    2390 
    2391 const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl =
     2431static const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl =
    23922432{
    23932433    IDirect3DDevice8Impl_QueryInterface,
     
    27172757}
    27182758
    2719 const IWineD3DDeviceParentVtbl d3d8_wined3d_device_parent_vtbl =
     2759static const IWineD3DDeviceParentVtbl d3d8_wined3d_device_parent_vtbl =
    27202760{
    27212761    /* IUnknown methods */
     
    27312771    device_parent_CreateSwapChain,
    27322772};
     2773
     2774HRESULT device_init(IDirect3DDevice8Impl *device, IWineD3D *wined3d, UINT adapter,
     2775        D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters)
     2776{
     2777    WINED3DPRESENT_PARAMETERS wined3d_parameters;
     2778    HRESULT hr;
     2779
     2780    device->lpVtbl = &Direct3DDevice8_Vtbl;
     2781    device->device_parent_vtbl = &d3d8_wined3d_device_parent_vtbl;
     2782    device->ref = 1;
     2783    device->handle_table.entries = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
     2784            D3D8_INITIAL_HANDLE_TABLE_SIZE * sizeof(*device->handle_table.entries));
     2785    if (!device->handle_table.entries)
     2786    {
     2787        ERR("Failed to allocate handle table memory.\n");
     2788        return E_OUTOFMEMORY;
     2789    }
     2790    device->handle_table.table_size = D3D8_INITIAL_HANDLE_TABLE_SIZE;
     2791
     2792    wined3d_mutex_lock();
     2793    hr = IWineD3D_CreateDevice(wined3d, adapter, device_type, focus_window, flags, (IUnknown *)device,
     2794            (IWineD3DDeviceParent *)&device->device_parent_vtbl, &device->WineD3DDevice);
     2795    if (FAILED(hr))
     2796    {
     2797        WARN("Failed to create wined3d device, hr %#x.\n", hr);
     2798        wined3d_mutex_unlock();
     2799        HeapFree(GetProcessHeap(), 0, device->handle_table.entries);
     2800        return hr;
     2801    }
     2802
     2803    if (flags & D3DCREATE_MULTITHREADED) IWineD3DDevice_SetMultithreaded(device->WineD3DDevice);
     2804
     2805    wined3d_parameters.BackBufferWidth = parameters->BackBufferWidth;
     2806    wined3d_parameters.BackBufferHeight = parameters->BackBufferHeight;
     2807    wined3d_parameters.BackBufferFormat = wined3dformat_from_d3dformat(parameters->BackBufferFormat);
     2808    wined3d_parameters.BackBufferCount = parameters->BackBufferCount;
     2809    wined3d_parameters.MultiSampleType = parameters->MultiSampleType;
     2810    wined3d_parameters.MultiSampleQuality = 0; /* d3d9 only */
     2811    wined3d_parameters.SwapEffect = parameters->SwapEffect;
     2812    wined3d_parameters.hDeviceWindow = parameters->hDeviceWindow;
     2813    wined3d_parameters.Windowed = parameters->Windowed;
     2814    wined3d_parameters.EnableAutoDepthStencil = parameters->EnableAutoDepthStencil;
     2815    wined3d_parameters.AutoDepthStencilFormat = wined3dformat_from_d3dformat(parameters->AutoDepthStencilFormat);
     2816    wined3d_parameters.Flags = parameters->Flags;
     2817    wined3d_parameters.FullScreen_RefreshRateInHz = parameters->FullScreen_RefreshRateInHz;
     2818    wined3d_parameters.PresentationInterval = parameters->FullScreen_PresentationInterval;
     2819    wined3d_parameters.AutoRestoreDisplayMode = TRUE;
     2820
     2821    hr = IWineD3DDevice_Init3D(device->WineD3DDevice, &wined3d_parameters);
     2822    if (FAILED(hr))
     2823    {
     2824        WARN("Failed to initialize 3D, hr %#x.\n", hr);
     2825        IWineD3DDevice_Release(device->WineD3DDevice);
     2826        wined3d_mutex_unlock();
     2827        HeapFree(GetProcessHeap(), 0, device->handle_table.entries);
     2828        return hr;
     2829    }
     2830
     2831    hr = IWineD3DDevice_SetRenderState(device->WineD3DDevice, WINED3DRS_POINTSIZE_MIN, 0);
     2832    wined3d_mutex_unlock();
     2833    if (FAILED(hr))
     2834    {
     2835        ERR("Failed to set minimum pointsize, hr %#x.\n", hr);
     2836        goto err;
     2837    }
     2838
     2839    parameters->BackBufferWidth = wined3d_parameters.BackBufferWidth;
     2840    parameters->BackBufferHeight = wined3d_parameters.BackBufferHeight;
     2841    parameters->BackBufferFormat = d3dformat_from_wined3dformat(wined3d_parameters.BackBufferFormat);
     2842    parameters->BackBufferCount = wined3d_parameters.BackBufferCount;
     2843    parameters->MultiSampleType = wined3d_parameters.MultiSampleType;
     2844    parameters->SwapEffect = wined3d_parameters.SwapEffect;
     2845    parameters->hDeviceWindow = wined3d_parameters.hDeviceWindow;
     2846    parameters->Windowed = wined3d_parameters.Windowed;
     2847    parameters->EnableAutoDepthStencil = wined3d_parameters.EnableAutoDepthStencil;
     2848    parameters->AutoDepthStencilFormat = d3dformat_from_wined3dformat(wined3d_parameters.AutoDepthStencilFormat);
     2849    parameters->Flags = wined3d_parameters.Flags;
     2850    parameters->FullScreen_RefreshRateInHz = wined3d_parameters.FullScreen_RefreshRateInHz;
     2851    parameters->FullScreen_PresentationInterval = wined3d_parameters.PresentationInterval;
     2852
     2853    device->declArraySize = 16;
     2854    device->decls = HeapAlloc(GetProcessHeap(), 0, device->declArraySize * sizeof(*device->decls));
     2855    if (!device->decls)
     2856    {
     2857        ERR("Failed to allocate FVF vertex delcaration map memory.\n");
     2858        hr = E_OUTOFMEMORY;
     2859        goto err;
     2860    }
     2861
     2862    return D3D_OK;
     2863
     2864err:
     2865    wined3d_mutex_lock();
     2866    IWineD3DDevice_Uninit3D(device->WineD3DDevice, D3D8CB_DestroySwapChain);
     2867    IWineD3DDevice_Release(device->WineD3DDevice);
     2868    wined3d_mutex_unlock();
     2869    HeapFree(GetProcessHeap(), 0, device->handle_table.entries);
     2870    return hr;
     2871}
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