VirtualBox

Changeset 46966 in vbox for trunk/src/VBox/Additions/WINNT


Ignore:
Timestamp:
Jul 4, 2013 6:08:11 AM (12 years ago)
Author:
vboxsync
Message:

wddm/crOpenGL: some bugfixes, more TexPresent fixes

Location:
trunk/src/VBox/Additions/WINNT
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h

    r46783 r46966  
    3535
    3636/* One would increase this whenever definitions in this file are changed */
    37 #define VBOXVIDEOIF_VERSION 18
     37#define VBOXVIDEOIF_VERSION 19
    3838
    3939#define VBOXWDDM_NODE_ID_SYSTEM           0
     
    424424    VBOXDISP_KMHANDLE hSwapchainKm; /* in, NULL if new is being created */
    425425    VBOXDISP_UMHANDLE hSwapchainUm; /* in, UMD private data */
    426     DWORD winHostID;
     426    int32_t winHostID;
    427427    RECT Rect;
    428428    UINT u32Reserved;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp

    r46783 r46966  
    831831
    832832    HRESULT hr = pAdapter->D3D.pD3D9If->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, fFlags, &Params.Base, &pDevice9If);
    833     if (!SUCCEEDED(hr))
    834     {
     833    if (SUCCEEDED(hr))
     834    {
     835        int32_t hostId = 0;
     836        hr = pAdapter->D3D.D3D.pfnVBoxWineExD3DDev9GetHostId((IDirect3DDevice9Ex*)pDevice9If, &hostId);
     837        if (SUCCEEDED(hr))
     838        {
     839            Assert(hostId);
     840
     841            VBOXDISPIFESCAPE Data;
     842            Data.escapeCode = VBOXESC_SETCTXHOSTID;
     843            Data.u32CmdSpecific = (uint32_t)hostId;
     844            D3DDDICB_ESCAPE DdiEscape = {0};
     845            DdiEscape.hContext = pDevice->DefaultContext.ContextInfo.hContext;
     846            DdiEscape.hDevice = pDevice->hDevice;
     847        //    DdiEscape.Flags.Value = 0;
     848            DdiEscape.pPrivateDriverData = &Data;
     849            DdiEscape.PrivateDriverDataSize = sizeof (Data);
     850            hr = pDevice->RtCallbacks.pfnEscapeCb(pDevice->pAdapter->hAdapter, &DdiEscape);
     851            if (SUCCEEDED(hr))
     852            {
     853                pDevice->pDevice9If = pDevice9If;
     854                return S_OK;
     855            }
     856            else
     857                WARN(("pfnEscapeCb VBOXESC_SETCTXHOSTID failed hr 0x%x", hr));
     858        }
     859        else
     860            WARN(("pfnVBoxWineExD3DDev9GetHostId failed hr 0x%x", hr));
     861
     862        pDevice->pAdapter->D3D.D3D.pfnVBoxWineExD3DDev9Term((IDirect3DDevice9Ex *)pDevice9If);
     863    }
     864    else
    835865        WARN(("CreateDevice failed hr 0x%x", hr));
    836         return hr;
    837     }
    838 
    839     pDevice->pDevice9If = pDevice9If;
    840     return S_OK;
    841 }
    842 
     866
     867    return hr;
     868}
     869
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.cpp

    r46783 r46966  
    160160        {
    161161            WARN(("no VBoxWineExD3DSwapchain9GetHostWinID"));
     162            break;
     163        }
     164
     165        pD3D->pfnVBoxWineExD3DDev9GetHostId = (PFNVBOXWINEEXD3DDEV9_GETHOSTID)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DDev9GetHostId");
     166        if (!pD3D->pfnVBoxWineExD3DDev9GetHostId)
     167        {
     168            WARN(("no VBoxWineExD3DDev9GetHostId"));
    162169            break;
    163170        }
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.h

    r46783 r46966  
    8585    PFNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID pfnVBoxWineExD3DSwapchain9GetHostWinID;
    8686
     87    PFNVBOXWINEEXD3DDEV9_GETHOSTID pfnVBoxWineExD3DDev9GetHostId;
     88
    8789    /* module handle */
    8890    HMODULE hD3DLib;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp

    r46876 r46966  
    394394NTSTATUS vboxWddmSwapchainCtxEscape(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext, PVBOXDISPIFESCAPE_SWAPCHAININFO pSwapchainInfo, UINT cbSize)
    395395{
    396     Assert((cbSize >= RT_OFFSETOF(VBOXDISPIFESCAPE_SWAPCHAININFO, SwapchainInfo.ahAllocs[0])));
    397396    if (cbSize < RT_OFFSETOF(VBOXDISPIFESCAPE_SWAPCHAININFO, SwapchainInfo.ahAllocs[0]))
     397    {
     398        WARN(("invalid cbSize1 %d", cbSize));
    398399        return STATUS_INVALID_PARAMETER;
    399     Assert(cbSize >= RT_OFFSETOF(VBOXDISPIFESCAPE_SWAPCHAININFO, SwapchainInfo.ahAllocs[pSwapchainInfo->SwapchainInfo.cAllocs]));
     400    }
     401
    400402    if (cbSize < RT_OFFSETOF(VBOXDISPIFESCAPE_SWAPCHAININFO, SwapchainInfo.ahAllocs[pSwapchainInfo->SwapchainInfo.cAllocs]))
     403    {
    401404        return STATUS_INVALID_PARAMETER;
     405        WARN(("invalid cbSize2 %d", cbSize));
     406    }
    402407
    403408    if (!pSwapchainInfo->SwapchainInfo.winHostID)
    404409    {
    405410        WARN(("Zero winHostID specified!"));
     411        return STATUS_INVALID_PARAMETER;
     412    }
     413
     414    if (!pContext)
     415    {
     416        WARN(("vboxWddmSwapchainCtxEscape: no context specified"));
    406417        return STATUS_INVALID_PARAMETER;
    407418    }
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h

    r46757 r46966  
    228228    VBOXDISP_UMHANDLE hSwapchainUm;
    229229    VBOXDISP_KMHANDLE hSwapchainKm;
    230     UINT winHostID;
     230    int32_t winHostID;
    231231    BOOLEAN fExposed;
    232232    POINT Pos;
     
    244244    UINT  EngineAffinity;
    245245    BOOLEAN fRenderFromShadowDisabled;
     246    int32_t hostID;
    246247    uint32_t u32CrConClientID;
    247248    VBOXMP_CRPACKER CrPacker;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r46885 r46966  
    41104110                break;
    41114111            }
     4112            case VBOXESC_SETCTXHOSTID:
     4113            {
     4114                /* set swapchain information */
     4115                PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext;
     4116                if (!pContext)
     4117                {
     4118                    WARN(("VBOXESC_SETCTXHOSTID: no context specified"));
     4119                    Status = STATUS_INVALID_PARAMETER;
     4120                    break;
     4121                }
     4122
     4123                if (pEscape->PrivateDriverDataSize != sizeof (VBOXDISPIFESCAPE))
     4124                {
     4125                    WARN(("VBOXESC_SETCTXHOSTID: invalid data size %d", pEscape->PrivateDriverDataSize));
     4126                    Status = STATUS_INVALID_PARAMETER;
     4127                    break;
     4128                }
     4129
     4130                int32_t hostID = (int32_t)pEscapeHdr->u32CmdSpecific;
     4131                if (hostID <= 0)
     4132                {
     4133                    WARN(("VBOXESC_SETCTXHOSTID: invalid hostID %d", hostID));
     4134                    Status = STATUS_INVALID_PARAMETER;
     4135                    break;
     4136                }
     4137
     4138                if (pContext->hostID)
     4139                {
     4140                    WARN(("VBOXESC_SETCTXHOSTID: context already has hostID specified"));
     4141                    Status = STATUS_INVALID_PARAMETER;
     4142                    break;
     4143                }
     4144
     4145                pContext->hostID = hostID;
     4146                Status = STATUS_SUCCESS;
     4147                break;
     4148            }
    41124149            case VBOXESC_SWAPCHAININFO:
    41134150            {
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d9/d3d9wddm.def

    r46783 r46966  
    1313  Direct3DCreate9Ex
    1414  VBoxWineExD3DDev9Flush
    15   VBoxWineExD3DDev9FlushToHost
     15  VBoxWineExD3DDev9GetHostId
    1616  VBoxWineExD3DDev9Finish
    1717  VBoxWineExD3DDev9CreateTexture
     
    2525  VBoxWineExD3DSwapchain9GetHostWinID
    2626  VBoxWineExD3DSurf9SyncToHost
     27  VBoxWineExD3DDev9FlushToHost
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d9/device.c

    r46885 r46966  
    817817    wined3d_mutex_lock();
    818818    hr = wined3d_device_finish(device->wined3d_device);
     819    wined3d_mutex_unlock();
     820
     821    return hr;
     822}
     823
     824VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9GetHostId(IDirect3DDevice9Ex *iface, int32_t *pi32Id)
     825{
     826    struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
     827    HRESULT hr;
     828
     829    TRACE("iface %p, FlushToHost\n", iface);
     830
     831    wined3d_mutex_lock();
     832    hr = wined3d_device_get_host_id(device->wined3d_device, pi32Id);
    819833    wined3d_mutex_unlock();
    820834
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d9/swapchain.c

    r46757 r46966  
    307307}
    308308
    309 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9GetHostWinID(IDirect3DSwapChain9 *iface, DWORD *pID)
    310 {
    311     struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9(iface);
    312     HRESULT hr;
    313     wined3d_mutex_lock();
    314     hr = wined3d_swapchain_get_host_win_id(swapchain->wined3d_swapchain, pID);
     309VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9GetHostWinID(IDirect3DSwapChain9 *iface, int32_t *pi32Id)
     310{
     311    struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9(iface);
     312    HRESULT hr;
     313    wined3d_mutex_lock();
     314    hr = wined3d_swapchain_get_host_win_id(swapchain->wined3d_swapchain, pi32Id);
    315315    wined3d_mutex_unlock();
    316316    return hr;
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/VBoxWineEx.h

    r46783 r46966  
    7272typedef FNVBOXWINEEXD3DDEV9_FLUSHTOHOST *PFNVBOXWINEEXD3DDEV9_FLUSHTOHOST;
    7373
     74typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DDEV9_GETHOSTID(IDirect3DDevice9Ex *iface, int32_t *pi32Id);
     75typedef FNVBOXWINEEXD3DDEV9_GETHOSTID *PFNVBOXWINEEXD3DDEV9_GETHOSTID;
     76
    7477typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DDEV9_FINISH(IDirect3DDevice9Ex *iface);
    7578typedef FNVBOXWINEEXD3DDEV9_FINISH *PFNVBOXWINEEXD3DDEV9_FINISH;
     
    8790typedef FNVBOXWINEEXD3DSWAPCHAIN9_PRESENT *PFNVBOXWINEEXD3DSWAPCHAIN9_PRESENT;
    8891
    89 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID(IDirect3DSwapChain9 *iface, DWORD *pID);
     92typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID(IDirect3DSwapChain9 *iface, int32_t *pID);
    9093typedef FNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID *PFNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID;
    9194
     
    127130VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9FlushToHost(IDirect3DDevice9Ex *iface); /* flash data to host */
    128131
     132VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9GetHostId(IDirect3DDevice9Ex *iface, int32_t *pi32Id);
     133
    129134VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9Term(IDirect3DDevice9Ex *iface);
    130135
     
    139144                                IDirect3DSurface9 *surf); /* use the given surface as a frontbuffer content source */
    140145
    141 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9GetHostWinID(IDirect3DSwapChain9 *iface, DWORD *pID);
     146VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9GetHostWinID(IDirect3DSwapChain9 *iface, int32_t *pi32Id);
    142147
    143148typedef struct VBOXWINEEX_D3DPRESENT_PARAMETERS
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/libWineStub/include/wine/wined3d.h

    r46783 r46966  
    24792479HRESULT __cdecl wined3d_device_blt_vol(struct wined3d_device *device, struct wined3d_volume *src, struct wined3d_volume *dst, const struct wined3d_box *pSrcBoxArg, const struct VBOXPOINT3D *pDstPoin3D);
    24802480HRESULT __cdecl wined3d_device_blt_voltex(struct wined3d_device *device, struct wined3d_texture *src, struct wined3d_texture *dst, const struct wined3d_box *pSrcBoxArg, const struct VBOXPOINT3D *pDstPoin3D);
     2481HRESULT __cdecl wined3d_device_get_host_id(struct wined3d_device *device, int32_t *pid);
     2482
    24812483HRESULT __cdecl wined3d_surface_get_host_id(struct wined3d_surface *surface, uint32_t *id);
    24822484HRESULT __cdecl wined3d_surface_sync_to_host(struct wined3d_surface *surface);
    24832485
    24842486HRESULT __cdecl wined3d_swapchain_present_rt(struct wined3d_swapchain *swapchain, struct wined3d_surface *rt);
     2487HRESULT __cdecl wined3d_swapchain_get_host_win_id(struct wined3d_swapchain *swapchain, int32_t *pi32Id);
    24852488#endif
    24862489
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/device.c

    r46602 r46966  
    56885688
    56895689}
     5690
     5691HRESULT CDECL wined3d_device_get_host_id(struct wined3d_device *device, int32_t *pid)
     5692{
     5693    int32_t id = pVBoxGetContextId(device->contexts[0]->glCtx);
     5694    if (!id)
     5695    {
     5696        *pid = 0;
     5697        ERR("pVBoxGetContextId to get id for context 0x%x", device->contexts[0]->glCtx);
     5698        return E_FAIL;
     5699    }
     5700
     5701    *pid = id;
     5702    return WINED3D_OK;
     5703}
    56905704#endif
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/swapchain.c

    r46757 r46966  
    15361536}
    15371537
    1538 HRESULT CDECL wined3d_swapchain_get_host_win_id(struct wined3d_swapchain *swapchain, DWORD *pID)
    1539 {
    1540     DWORD id = (DWORD)pVBoxGetWindowId(swapchain->hDC);
     1538HRESULT CDECL wined3d_swapchain_get_host_win_id(struct wined3d_swapchain *swapchain, int32_t *pi32Id)
     1539{
     1540    int32_t id = pVBoxGetWindowId(swapchain->hDC);
    15411541    if (!id)
    15421542    {
     1543        *pi32Id = 0;
    15431544        ERR("failed to get id for hdc 0x%x", swapchain->hDC);
    15441545        return E_FAIL;
    15451546    }
    1546     *pID = id;
     1547    *pi32Id = id;
    15471548    return S_OK;
    15481549}
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_gl.h

    r46783 r46966  
    185185void (WINAPI *pVBoxFlushToHost)(HGLRC) DECLSPEC_HIDDEN;
    186186GLint (WINAPI *pVBoxGetWindowId)(HDC)  DECLSPEC_HIDDEN;
     187GLint (WINAPI *pVBoxGetContextId)(HGLRC)  DECLSPEC_HIDDEN;
    187188
    188189
     
    192193        VBOX_USE_FUNC(VBoxCreateContext) \
    193194        VBOX_USE_FUNC(VBoxFlushToHost) \
    194         VBOX_USE_FUNC(VBoxGetWindowId)
     195        VBOX_USE_FUNC(VBoxGetWindowId) \
     196        VBOX_USE_FUNC(VBoxGetContextId)
    195197
    196198# define VBOX_GL_EXT_FUNCS_GEN \
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3dwddm.def

    r46783 r46966  
    261261  wined3d_surface_sync_to_host
    262262  wined3d_swapchain_get_host_win_id
     263  wined3d_device_get_host_id
  • trunk/src/VBox/Additions/WINNT/include/VBoxDisplay.h

    r44557 r46966  
    3737# define VBOXESC_REINITVIDEOMODESBYMASK     0xABCD9010
    3838# define VBOXESC_ADJUSTVIDEOMODES           0xABCD9011
     39# define VBOXESC_SETCTXHOSTID               0xABCD9012
    3940#endif /* #ifdef VBOX_WITH_WDDM */
    4041
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