儲存庫 vbox 的更動 30916
- 時間撮記:
- 2010-7-19 下午08:32:01 (14 年 以前)
- 位置:
- trunk/src/VBox/Additions/WINNT/Graphics
- 檔案:
-
- 修改 21 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r30885 r30916 1889 1889 HRESULT hr = S_OK; 1890 1890 1891 #ifdef DEBUG_misha1892 uint32_t iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations;1893 vboxVDbgDumpSurfData((pDevice, ">>>DrawPrimitive:\n", pDevice->pRenderTargetRc, iBackBuf,1894 NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n"));1895 #endif1891 //#ifdef DEBUG_misha 1892 // uint32_t iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations; 1893 // vboxVDbgDumpSurfData((pDevice, ">>>DrawPrimitive:\n", pDevice->pRenderTargetRc, iBackBuf, 1894 // NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n")); 1895 //#endif 1896 1896 1897 1897 if (!pDevice->cStreamSources) … … 1911 1911 Assert(hr == S_OK); 1912 1912 1913 vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitiveUP\n"));1913 // vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitiveUP\n")); 1914 1914 } 1915 1915 else … … 1946 1946 Assert(hr == S_OK); 1947 1947 1948 vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitive\n"));1948 // vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitive\n")); 1949 1949 #if 0 1950 1950 IDirect3DVertexDeclaration9* pDecl; … … 2156 2156 } 2157 2157 2158 #ifdef DEBUG_misha2159 iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations;2160 vboxVDbgDumpSurfData((pDevice, "<<<DrawPrimitive:\n", pDevice->pRenderTargetRc, iBackBuf,2161 NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n"));2162 #endif2158 //#ifdef DEBUG_misha 2159 // iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations; 2160 // vboxVDbgDumpSurfData((pDevice, "<<<DrawPrimitive:\n", pDevice->pRenderTargetRc, iBackBuf, 2161 // NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n")); 2162 //#endif 2163 2163 2164 2164 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); … … 2172 2172 Assert(pDevice); 2173 2173 Assert(pDevice->pDevice9If); 2174 #ifdef DEBUG_misha2175 uint32_t iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations;2176 vboxVDbgDumpSurfData((pDevice, ">>>DrawIndexedPrimitive:\n", pDevice->pRenderTargetRc, iBackBuf,2177 NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n"));2178 #endif2174 //#ifdef DEBUG_misha 2175 // uint32_t iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations; 2176 // vboxVDbgDumpSurfData((pDevice, ">>>DrawIndexedPrimitive:\n", pDevice->pRenderTargetRc, iBackBuf, 2177 // NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n")); 2178 //#endif 2179 2179 2180 2180 #ifdef DEBUG … … 2210 2210 Assert(hr == S_OK); 2211 2211 2212 #ifdef DEBUG_misha2213 iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations;2214 vboxVDbgDumpSurfData((pDevice, "<<<DrawIndexedPrimitive:\n", pDevice->pRenderTargetRc, iBackBuf,2215 NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n"));2216 #endif2212 //#ifdef DEBUG_misha 2213 // iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations; 2214 // vboxVDbgDumpSurfData((pDevice, "<<<DrawIndexedPrimitive:\n", pDevice->pRenderTargetRc, iBackBuf, 2215 // NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n")); 2216 //#endif 2217 2217 2218 2218 … … 2274 2274 hr = pDevice->pDevice9If->DrawPrimitive(pData->PrimitiveType, pData->FirstVertexOffset, pData->PrimitiveCount); 2275 2275 #else 2276 #ifdef DEBUG_misha2277 uint32_t iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations;2278 vboxVDbgDumpSurfData((pDevice, ">>>DrawPrimitive2:\n", pDevice->pRenderTargetRc, iBackBuf,2279 NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n"));2280 #endif2276 //#ifdef DEBUG_misha 2277 // uint32_t iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations; 2278 // vboxVDbgDumpSurfData((pDevice, ">>>DrawPrimitive2:\n", pDevice->pRenderTargetRc, iBackBuf, 2279 // NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n")); 2280 //#endif 2281 2281 2282 2282 #ifdef DEBUG … … 2298 2298 if (pDevice->aStreamSource[stream]->LockInfo.cLocks) 2299 2299 { 2300 vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitiveUP\n"));2300 // vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitiveUP\n")); 2301 2301 2302 2302 Assert(pLock->fFlags.MightDrawFromLocked && (pLock->fFlags.Discard || pLock->fFlags.NoOverwrite)); … … 2310 2310 else 2311 2311 { 2312 vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitive\n"));2312 // vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitive\n")); 2313 2313 2314 2314 hr = pDevice->pDevice9If->DrawPrimitive(pData->PrimitiveType, pData->FirstVertexOffset/pDevice->StreamSourceInfo[stream].uiStride, pData->PrimitiveCount); … … 2324 2324 #endif 2325 2325 2326 #ifdef DEBUG_misha2327 iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations;2328 vboxVDbgDumpSurfData((pDevice, "<<<DrawPrimitive2:\n", pDevice->pRenderTargetRc, iBackBuf,2329 NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n"));2330 #endif2326 //#ifdef DEBUG_misha 2327 // iBackBuf = (pDevice->iRenderTargetFrontBuf + 1) % pDevice->pRenderTargetRc->cAllocations; 2328 // vboxVDbgDumpSurfData((pDevice, "<<<DrawPrimitive2:\n", pDevice->pRenderTargetRc, iBackBuf, 2329 // NULL, (IDirect3DSurface9*)pDevice->pRenderTargetRc->aAllocations[iBackBuf].pD3DIf, "\n")); 2330 //#endif 2331 2331 2332 2332 Assert(hr == S_OK); … … 2679 2679 Assert(pLockAlloc->pvMem); 2680 2680 Assert(pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM); 2681 2681 #if 0 2682 2682 if (bNeedResynch) 2683 2683 vboxWddmLockUnlockMemSynch(pLockAlloc, &pLockAlloc->LockInfo.LockedRect, pRect, false /*bool bToLockInfo*/); 2684 #endif 2684 2685 } 2685 2686 } … … 2983 2984 Assert(pD3DIfTex); 2984 2985 /* this is a sysmem texture, update */ 2986 #if 0 2985 2987 if (pLockAlloc->pvMem && !pLockAlloc->LockInfo.fFlags.ReadOnly) 2986 2988 { … … 2989 2991 true /*bool bToLockInfo*/); 2990 2992 } 2993 #endif 2991 2994 hr = pD3DIfTex->UnlockRect(pData->SubResourceIndex); 2992 2995 Assert(hr == S_OK); … … 3407 3410 CONST D3DDDI_SURFACEINFO* pSurf = &pResource->pSurfList[0]; 3408 3411 IDirect3DTexture9 *pD3DIfTex; 3412 #if 0 3409 3413 hr = pDevice->pDevice9If->CreateTexture(pSurf->Width, 3410 3414 pSurf->Height, … … 3416 3420 NULL /* HANDLE* pSharedHandle */ 3417 3421 ); 3422 #else 3423 hr = pDevice->pAdapter->D3D.pfnVBoxWineExD3DDev9CreateTexture((IDirect3DDevice9Ex *)pDevice->pDevice9If, 3424 pSurf->Width, 3425 pSurf->Height, 3426 pResource->SurfCount, 3427 vboxDDI2D3DUsage(pResource->Flags), 3428 vboxDDI2D3DFormat(pResource->Format), 3429 vboxDDI2D3DPool(pResource->Pool), 3430 &pD3DIfTex, 3431 NULL /* HANDLE* pSharedHandle */, 3432 pResource->Pool == D3DDDIPOOL_SYSTEMMEM ? pRc->aAllocations[0].pvMem : NULL); 3433 #endif 3418 3434 Assert(hr == S_OK); 3419 3435 if (hr == S_OK) … … 3422 3438 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_TEXTURE; 3423 3439 pAllocation->pD3DIf = pD3DIfTex; 3440 #if 0 3424 3441 if (pResource->Pool == D3DDDIPOOL_SYSTEMMEM) 3425 3442 { … … 3444 3461 } 3445 3462 } 3463 #endif 3446 3464 } 3447 3465 #ifdef DEBUG … … 4209 4227 Assert(pDstRc->cAllocations > pData->DstSubResourceIndex); 4210 4228 Assert(pSrcRc->cAllocations > pData->SrcSubResourceIndex); 4211 // Assert(pSrcRc->RcDesc.enmPool != D3DDDIPOOL_SYSTEMMEM);4212 /* @todo: use UpdateRect in case of Src is a D3DDDIPOOL_SYSTEMMEM */4213 Assert(pDstRc->RcDesc.enmPool != D3DDDIPOOL_SYSTEMMEM);4214 4229 Assert(pDstRc != pDevice->pRenderTargetRc || pDevice->iRenderTargetFrontBuf != pData->DstSubResourceIndex); 4215 4230 HRESULT hr = S_OK; … … 4284 4299 { 4285 4300 Assert(pSrcSurfIf); 4286 4287 //#ifdef DEBUG_misha 4288 // vboxVDbgDumpSurfData((pDevice, "Blt-pre Src:\n", pSrcRc, pData->SrcSubResourceIndex, &pData->SrcRect, pSrcSurfIf, "\n")); 4289 // vboxVDbgDumpSurfData((pDevice, "Blt-pre Dst:\n", pDstRc, pData->DstSubResourceIndex, &pData->DstRect, pDstSurfIf, "\n")); 4290 //#endif 4301 #ifdef DEBUG_misha 4302 bool bDo = false; 4303 4304 if (g_VDbgTstDumpEnable) 4305 { 4306 if (g_VDbgTstDumpOnSys2VidSameSizeEnable) 4307 { 4308 if (pDstRc->RcDesc.enmPool != D3DDDIPOOL_SYSTEMMEM 4309 && pSrcRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM) 4310 { 4311 D3DSURFACE_DESC SrcDesc; 4312 HRESULT hr = pSrcSurfIf->GetDesc(&SrcDesc); 4313 Assert(hr == S_OK); 4314 if (hr == S_OK) 4315 { 4316 D3DSURFACE_DESC DstDesc; 4317 hr = pDstSurfIf->GetDesc(&DstDesc); 4318 Assert(hr == S_OK); 4319 if (hr == S_OK) 4320 { 4321 if (SrcDesc.Width == DstDesc.Width 4322 && SrcDesc.Height == DstDesc.Height) 4323 { 4324 bDo = true; 4325 } 4326 } 4327 } 4328 } 4329 } 4330 } 4331 4332 if (bDo) 4333 { 4334 vboxVDbgDumpSurfData((pDevice, "Blt-pre Src:\n", pSrcRc, pData->SrcSubResourceIndex, &pData->SrcRect, pSrcSurfIf, "\n")); 4335 vboxVDbgDumpSurfData((pDevice, "Blt-pre Dst:\n", pDstRc, pData->DstSubResourceIndex, &pData->DstRect, pDstSurfIf, "\n")); 4336 } 4337 #endif 4291 4338 /* we support only Point & Linear, we ignore [Begin|Continue|End]PresentToDwm */ 4292 4339 Assert((pData->Flags.Value & (~(0x00000100 | 0x00000200 | 0x00000400 | 0x00000001 | 0x00000002))) == 0); … … 4298 4345 Assert(hr == S_OK); 4299 4346 4300 //#ifdef DEBUG_misha 4301 // vboxVDbgDumpSurfData((pDevice, "Blt-post Src:\n", pSrcRc, pData->SrcSubResourceIndex, &pData->SrcRect, pSrcSurfIf, "\n")); 4302 // vboxVDbgDumpSurfData((pDevice, "Blt-post Dst:\n", pDstRc, pData->DstSubResourceIndex, &pData->DstRect, pDstSurfIf, "\n")); 4303 //#endif 4347 #ifdef DEBUG_misha 4348 if (bDo) 4349 { 4350 vboxVDbgDumpSurfData((pDevice, "Blt-post Src:\n", pSrcRc, pData->SrcSubResourceIndex, &pData->SrcRect, pSrcSurfIf, "\n")); 4351 vboxVDbgDumpSurfData((pDevice, "Blt-post Dst:\n", pDstRc, pData->DstSubResourceIndex, &pData->DstRect, pDstSurfIf, "\n")); 4352 } 4353 #endif 4304 4354 pSrcSurfIf->Release(); 4305 4355 } … … 5369 5419 5370 5420 #ifdef VBOXWDDMDISP_DEBUG 5421 5422 bool g_VDbgTstDumpEnable = false; 5423 bool g_VDbgTstDumpOnSys2VidSameSizeEnable = false; 5424 5371 5425 VOID vboxVDbgDoDumpSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, IDirect3DSurface9 *pSurf, const char* pSuffix) 5372 5426 { … … 5411 5465 { 5412 5466 vboxVDbgMpPrint((pDevice, "%s\n", pSuffix)); 5467 } 5468 } 5469 5470 VOID vboxVDbgDoDumpSurfDataBySurf(const PVBOXWDDMDISP_DEVICE pDevice, IDirect3DSurface9 *pSurf) 5471 { 5472 D3DSURFACE_DESC Desc; 5473 HRESULT hr = pSurf->GetDesc(&Desc); 5474 Assert(hr == S_OK); 5475 if (hr == S_OK) 5476 { 5477 D3DLOCKED_RECT Lr; 5478 hr = pSurf->LockRect(&Lr, NULL, D3DLOCK_READONLY); 5479 Assert(hr == S_OK); 5480 if (hr == S_OK) 5481 { 5482 UINT bpp = vboxWddmCalcBitsPerPixel((D3DDDIFORMAT)Desc.Format); 5483 vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n", 5484 Lr.pBits, Desc.Width, Desc.Height, bpp, Lr.Pitch)); 5485 5486 Assert(0); 5487 5488 hr = pSurf->UnlockRect(); 5489 Assert(hr == S_OK); 5490 } 5413 5491 } 5414 5492 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DCmn.h
r30885 r30916 38 38 # define VBOXWDDMDISP_DEBUG 39 39 # define VBOXWDDMDISP_DEBUG_FLOW 40 //# define VBOXWDDMDISP_DEBUG_DUMPSURFDATA40 # define VBOXWDDMDISP_DEBUG_DUMPSURFDATA 41 41 #endif 42 42 … … 57 57 58 58 #ifdef VBOXWDDMDISP_DEBUG 59 extern bool g_VDbgTstDumpEnable; 60 extern bool g_VDbgTstDumpOnSys2VidSameSizeEnable; 61 59 62 VOID vboxVDbgDoDumpSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, IDirect3DSurface9 *pSurf, const char* pSuffix); 60 63 void vboxVDbgDoMpPrintRect(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const RECT *pRect, const char * pSuffix); -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DIf.cpp
r30685 r30916 34 34 Assert(pD3D->pfnDirect3DCreate9Ex); 35 35 if (pD3D->pfnDirect3DCreate9Ex) 36 return S_OK; 36 { 37 pD3D->pfnVBoxWineExD3DDev9CreateTexture = (PFNVBOXWINEEXD3DDEV9_CREATETEXTURE)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DDev9CreateTexture"); 38 Assert(pD3D->pfnVBoxWineExD3DDev9CreateTexture); 39 if (pD3D->pfnVBoxWineExD3DDev9CreateTexture) 40 { 41 return S_OK; 42 } 43 } 37 44 else 38 45 { -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DIf.h
r30038 r30916 22 22 #include <D3D9.h> 23 23 24 #include "../../Wine/vbox/VBoxWineEx.h" 25 24 26 /* D3D functionality the VBOXDISPD3D provides */ 25 27 typedef HRESULT WINAPI FNVBOXDISPD3DCREATE9EX(UINT SDKVersion, IDirect3D9Ex **ppD3D); … … 30 32 /* D3D functionality the VBOXDISPD3D provides */ 31 33 PFNVBOXDISPD3DCREATE9EX pfnDirect3DCreate9Ex; 34 35 PFNVBOXWINEEXD3DDEV9_CREATETEXTURE pfnVBoxWineExD3DDev9CreateTexture; 32 36 33 37 /* module handle */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/Makefile.kmk
r30721 r30916 186 186 VBoxD3D8_DEFS += WINE_NO_DEBUG_MSGS 187 187 endif 188 #ifdef VBOXWDDM 189 # VBoxD3D8_DEFS += VBOXWDDM IN_VBOXWINEEX 190 #endif 188 191 VBoxD3D8_INCS := $(PATH_SUB_CURRENT)/include 189 192 VBoxD3D8_SOURCES := \ … … 206 209 $(PATH_LIB)/libWine$(VBOX_SUFF_LIB) \ 207 210 $(PATH_LIB)/wined3d$(VBOX_SUFF_LIB) 208 209 211 DLLS += VBoxD3D9 210 212 … … 220 222 ifneq ($(KBUILD_TYPE),debug) 221 223 VBoxD3D9_DEFS += WINE_NO_DEBUG_MSGS 224 endif 225 ifdef VBOXWDDM 226 VBoxD3D9_DEFS += VBOXWDDM IN_VBOXWINEEX 222 227 endif 223 228 VBoxD3D9_INCS := $(PATH_SUB_CURRENT)/include -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9.def
r20612 r30916 15 15 Direct3DCreate9@4=Direct3DCreate9 16 16 Direct3DCreate9Ex@8=Direct3DCreate9Ex 17 VBoxWineExD3DDev9CreateTexture -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9_private.h
r28475 r30916 47 47 #include "d3d9.h" 48 48 #include "wine/wined3d.h" 49 50 #ifdef VBOXWDDM 51 #include "../vbox/VBoxWineEx.h" 52 #endif 49 53 50 54 /* =========================================================================== … … 316 320 HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *device, 317 321 UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level, 318 DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) DECLSPEC_HIDDEN; 322 DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality 323 #ifdef VBOXWDDM 324 , HANDLE *shared_handle 325 , void *pvClientMem 326 #endif 327 ) DECLSPEC_HIDDEN; 319 328 320 329 /* ---------------------- */ … … 428 437 429 438 HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *device, 430 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN; 439 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool 440 #ifdef VBOXWDDM 441 , HANDLE *shared_handle 442 , void *pvClientMem 443 #endif 444 ) DECLSPEC_HIDDEN; 431 445 432 446 /* ----------------------- */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/device.c
r28475 r30916 713 713 } 714 714 715 #ifdef VBOXWDDM 716 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9CreateTexture(IDirect3DDevice9Ex *iface, 717 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, 718 D3DPOOL pool, IDirect3DTexture9 **texture, HANDLE *shared_handle, 719 void *pvClientMem) /* <- extension arg to pass in the client memory buffer, 720 * applicable ONLY for SYSMEM textures */ 721 { 722 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; 723 IDirect3DTexture9Impl *object; 724 HRESULT hr; 725 726 TRACE("iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n", 727 iface, width, height, levels, usage, format, pool, texture, shared_handle); 728 729 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); 730 if (!object) 731 { 732 ERR("Failed to allocate texture memory.\n"); 733 return D3DERR_OUTOFVIDEOMEMORY; 734 } 735 736 hr = texture_init(object, This, width, height, levels, usage, format, pool 737 #ifdef VBOXWDDM 738 , shared_handle 739 , pvClientMem 740 #endif 741 ); 742 if (FAILED(hr)) 743 { 744 WARN("Failed to initialize texture, hr %#x.\n", hr); 745 HeapFree(GetProcessHeap(), 0, object); 746 return hr; 747 } 748 749 TRACE("Created texture %p.\n", object); 750 *texture = (IDirect3DTexture9 *)object; 751 752 return D3D_OK; 753 } 754 #endif 755 715 756 static HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(IDirect3DDevice9Ex *iface, 716 757 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, 717 758 D3DPOOL pool, IDirect3DTexture9 **texture, HANDLE *shared_handle) 718 759 { 760 #ifdef VBOXWDDM 761 return VBoxWineExD3DDev9CreateTexture(iface, width, height, levels, usage, format, 762 pool, texture, shared_handle, NULL); 763 #else 719 764 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; 720 765 IDirect3DTexture9Impl *object; … … 743 788 744 789 return D3D_OK; 790 #endif 745 791 } 746 792 … … 873 919 } 874 920 875 static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, 921 #ifdef VBOXWDDM 922 HRESULT VBoxWineExD3DDev9CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, 876 923 D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface, 877 UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality) 924 UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality 925 , HANDLE *shared_handle 926 , void *pvClientMem 927 ) 878 928 { 879 929 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; … … 894 944 895 945 hr = surface_init(object, This, Width, Height, Format, Lockable, Discard, 896 Level, Usage, Pool, MultiSample, MultisampleQuality); 946 Level, Usage, Pool, MultiSample, MultisampleQuality, 947 shared_handle, pvClientMem); 897 948 if (FAILED(hr)) 898 949 { … … 906 957 907 958 return D3D_OK; 959 } 960 #endif 961 static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, 962 D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface, 963 UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality) 964 { 965 #ifdef VBOXWDDM 966 return VBoxWineExD3DDev9CreateSurface(iface, Width, Height, Format, Lockable, Discard, Level, ppSurface, 967 Usage, Pool, MultiSample, MultisampleQuality, NULL, NULL); 968 #else 969 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; 970 IDirect3DSurface9Impl *object; 971 HRESULT hr; 972 973 TRACE("iface %p, width %u, height %u, format %#x, lockable %#x, discard %#x, level %u, surface %p.\n" 974 "usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n", 975 iface, Width, Height, Format, Lockable, Discard, Level, ppSurface, 976 Usage, Pool, MultiSample, MultisampleQuality); 977 978 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface9Impl)); 979 if (!object) 980 { 981 FIXME("Failed to allocate surface memory.\n"); 982 return D3DERR_OUTOFVIDEOMEMORY; 983 } 984 985 hr = surface_init(object, This, Width, Height, Format, Lockable, Discard, 986 Level, Usage, Pool, MultiSample, MultisampleQuality); 987 if (FAILED(hr)) 988 { 989 WARN("Failed to initialize surface, hr %#x.\n", hr); 990 HeapFree(GetProcessHeap(), 0, object); 991 return hr; 992 } 993 994 TRACE("Created surface %p.\n", object); 995 *ppSurface = (IDirect3DSurface9 *)object; 996 997 return D3D_OK; 998 #endif 908 999 } 909 1000 … … 2630 2721 static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParent *iface, 2631 2722 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, DWORD usage, 2632 WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface) 2723 WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface 2724 #ifdef VBOXWDDM 2725 , HANDLE *shared_handle 2726 , void *pvClientMem 2727 #endif 2728 ) 2633 2729 { 2634 2730 struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); … … 2644 2740 lockable = FALSE; 2645 2741 2742 #ifdef VBOXWDDM 2743 hr = VBoxWineExD3DDev9CreateSurface((IDirect3DDevice9Ex *)This, width, height, 2744 d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level, 2745 (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */ 2746 , shared_handle 2747 , pvClientMem 2748 ); 2749 2750 #else 2646 2751 hr = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)This, width, height, 2647 2752 d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level, 2648 (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */); 2753 (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */ 2754 ); 2755 #endif 2649 2756 if (FAILED(hr)) 2650 2757 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/surface.c
r25949 r30916 381 381 HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *device, 382 382 UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level, 383 DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) 383 DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality 384 #ifdef VBOXWDDM 385 , HANDLE *shared_handle 386 , void *pvClientMem 387 #endif 388 ) 384 389 { 385 390 HRESULT hr; … … 412 417 413 418 wined3d_mutex_lock(); 419 #ifdef VBOXWDDM 420 hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format), 421 lockable, discard, level, &surface->wineD3DSurface, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, 422 multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface, 423 &d3d9_surface_wined3d_parent_ops 424 , shared_handle 425 , pvClientMem 426 ); 427 #else 414 428 hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format), 415 429 lockable, discard, level, &surface->wineD3DSurface, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, 416 430 multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface, 417 431 &d3d9_surface_wined3d_parent_ops); 432 #endif 418 433 wined3d_mutex_unlock(); 419 434 if (FAILED(hr)) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/texture.c
r25949 r30916 398 398 399 399 HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *device, 400 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) 400 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool 401 #ifdef VBOXWDDM 402 , HANDLE *shared_handle 403 , void *pvClientMem 404 #endif 405 ) 401 406 { 402 407 HRESULT hr; … … 406 411 407 412 wined3d_mutex_lock(); 413 #ifdef VBOXWDDM 414 hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels, 415 usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool, 416 &texture->wineD3DTexture, (IUnknown *)texture, &d3d9_texture_wined3d_parent_ops 417 , shared_handle 418 , pvClientMem); 419 #else 408 420 hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels, 409 421 usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool, 410 422 &texture->wineD3DTexture, (IUnknown *)texture, &d3d9_texture_wined3d_parent_ops); 423 #endif 424 411 425 wined3d_mutex_unlock(); 412 426 if (FAILED(hr)) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wine/wined3d.h
r28475 r30916 2689 2689 UINT level, 2690 2690 WINED3DCUBEMAP_FACES face, 2691 IWineD3DSurface **surface); 2691 IWineD3DSurface **surface 2692 #ifdef VBOXWDDM 2693 , HANDLE *shared_handle 2694 , void *pvClientMem 2695 #endif 2696 ); 2692 2697 2693 2698 HRESULT (STDMETHODCALLTYPE *CreateRenderTarget)( … … 2742 2747 /*** IWineD3DDeviceParent methods ***/ 2743 2748 #define IWineD3DDeviceParent_WineD3DDeviceCreated(This,device) (This)->lpVtbl->WineD3DDeviceCreated(This,device) 2749 #ifdef VBOXWDDM 2750 #define IWineD3DDeviceParent_CreateSurface(This,superior,width,height,format,usage,pool,level,face,surface,shared_handle,pvClientMem) (This)->lpVtbl->CreateSurface(This,superior,width,height,format,usage,pool,level,face,surface,shared_handle,pvClientMem) 2751 #else 2744 2752 #define IWineD3DDeviceParent_CreateSurface(This,superior,width,height,format,usage,pool,level,face,surface) (This)->lpVtbl->CreateSurface(This,superior,width,height,format,usage,pool,level,face,surface) 2753 #endif 2745 2754 #define IWineD3DDeviceParent_CreateRenderTarget(This,superior,width,height,format,multisample_type,multisample_quality,lockable,surface) (This)->lpVtbl->CreateRenderTarget(This,superior,width,height,format,multisample_type,multisample_quality,lockable,surface) 2746 2755 #define IWineD3DDeviceParent_CreateDepthStencilSurface(This,superior,width,height,format,multisample_type,multisample_quality,discard,surface) (This)->lpVtbl->CreateDepthStencilSurface(This,superior,width,height,format,multisample_type,multisample_quality,discard,surface) … … 7356 7365 WINED3DSURFTYPE surface_type, 7357 7366 IUnknown *parent, 7358 const struct wined3d_parent_ops *parent_ops); 7367 const struct wined3d_parent_ops *parent_ops 7368 #ifdef VBOXWDDM 7369 , HANDLE *shared_handle 7370 , void *pvClientMem 7371 #endif 7372 ); 7359 7373 7360 7374 HRESULT (STDMETHODCALLTYPE *CreateRendertargetView)( … … 7374 7388 IWineD3DTexture **texture, 7375 7389 IUnknown *parent, 7376 const struct wined3d_parent_ops *parent_ops); 7390 const struct wined3d_parent_ops *parent_ops 7391 #ifdef VBOXWDDM 7392 , HANDLE *shared_handle 7393 , void *pvClientMem 7394 #endif 7395 ); 7377 7396 7378 7397 HRESULT (STDMETHODCALLTYPE *CreateVolumeTexture)( … … 8054 8073 #define IWineD3DDevice_CreateIndexBuffer(This,length,usage,pool,index_buffer,parent,parent_ops) (This)->lpVtbl->CreateIndexBuffer(This,length,usage,pool,index_buffer,parent,parent_ops) 8055 8074 #define IWineD3DDevice_CreateStateBlock(This,type,stateblock,parent) (This)->lpVtbl->CreateStateBlock(This,type,stateblock,parent) 8075 #ifdef VBOXWDDM 8076 #define IWineD3DDevice_CreateSurface(This,width,height,format,lockable,discard,level,surface,usage,pool,multisample_type,multisample_quality,surface_type,parent,parent_ops,shared_handle,pvClientMem) (This)->lpVtbl->CreateSurface(This,width,height,format,lockable,discard,level,surface,usage,pool,multisample_type,multisample_quality,surface_type,parent,parent_ops,shared_handle,pvClientMem) 8077 #else 8056 8078 #define IWineD3DDevice_CreateSurface(This,width,height,format,lockable,discard,level,surface,usage,pool,multisample_type,multisample_quality,surface_type,parent,parent_ops) (This)->lpVtbl->CreateSurface(This,width,height,format,lockable,discard,level,surface,usage,pool,multisample_type,multisample_quality,surface_type,parent,parent_ops) 8079 #endif 8057 8080 #define IWineD3DDevice_CreateRendertargetView(This,resource,parent,rendertarget_view) (This)->lpVtbl->CreateRendertargetView(This,resource,parent,rendertarget_view) 8081 #ifdef VBOXWDDM 8082 #define IWineD3DDevice_CreateTexture(This,width,height,levels,usage,format,pool,texture,parent,parent_ops,shared_handle,pvClientMem) (This)->lpVtbl->CreateTexture(This,width,height,levels,usage,format,pool,texture,parent,parent_ops,shared_handle,pvClientMem) 8083 #else 8058 8084 #define IWineD3DDevice_CreateTexture(This,width,height,levels,usage,format,pool,texture,parent,parent_ops) (This)->lpVtbl->CreateTexture(This,width,height,levels,usage,format,pool,texture,parent,parent_ops) 8085 #endif 8059 8086 #define IWineD3DDevice_CreateVolumeTexture(This,width,height,depth,levels,usage,format,pool,texture,parent,parent_ops) (This)->lpVtbl->CreateVolumeTexture(This,width,height,depth,levels,usage,format,pool,texture,parent,parent_ops) 8060 8087 #define IWineD3DDevice_CreateVolume(This,width,height,depth,usage,format,pool,volume,parent,parent_ops) (This)->lpVtbl->CreateVolume(This,width,height,depth,usage,format,pool,volume,parent,parent_ops) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/basetexture.c
r28475 r30916 44 44 45 45 hr = resource_init((IWineD3DResource *)texture, resource_type, device, 46 size, usage, format_desc, pool, parent, parent_ops); 46 size, usage, format_desc, pool, parent, parent_ops 47 #ifdef VBOXWDDM 48 , NULL, NULL /* <- no need this info here */ 49 #endif 50 ); 47 51 if (FAILED(hr)) 48 52 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/buffer.c
r28475 r30916 1473 1473 1474 1474 hr = resource_init((IWineD3DResource *)buffer, WINED3DRTYPE_BUFFER, 1475 device, size, usage, format_desc, pool, parent, parent_ops); 1475 device, size, usage, format_desc, pool, parent, parent_ops 1476 #ifdef VBOXWDDM 1477 , NULL, NULL /* <- no need this info here so far */ 1478 #endif 1479 ); 1476 1480 if (FAILED(hr)) 1477 1481 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/cubetexture.c
r28475 r30916 535 535 }; 536 536 537 #ifdef VBOXWDDM 537 538 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w, 538 format, usage, pool, i /* Level */, j, &texture->surfaces[j][i]); 539 format, usage, pool, i /* Level */, j, &texture->surfaces[j][i] 540 , NULL, NULL /* <- no need this info here */ 541 ); 542 #else 543 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w, 544 format, usage, pool, i /* Level */, j, &texture->surfaces[j][i] 545 ); 546 #endif 539 547 if (FAILED(hr)) 540 548 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/device.c
r28475 r30916 802 802 WINED3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IWineD3DSurface **ppSurface, 803 803 DWORD Usage, WINED3DPOOL Pool, WINED3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, 804 WINED3DSURFTYPE Impl, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 804 WINED3DSURFTYPE Impl, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 805 #ifdef VBOXWDDM 806 , HANDLE *shared_handle 807 , void *pvClientMem 808 #endif 809 ) 805 810 { 806 811 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; … … 828 833 829 834 hr = surface_init(object, Impl, This->surface_alignment, Width, Height, Level, Lockable, 830 Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent, parent_ops); 835 Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent, parent_ops 836 #ifdef VBOXWDDM 837 , shared_handle 838 , pvClientMem 839 #endif 840 ); 831 841 if (FAILED(hr)) 832 842 { … … 868 878 static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, 869 879 UINT Width, UINT Height, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, 870 IWineD3DTexture **ppTexture, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 880 IWineD3DTexture **ppTexture, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 881 #ifdef VBOXWDDM 882 , HANDLE *shared_handle 883 , void *pvClientMem 884 #endif 885 ) 871 886 { 872 887 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; … … 886 901 } 887 902 888 hr = texture_init(object, Width, Height, Levels, This, Usage, Format, Pool, parent, parent_ops); 903 hr = texture_init(object, Width, Height, Levels, This, Usage, Format, Pool, parent, parent_ops 904 #ifdef VBOXWDDM 905 , shared_handle 906 , pvClientMem 907 #endif 908 ); 889 909 if (FAILED(hr)) 890 910 { … … 1420 1440 } 1421 1441 1442 #ifdef VBOXWDDM 1443 hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *)This, bm.bmWidth, bm.bmHeight, WINED3DFMT_B5G6R5_UNORM, TRUE, 1444 FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, 1445 NULL, &wined3d_null_parent_ops, NULL, NULL); 1446 #else 1422 1447 hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *)This, bm.bmWidth, bm.bmHeight, WINED3DFMT_B5G6R5_UNORM, TRUE, 1423 1448 FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, 1424 1449 NULL, &wined3d_null_parent_ops); 1450 #endif 1425 1451 if(FAILED(hr)) { 1426 1452 ERR("Wine logo requested, but failed to create surface\n"); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/resource.c
r28475 r30916 39 39 HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type, 40 40 IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct wined3d_format_desc *format_desc, 41 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 41 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 42 #ifdef VBOXWDDM 43 , HANDLE *shared_handle 44 , void *pvClientMem 45 #endif 46 ) 42 47 { 43 48 struct IWineD3DResourceClass *resource = &((IWineD3DResourceImpl *)iface)->resource; … … 55 60 list_init(&resource->privateData); 56 61 57 if (size) 58 { 59 resource->heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + RESOURCE_ALIGNMENT); 60 if (!resource->heapMemory) 61 { 62 ERR("Out of memory!\n"); 63 return WINED3DERR_OUTOFVIDEOMEMORY; 64 } 62 #ifdef VBOXWDDM 63 if (pool == WINED3DPOOL_SYSTEMMEM && pvClientMem) 64 { 65 resource->allocatedMemory = pvClientMem; 66 resource->heapMemory = NULL; 65 67 } 66 68 else 67 { 68 resource->heapMemory = NULL; 69 } 70 resource->allocatedMemory = (BYTE *)(((ULONG_PTR)resource->heapMemory + (RESOURCE_ALIGNMENT - 1)) & ~(RESOURCE_ALIGNMENT - 1)); 69 #endif 70 { 71 if (size) 72 { 73 resource->heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + RESOURCE_ALIGNMENT); 74 if (!resource->heapMemory) 75 { 76 ERR("Out of memory!\n"); 77 return WINED3DERR_OUTOFVIDEOMEMORY; 78 } 79 } 80 else 81 { 82 resource->heapMemory = NULL; 83 } 84 resource->allocatedMemory = (BYTE *)(((ULONG_PTR)resource->heapMemory + (RESOURCE_ALIGNMENT - 1)) & ~(RESOURCE_ALIGNMENT - 1)); 85 } 71 86 72 87 /* Check that we have enough video ram left */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
r28475 r30916 356 356 UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type, 357 357 UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, 358 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 358 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 359 #ifdef VBOXWDDM 360 , HANDLE *shared_handle 361 , void *pvClientMem 362 #endif 363 ) 359 364 { 360 365 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; … … 393 398 394 399 hr = resource_init((IWineD3DResource *)surface, WINED3DRTYPE_SURFACE, 395 device, resource_size, usage, format_desc, pool, parent, parent_ops); 400 device, resource_size, usage, format_desc, pool, parent, parent_ops 401 #ifdef VBOXWDDM 402 , shared_handle 403 , pvClientMem 404 #endif 405 ); 396 406 if (FAILED(hr)) 397 407 { … … 412 422 /* Flags */ 413 423 surface->Flags = SFLAG_NORMCOORD; /* Default to normalized coords. */ 424 #ifdef VBOXWDDM 425 if (pool == WINED3DPOOL_SYSTEMMEM && pvClientMem) surface->Flags |= SFLAG_CLIENTMEM; 426 #endif 414 427 if (discard) surface->Flags |= SFLAG_DISCARD; 415 428 if (lockable || format == WINED3DFMT_D16_LOCKABLE) surface->Flags |= SFLAG_LOCKABLE; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface_base.c
r28475 r30916 849 849 } 850 850 851 #ifdef VBOXWDDM 852 IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.device, source->currentDesc.Width, 853 source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret, 854 0 /* usage */, WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */, 855 0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source), 856 NULL /* parent */, &wined3d_null_parent_ops, NULL, NULL); 857 #else 851 858 IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.device, source->currentDesc.Width, 852 859 source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret, … … 854 861 0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source), 855 862 NULL /* parent */, &wined3d_null_parent_ops); 863 #endif 864 856 865 if(!ret) { 857 866 ERR("Failed to create a destination surface for conversion\n"); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/texture.c
r28475 r30916 441 441 HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels, 442 442 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, 443 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 443 IUnknown *parent, const struct wined3d_parent_ops *parent_ops 444 #ifdef VBOXWDDM 445 , HANDLE *shared_handle 446 , void *pvClientMem 447 #endif 448 ) 444 449 { 445 450 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; … … 577 582 for (i = 0; i < texture->baseTexture.levels; ++i) 578 583 { 584 #ifdef VBOXWDDM 585 /* Use the callback to create the texture surface. */ 586 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, format_desc->format, 587 usage, pool, i, WINED3DCUBEMAP_FACE_POSITIVE_X, &texture->surfaces[i] 588 , shared_handle 589 , pvClientMem); 590 591 #else 579 592 /* Use the callback to create the texture surface. */ 580 593 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, format_desc->format, 581 594 usage, pool, i, WINED3DCUBEMAP_FACE_POSITIVE_X, &texture->surfaces[i]); 595 #endif 596 582 597 if (FAILED(hr)) 583 598 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/volume.c
r28475 r30916 408 408 409 409 hr = resource_init((IWineD3DResource *)volume, WINED3DRTYPE_VOLUME, device, 410 width * height * depth * format_desc->byte_count, usage, format_desc, pool, parent, parent_ops); 410 width * height * depth * format_desc->byte_count, usage, format_desc, pool, parent, parent_ops 411 #ifdef VBOXWDDM 412 , NULL, NULL 413 #endif 414 ); 411 415 if (FAILED(hr)) 412 416 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h
r28475 r30916 1824 1824 HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type, 1825 1825 IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct wined3d_format_desc *format_desc, 1826 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 1826 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 1827 #ifdef VBOXWDDM 1828 , HANDLE *shared_handle 1829 , void *pvClientMem 1830 #endif 1831 ) DECLSPEC_HIDDEN; 1827 1832 WINED3DRESOURCETYPE resource_get_type(IWineD3DResource *iface) DECLSPEC_HIDDEN; 1828 1833 DWORD resource_set_priority(IWineD3DResource *iface, DWORD new_priority) DECLSPEC_HIDDEN; … … 1942 1947 HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels, 1943 1948 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, 1944 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 1949 IUnknown *parent, const struct wined3d_parent_ops *parent_ops 1950 #ifdef VBOXWDDM 1951 , HANDLE *shared_handle 1952 , void *pvClientMem 1953 #endif 1954 ) DECLSPEC_HIDDEN; 1945 1955 1946 1956 /***************************************************************************** … … 2131 2141 UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type, 2132 2142 UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, 2133 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 2143 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 2144 #ifdef VBOXWDDM 2145 , HANDLE *shared_handle 2146 , void *pvClientMem 2147 #endif 2148 ) DECLSPEC_HIDDEN; 2134 2149 2135 2150 /* Predeclare the shared Surface functions */ … … 2213 2228 #define SFLAG_SWAPCHAIN 0x01000000 /* The surface is part of a swapchain */ 2214 2229 2230 #ifdef VBOXWDDM 2231 # define SFLAG_CLIENTMEM 0x10000000 /* SYSMEM surface using client-supplied memory buffer */ 2232 2233 # define SFLAG_DONOTFREE_VBOXWDDM SFLAG_CLIENTMEM 2234 #else 2235 # define SFLAG_DONOTFREE_VBOXWDDM 0 2236 #endif 2237 2215 2238 /* In some conditions the surface memory must not be freed: 2216 2239 * SFLAG_CONVERTED: Converting the data back would take too long … … 2227 2250 SFLAG_USERPTR | \ 2228 2251 SFLAG_PBO | \ 2229 SFLAG_CLIENT) 2252 SFLAG_CLIENT | \ 2253 SFLAG_DONOTFREE_VBOXWDDM \ 2254 ) 2230 2255 2231 2256 #define SFLAG_LOCATIONS (SFLAG_INSYSMEM | \
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器