Changeset 46662 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Jun 19, 2013 2:22:29 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86552
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h
r44529 r46662 35 35 36 36 /* One would increase this whenever definitions in this file are changed */ 37 #define VBOXVIDEOIF_VERSION 1 537 #define VBOXVIDEOIF_VERSION 16 38 38 39 39 #define VBOXWDDM_NODE_ID_SYSTEM 0 … … 106 106 { 107 107 D3DDDI_RESOURCEFLAGS fFlags; 108 /* id used to identify the allocation on the host */ 109 uint32_t hostID; 108 110 uint64_t hSharedHandle; 109 111 VBOXWDDM_SURFACE_DESC SurfDesc; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r46606 r46662 4104 4104 bool bIssueCreateResource = false; 4105 4105 bool bCreateKMResource = false; 4106 bool bSetHostID = false; 4106 4107 4107 4108 pRc->hResource = pResource->hResource; … … 4185 4186 { 4186 4187 bIssueCreateResource = true; 4188 bSetHostID = true; 4187 4189 } 4188 4190 … … 4236 4238 pAllocInfo->hSharedHandle = (uint64_t)pAllocation->hSharedHandle; 4237 4239 pAllocInfo->SurfDesc = pAllocation->SurfDesc; 4240 if (bSetHostID) 4241 { 4242 IDirect3DSurface9 *pSurfIf = NULL; 4243 hr = VBoxD3DIfSurfGet(pRc, i, &pSurfIf); 4244 if (SUCCEEDED(hr)) 4245 { 4246 hr = pAdapter->D3D.D3D.pfnVBoxWineExD3DSurf9GetHostId(pSurfIf, &pAllocInfo->hostID); 4247 if (SUCCEEDED(hr)) 4248 { 4249 Assert(pAllocInfo->hostID); 4250 } 4251 else 4252 { 4253 WARN(("pfnVBoxWineExD3DSurf9GetHostId failed, hr 0x%x", hr)); 4254 break; 4255 } 4256 } 4257 else 4258 { 4259 WARN(("VBoxD3DIfSurfGet failed, hr 0x%x", hr)); 4260 break; 4261 } 4262 } 4263 else 4264 pAllocInfo->hostID = 0; 4238 4265 } 4239 4266 … … 4242 4269 Assert(pRc->fFlags.Generic); 4243 4270 4244 if (bCreateKMResource) 4245 { 4246 Assert(pRc->fFlags.KmResource); 4247 4248 hr = pDevice->RtCallbacks.pfnAllocateCb(pDevice->hDevice, pDdiAllocate); 4249 Assert(hr == S_OK); 4250 Assert(pDdiAllocate->hKMResource 4251 || pResource->Flags.SharedResource /* for some reason shared resources 4252 * are created with zero km resource handle on Win7+ */ 4253 ); 4254 } 4255 else 4256 { 4257 Assert(!pRc->fFlags.KmResource); 4258 4259 pDdiAllocate->hResource = NULL; 4260 pDdiAllocate->NumAllocations = 1; 4261 pDdiAllocate->PrivateDriverDataSize = 0; 4262 pDdiAllocate->pPrivateDriverData = NULL; 4263 D3DDDI_ALLOCATIONINFO *pDdiAllocIBase = pDdiAllocate->pAllocationInfo; 4264 4265 for (UINT i = 0; i < pResource->SurfCount; ++i) 4266 { 4267 pDdiAllocate->pAllocationInfo = &pDdiAllocIBase[i]; 4271 if (SUCCEEDED(hr)) 4272 { 4273 if (bCreateKMResource) 4274 { 4275 Assert(pRc->fFlags.KmResource); 4276 4268 4277 hr = pDevice->RtCallbacks.pfnAllocateCb(pDevice->hDevice, pDdiAllocate); 4269 4278 Assert(hr == S_OK); 4270 Assert(!pDdiAllocate->hKMResource); 4271 if (SUCCEEDED(hr)) 4279 Assert(pDdiAllocate->hKMResource 4280 || pResource->Flags.SharedResource /* for some reason shared resources 4281 * are created with zero km resource handle on Win7+ */ 4282 ); 4283 } 4284 else 4285 { 4286 Assert(!pRc->fFlags.KmResource); 4287 4288 pDdiAllocate->hResource = NULL; 4289 pDdiAllocate->NumAllocations = 1; 4290 pDdiAllocate->PrivateDriverDataSize = 0; 4291 pDdiAllocate->pPrivateDriverData = NULL; 4292 D3DDDI_ALLOCATIONINFO *pDdiAllocIBase = pDdiAllocate->pAllocationInfo; 4293 4294 for (UINT i = 0; i < pResource->SurfCount; ++i) 4272 4295 { 4273 Assert(pDdiAllocate->pAllocationInfo->hAllocation); 4296 pDdiAllocate->pAllocationInfo = &pDdiAllocIBase[i]; 4297 hr = pDevice->RtCallbacks.pfnAllocateCb(pDevice->hDevice, pDdiAllocate); 4298 Assert(hr == S_OK); 4299 Assert(!pDdiAllocate->hKMResource); 4300 if (SUCCEEDED(hr)) 4301 { 4302 Assert(pDdiAllocate->pAllocationInfo->hAllocation); 4303 } 4304 else 4305 { 4306 for (UINT j = 0; i < j; ++j) 4307 { 4308 D3DDDI_ALLOCATIONINFO * pCur = &pDdiAllocIBase[i]; 4309 D3DDDICB_DEALLOCATE Dealloc; 4310 Dealloc.hResource = 0; 4311 Dealloc.NumAllocations = 1; 4312 Dealloc.HandleList = &pCur->hAllocation; 4313 HRESULT tmpHr = pDevice->RtCallbacks.pfnDeallocateCb(pDevice->hDevice, &Dealloc); 4314 Assert(tmpHr == S_OK); 4315 } 4316 break; 4317 } 4274 4318 } 4275 else 4319 4320 pDdiAllocate->pAllocationInfo = pDdiAllocIBase; 4321 } 4322 4323 if (SUCCEEDED(hr)) 4324 { 4325 pRc->hKMResource = pDdiAllocate->hKMResource; 4326 4327 for (UINT i = 0; i < pResource->SurfCount; ++i) 4276 4328 { 4277 for (UINT j = 0; i < j; ++j) 4329 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 4330 D3DDDI_ALLOCATIONINFO *pDdiAllocI = &pDdiAllocate->pAllocationInfo[i]; 4331 PVBOXWDDM_ALLOCINFO pAllocInfo = (PVBOXWDDM_ALLOCINFO)pDdiAllocI->pPrivateDriverData; 4332 CONST D3DDDI_SURFACEINFO* pSurf = &pResource->pSurfList[i]; 4333 pAllocation->hAllocation = pDdiAllocI->hAllocation; 4334 pAllocation->enmType = VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC; 4335 pAllocation->pvMem = (void*)pSurf->pSysMem; 4336 pAllocation->SurfDesc = pAllocInfo->SurfDesc; 4337 4338 if (pResource->Flags.SharedResource) 4278 4339 { 4279 D3DDDI_ALLOCATIONINFO * pCur = &pDdiAllocIBase[i]; 4280 D3DDDICB_DEALLOCATE Dealloc; 4281 Dealloc.hResource = 0; 4282 Dealloc.NumAllocations = 1; 4283 Dealloc.HandleList = &pCur->hAllocation; 4284 HRESULT tmpHr = pDevice->RtCallbacks.pfnDeallocateCb(pDevice->hDevice, &Dealloc); 4285 Assert(tmpHr == S_OK); 4340 #ifdef VBOXWDDMDISP_DEBUG_PRINT_SHARED_CREATE 4341 Assert(VBOXWDDMDISP_IS_TEXTURE(pResource->Flags)); 4342 vboxVDbgPrint(("\n\n********\n(0x%x:0n%d)Shared CREATED pAlloc(0x%p), hRc(0x%p), hAl(0x%p), " 4343 "Handle(0x%x), (0n%d) \n***********\n\n", 4344 GetCurrentProcessId(), GetCurrentProcessId(), 4345 pAllocation, pRc->hKMResource, pAllocation->hAllocation, 4346 pAllocation->hSharedHandle, pAllocation->hSharedHandle 4347 )); 4348 #endif 4286 4349 } 4287 break;4288 4350 } 4289 } 4290 4291 pDdiAllocate->pAllocationInfo = pDdiAllocIBase; 4292 } 4293 4294 if (SUCCEEDED(hr)) 4295 { 4296 pRc->hKMResource = pDdiAllocate->hKMResource; 4297 4298 for (UINT i = 0; i < pResource->SurfCount; ++i) 4299 { 4300 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 4301 D3DDDI_ALLOCATIONINFO *pDdiAllocI = &pDdiAllocate->pAllocationInfo[i]; 4302 PVBOXWDDM_ALLOCINFO pAllocInfo = (PVBOXWDDM_ALLOCINFO)pDdiAllocI->pPrivateDriverData; 4303 CONST D3DDDI_SURFACEINFO* pSurf = &pResource->pSurfList[i]; 4304 pAllocation->hAllocation = pDdiAllocI->hAllocation; 4305 pAllocation->enmType = VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC; 4306 pAllocation->pvMem = (void*)pSurf->pSysMem; 4307 pAllocation->SurfDesc = pAllocInfo->SurfDesc; 4308 4309 if (pResource->Flags.SharedResource) 4310 { 4311 #ifdef VBOXWDDMDISP_DEBUG_PRINT_SHARED_CREATE 4312 Assert(VBOXWDDMDISP_IS_TEXTURE(pResource->Flags)); 4313 vboxVDbgPrint(("\n\n********\n(0x%x:0n%d)Shared CREATED pAlloc(0x%p), hRc(0x%p), hAl(0x%p), " 4314 "Handle(0x%x), (0n%d) \n***********\n\n", 4315 GetCurrentProcessId(), GetCurrentProcessId(), 4316 pAllocation, pRc->hKMResource, pAllocation->hAllocation, 4317 pAllocation->hSharedHandle, pAllocation->hSharedHandle 4318 )); 4319 #endif 4320 } 4321 } 4322 4323 VBOXVDBG_CREATE_CHECK_SWAPCHAIN(); 4351 4352 VBOXVDBG_CREATE_CHECK_SWAPCHAIN(); 4353 } 4324 4354 } 4325 4355 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.cpp
r46593 r46662 142 142 } 143 143 144 pD3D->pfnVBoxWineExD3DSurf9GetHostId = (PFNVBOXWINEEXD3DSURF9_GETHOSTID)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DSurf9GetHostId"); 145 if (!pD3D->pfnVBoxWineExD3DSurf9GetHostId) 146 { 147 WARN(("no VBoxWineExD3DSurf9GetHostId")); 148 break; 149 } 144 150 return S_OK; 145 151 … … 954 960 pFormats->cFormstOps = RT_ELEMENTS(gVBoxFormatOps3D); 955 961 } 956 957 958 //#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001959 //#define D3DPMISCCAPS_FOGINFVF 0x00002000960 //#define D3DPRASTERCAPS_SUBPIXEL 0x00000020961 //#define D3DPRASTERCAPS_STIPPLE 0x00000200962 //#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008963 962 964 963 static HRESULT vboxWddmGetD3D9Caps(PVBOXWDDMDISP_D3D pD3D, D3DCAPS9 *pCaps) -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.h
r44529 r46662 79 79 PFNVBOXWINEEXD3DDEV9_FINISH pfnVBoxWineExD3DDev9Finish; 80 80 81 PFNVBOXWINEEXD3DSURF9_GETHOSTID pfnVBoxWineExD3DSurf9GetHostId; 82 81 83 /* module handle */ 82 84 HMODULE hD3DLib; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r44529 r46662 160 160 KSPIN_LOCK OpenLock; 161 161 LIST_ENTRY OpenList; 162 uint32_t hostID; 162 163 /* helps tracking when to release wine shared resource */ 163 164 uint32_t cShRcRefs; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r45403 r46662 2273 2273 pAllocation->fRcFlags = pAllocInfo->fFlags; 2274 2274 pAllocation->AllocData.SurfDesc = pAllocInfo->SurfDesc; 2275 pAllocation->hostID = pAllocInfo->hostID; 2275 2276 2276 2277 pAllocationInfo->Size = pAllocInfo->SurfDesc.cbSize; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d9/d3d9wddm.def
r46521 r46662 22 22 VBoxWineExD3DDev9VolBlt 23 23 VBoxWineExD3DDev9VolTexBlt 24 VBoxWineExD3DSurf9GetHostId -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d9/surface.c
r46521 r46662 458 458 return impl_from_IDirect3DSurface9(iface); 459 459 } 460 461 #ifdef VBOX_WITH_WDDM 462 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSurf9GetHostId(IDirect3DSurface9 *iface, uint32_t *pu32Id) 463 { 464 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); 465 HRESULT hr; 466 wined3d_mutex_lock(); 467 hr = wined3d_surface_get_host_id(surface->wined3d_surface, pu32Id); 468 wined3d_mutex_unlock(); 469 return hr; 470 } 471 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/VBoxWineEx.h
r46521 r46662 78 78 typedef FNVBOXWINEEXD3DDEV9_TERM *PFNVBOXWINEEXD3DDEV9_TERM; 79 79 80 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DSURF9_GETHOSTID(IDirect3DSurface9 *iface, uint32_t *pu32Id); 81 typedef FNVBOXWINEEXD3DSURF9_GETHOSTID *PFNVBOXWINEEXD3DSURF9_GETHOSTID; 82 80 83 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DSWAPCHAIN9_PRESENT(IDirect3DSwapChain9 *iface, IDirect3DSurface9 *surf); 81 84 typedef FNVBOXWINEEXD3DSWAPCHAIN9_PRESENT *PFNVBOXWINEEXD3DSWAPCHAIN9_PRESENT; … … 120 123 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9Term(IDirect3DDevice9Ex *iface); 121 124 125 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSurf9GetHostId(IDirect3DSurface9 *iface, uint32_t *pu32Id); 126 122 127 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9Present(IDirect3DSwapChain9 *iface, 123 128 IDirect3DSurface9 *surf); /* use the given surface as a frontbuffer content source */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/libWineStub/include/wine/wined3d.h
r46521 r46662 2479 2479 HRESULT __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); 2480 2480 HRESULT __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); 2481 HRESULT __cdecl wined3d_surface_get_host_id(struct wined3d_surface *surface, uint32_t *id); 2481 2482 2482 2483 HRESULT __cdecl wined3d_swapchain_present_rt(struct wined3d_swapchain *swapchain, struct wined3d_surface *rt); 2483 2484 2484 #endif 2485 2485 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/surface.c
r46521 r46662 7767 7767 return hr; 7768 7768 } 7769 7770 #ifdef VBOX_WITH_WDDM 7771 HRESULT CDECL wined3d_surface_get_host_id(struct wined3d_surface *surface, uint32_t *id) 7772 { 7773 struct wined3d_texture *texture; 7774 surface_internal_preload(surface, SRGB_RGB); 7775 7776 texture = surface->container; 7777 if (texture && texture->level_count != 1 && texture->layer_count != 1) 7778 { 7779 ERR("unsupported level(%d) or layer(%d) count", texture->level_count, texture->layer_count); 7780 } 7781 7782 if (!surface->texture_name) 7783 { 7784 ERR("no texture name!"); 7785 return E_FAIL; 7786 } 7787 7788 *id = surface->texture_name; 7789 return S_OK; 7790 } 7791 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3dwddm.def
r46521 r46662 258 258 wined3d_device_blt_voltex 259 259 wined3d_swapchain_present_rt 260 260 wined3d_surface_get_host_id
Note:
See TracChangeset
for help on using the changeset viewer.