Changeset 89171 in vbox for trunk/src/VBox/Devices
- Timestamp:
- May 19, 2021 2:10:51 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144512
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h
r89163 r89171 392 392 393 393 #endif /* VMSVGA3D_OPENGL */ 394 395 #ifdef VMSVGA3D_DIRECT3D396 /* Enable to use Wine to convert D3D to opengl */397 //#define VBOX_VMSVGA3D_WITH_WINE_OPENGL398 #endif399 394 400 395 … … 802 797 #ifdef RT_OS_WINDOWS 803 798 # ifdef VMSVGA3D_DIRECT3D 804 # ifdef VBOX_VMSVGA3D_WITH_WINE_OPENGL805 IDirect3DDevice9 *pDevice;806 # else807 799 IDirect3DDevice9Ex *pDevice; 808 # endif809 800 # else 810 801 /* Device context of the context window. */ … … 1049 1040 #ifdef RT_OS_WINDOWS 1050 1041 # ifdef VMSVGA3D_DIRECT3D 1051 # ifdef VBOX_VMSVGA3D_WITH_WINE_OPENGL1052 IDirect3D9 *pD3D9;1053 # else1054 1042 IDirect3D9Ex *pD3D9; 1055 # endif1056 1043 D3DCAPS9 caps; 1057 1044 bool fSupportedSurfaceINTZ; -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
r89163 r89171 224 224 return VINF_SUCCESS; /* already initialized (load state) */ 225 225 226 #ifdef VBOX_VMSVGA3D_WITH_WINE_OPENGL227 pState->pD3D9 = Direct3DCreate9(D3D_SDK_VERSION);228 AssertReturn(pState->pD3D9, VERR_INTERNAL_ERROR);229 #else230 226 /* Direct3DCreate9Ex was introduced in Vista, so resolve it dynamically. */ 231 227 typedef HRESULT (WINAPI *PFNDIRECT3DCREATE9EX)(UINT, IDirect3D9Ex **); … … 236 232 hr = pfnDirect3dCreate9Ex(D3D_SDK_VERSION, &pState->pD3D9); 237 233 AssertReturn(hr == D3D_OK, VERR_INTERNAL_ERROR); 238 #endif 234 239 235 D3DADAPTER_IDENTIFIER9 ai9; 240 236 hr = pState->pD3D9->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &ai9); … … 1339 1335 { 1340 1336 RT_NOREF(pState); 1341 #ifndef VBOX_VMSVGA3D_WITH_WINE_OPENGL 1337 1342 1338 Assert(pSurface->id != SVGA3D_INVALID_ID); 1343 1339 … … 1372 1368 hr = pSurface->pQuery->Issue(D3DISSUE_END); 1373 1369 AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceTrackUsage: Issue failed with %x\n", hr), VERR_INTERNAL_ERROR); 1374 #endif /* !VBOX_VMSVGA3D_WITH_WINE_OPENGL */1375 1370 1376 1371 return VINF_SUCCESS; … … 1399 1394 int vmsvga3dSurfaceFlush(PVMSVGA3DSURFACE pSurface) 1400 1395 { 1401 #ifndef VBOX_VMSVGA3D_WITH_WINE_OPENGL1402 1396 HRESULT hr; 1403 1397 … … 1421 1415 1422 1416 AssertMsgReturn(hr == S_OK, ("vmsvga3dSurfaceFinishDrawing: GetData failed with %x\n", hr), VERR_INTERNAL_ERROR); 1423 #endif /* !VBOX_VMSVGA3D_WITH_WINE_OPENGL */1424 1417 1425 1418 return VINF_SUCCESS; … … 1444 1437 pTexture = pSurface->u.pTexture; 1445 1438 1446 #ifndef VBOX_VMSVGA3D_WITH_WINE_OPENGL1447 1439 if (pSurface->idAssociatedContext != pContext->id) 1448 1440 { … … 1469 1461 } 1470 1462 } 1471 #else1472 RT_NOREF(pContext);1473 #endif1474 1463 1475 1464 if (pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_CUBE_TEXTURE) … … 2670 2659 hr = Params.hrc; 2671 2660 2672 #elif defined(VBOX_VMSVGA3D_WITH_WINE_OPENGL)2673 hr = pState->pD3D9->CreateDevice(D3DADAPTER_DEFAULT,2674 D3DDEVTYPE_HAL,2675 pContext->hwnd,2676 D3DCREATE_MULTITHREADED | D3DCREATE_MIXED_VERTEXPROCESSING, //D3DCREATE_HARDWARE_VERTEXPROCESSING,2677 &PresParam,2678 &pContext->pDevice);2679 2661 #else 2680 2662 /** @todo Docs indicates that we should be using … … 2864 2846 static int vmsvga3dContextTrackUsage(PVGASTATECC pThisCC, PVMSVGA3DCONTEXT pContext) 2865 2847 { 2866 #ifndef VBOX_VMSVGA3D_WITH_WINE_OPENGL2867 2848 PVMSVGA3DSTATE pState = pThisCC->svga.p3dState; 2868 2849 AssertReturn(pState, VERR_NO_MEMORY); … … 2877 2858 if (pContext->state.aRenderTargets[i] != SVGA3D_INVALID_ID) 2878 2859 vmsvga3dSurfaceTrackUsageById(pState, pContext, pContext->state.aRenderTargets[i]); 2879 #endif 2860 2880 2861 return VINF_SUCCESS; 2881 2862 } … … 3043 3024 PresParam.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;; 3044 3025 3045 #ifdef VBOX_VMSVGA3D_WITH_WINE_OPENGL3046 hr = pContext->pDevice->Reset(&PresParam);3047 AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: Reset failed with %x\n", hr), VERR_INTERNAL_ERROR);3048 #else3049 3026 /* ResetEx does not trash the device state */ 3050 3027 hr = pContext->pDevice->ResetEx(&PresParam, NULL); 3051 3028 AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: Reset failed with %x\n", hr), VERR_INTERNAL_ERROR); 3052 #endif 3029 3053 3030 Log(("vmsvga3dChangeMode: Backbuffer (%d,%d) count=%d format=%x\n", PresParam.BackBufferWidth, PresParam.BackBufferHeight, PresParam.BackBufferCount, PresParam.BackBufferFormat)); 3054 3031 … … 4440 4417 VERR_INVALID_PARAMETER); 4441 4418 4442 #ifndef VBOX_VMSVGA3D_WITH_WINE_OPENGL4443 4419 if (pSurface->idAssociatedContext != cid) 4444 4420 { … … 4451 4427 } 4452 4428 else 4453 #endif4454 4429 hr = pContext->pDevice->SetTexture(d3dSampler, pSurface->u.pTexture); 4455 4430
Note:
See TracChangeset
for help on using the changeset viewer.