Changeset 38565 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Aug 30, 2011 9:28:15 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 73733
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h
r38112 r38565 321 321 { 322 322 VBOXDISP_UMHANDLE hSwapchainUm; 323 uint64_t u64Alignment; 323 uint64_t hWnd; 324 uint64_t u64Value; 324 325 }; 325 326 VBOXVIDEOCM_CMD_RECTS Cmd; 326 327 } VBOXVIDEOCM_CMD_RECTS_INTERNAL, *PVBOXVIDEOCM_CMD_RECTS_INTERNAL; 328 329 typedef struct VBOXVIDEOCM_CMD_RECTS_HDR 330 { 331 VBOXVIDEOCM_CMD_HDR Hdr; 332 VBOXVIDEOCM_CMD_RECTS_INTERNAL Data; 333 } VBOXVIDEOCM_CMD_RECTS_HDR, *PVBOXVIDEOCM_CMD_RECTS_HDR; 327 334 328 335 #define VBOXVIDEOCM_CMD_RECTS_INTERNAL_SIZE4CRECTS(_cRects) (RT_OFFSETOF(VBOXVIDEOCM_CMD_RECTS_INTERNAL, Cmd.RectsInfo.aRects[(_cRects)])) -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispCm.cpp
r37626 r38565 225 225 } 226 226 227 HRESULT vboxDispCmCmdSessionInterruptWait(PVBOXDISPCM_SESSION pSession) 228 { 229 SetEvent(pSession->hEvent); 230 return S_OK; 231 } 232 227 233 HRESULT vboxDispCmSessionCmdGet(PVBOXDISPCM_SESSION pSession, PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD pCmd, uint32_t cbCmd, DWORD dwMilliseconds) 228 234 { … … 275 281 } 276 282 283 HRESULT vboxDispCmCmdInterruptWait() 284 { 285 return vboxDispCmCmdSessionInterruptWait(&g_pVBoxCmMgr.Session); 286 } 287 277 288 void vboxDispCmLog(LPCSTR pszMsg) 278 289 { -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispCm.h
r36867 r38565 31 31 HRESULT vboxDispCmCmdGet(PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD pCmd, uint32_t cbCmd, DWORD dwMilliseconds); 32 32 33 HRESULT vboxDispCmCmdInterruptWait(); 34 33 35 void vboxDispCmLog(LPCSTR pszMsg); 34 36 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r38363 r38565 2398 2398 } 2399 2399 } 2400 2401 /* re-use swapchain window 2402 * this will invalidate the previusly used swapchain */ 2403 Params.hDeviceWindow = pSwapchain->hWnd; 2400 2404 2401 2405 hr = pDevice->pDevice9If->CreateAdditionalSwapChain(&Params, &pNewIf); … … 5919 5923 VBOXVDBG_BREAK_SHARED(pSrcRc); 5920 5924 VBOXVDBG_BREAK_SHARED(pDstRc); 5921 VBOXVDBG_DUMP_BLT_ENTER(pSrcAlloc, pSrcSurfIf, &pData->SrcRect, pDstAlloc, pDstSurfIf, &pData->DstRect); 5925 if ( pSrcAlloc->SurfDesc.width == 658 && pSrcAlloc->SurfDesc.height == 493 5926 && pData->SrcRect.left == 0 && pData->SrcRect.top == 0 5927 && pData->SrcRect.right == 658 && pData->SrcRect.bottom == 493 5928 && pDstAlloc->SurfDesc.width == 756 && pDstAlloc->SurfDesc.height == 493 5929 && pData->DstRect.left == 0 && pData->DstRect.top == 0 5930 && pData->DstRect.right == 658 && pData->DstRect.bottom == 493) 5931 { 5932 VBOXVDBG_DUMP_BLT_ENTER(pSrcAlloc, pSrcSurfIf, &pData->SrcRect, pDstAlloc, pDstSurfIf, &pData->DstRect); 5933 } 5922 5934 5923 5935 /* we support only Point & Linear, we ignore [Begin|Continue|End]PresentToDwm */ … … 5930 5942 Assert(hr == S_OK); 5931 5943 5932 VBOXVDBG_DUMP_BLT_LEAVE(pSrcAlloc, pSrcSurfIf, &pData->SrcRect, pDstAlloc, pDstSurfIf, &pData->DstRect); 5944 if ( pSrcAlloc->SurfDesc.width == 658 && pSrcAlloc->SurfDesc.height == 493 5945 && pData->SrcRect.left == 0 && pData->SrcRect.top == 0 5946 && pData->SrcRect.right == 658 && pData->SrcRect.bottom == 493 5947 && pDstAlloc->SurfDesc.width == 756 && pDstAlloc->SurfDesc.height == 493 5948 && pData->DstRect.left == 0 && pData->DstRect.top == 0 5949 && pData->DstRect.right == 658 && pData->DstRect.bottom == 493) 5950 { 5951 VBOXVDBG_DUMP_BLT_LEAVE(pSrcAlloc, pSrcSurfIf, &pData->SrcRect, pDstAlloc, pDstSurfIf, &pData->DstRect); 5952 } 5933 5953 5934 5954 pSrcSurfIf->Release(); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
r37490 r38565 1532 1532 { 1533 1533 PVBOXVIDPNCOFUNCMODALITY pCbContext = (PVBOXVIDPNCOFUNCMODALITY)pContext; 1534 D3DKMDT_VIDPN_PRESENT_PATH AdjustedPath = { };1534 D3DKMDT_VIDPN_PRESENT_PATH AdjustedPath = {0}; 1535 1535 NTSTATUS Status = STATUS_SUCCESS; 1536 1536 bool bUpdatePath = false; … … 1771 1771 paItems[i].enmState = VBOXVIDPNPATHITEM_STATE_NOT_EXISTS; 1772 1772 } 1773 VBOXVIDPNGETPATHSINFO CbContext = { };1773 VBOXVIDPNGETPATHSINFO CbContext = {0}; 1774 1774 CbContext.Status = STATUS_SUCCESS; 1775 1775 CbContext.fBreakOnDisabled = fBreakOnDisabled; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r38405 r38565 517 517 { 518 518 NTSTATUS Status = STATUS_SUCCESS; 519 bool bChanged[VBOX_VIDEO_MAX_SCREENS] = { };519 bool bChanged[VBOX_VIDEO_MAX_SCREENS] = {0}; 520 520 int i; 521 521 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/arb_program_shader.c
r38331 r38565 6964 6964 if (dst_swapchain && (IWineD3DSurface *)dst_surface == dst_swapchain->frontBuffer) 6965 6965 { 6966 #ifndef VBOX_WITH_WDDM 6966 6967 RECT windowsize; 6967 6968 POINT offset = {0,0}; 6968 6969 UINT h; 6969 # ifdef VBOX_WITH_WDDM6970 # ifdef VBOX_WITH_WDDM 6970 6971 HWND hWnd = context->currentSwapchain->win_handle; 6971 6972 ClientToScreen(hWnd, &offset); 6972 6973 GetClientRect(hWnd, &windowsize); 6973 # else6974 # else 6974 6975 ClientToScreen(context->win_handle, &offset); 6975 6976 GetClientRect(context->win_handle, &windowsize); 6976 # endif6977 # endif 6977 6978 h = windowsize.bottom - windowsize.top; 6978 6979 dst_rect.left -= offset.x; dst_rect.right -=offset.x; 6979 6980 dst_rect.top -= offset.y; dst_rect.bottom -=offset.y; 6980 6981 dst_rect.top += dst_surface->currentDesc.Height - h; dst_rect.bottom += dst_surface->currentDesc.Height - h; 6982 #endif 6981 6983 } 6982 6984 else if (surface_is_offscreen((IWineD3DSurface *)dst_surface)) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/context.c
r38438 r38565 737 737 static BOOL swapchain_validate(IWineD3DSwapChainImpl *swapchain) 738 738 { 739 HWND hWnd = WindowFromDC(swapchain->hDC); 740 if (hWnd != swapchain->win_handle) 741 { 742 ERR("Unexpected swapchain for dc %p window expected %p, but was %p.\n", swapchain->hDC, swapchain->win_handle, hWnd); 739 if (!swapchain->hDC) 740 { 741 ERR("NULL hDC"); 743 742 return FALSE; 744 743 } 744 745 #ifdef DEBUG 746 { 747 HWND hWnd = WindowFromDC(swapchain->hDC); 748 if (hWnd != swapchain->win_handle) 749 { 750 ERR("Unexpected swapchain for dc %p window expected %p, but was %p.\n", swapchain->hDC, swapchain->win_handle, hWnd); 751 } 752 } 753 #endif 745 754 return TRUE; 746 755 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/device.c
r38363 r38565 6636 6636 pPresentationParameters->BackBufferHeight); 6637 6637 } else { 6638 #ifndef VBOX_WITH_WDDM 6638 6639 /* Fullscreen -> fullscreen mode change */ 6639 6640 MoveWindow(swapchain->device_window, 0, 0, 6640 6641 pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight, 6641 6642 TRUE); 6643 #else 6644 ERR("reset: fullscreen unexpected!"); 6645 #endif 6642 6646 } 6643 6647 } … … 6676 6680 if(wined3d_settings.offscreen_rendering_mode == ORM_FBO) 6677 6681 { 6682 #ifndef VBOX_WITH_WDDM 6678 6683 RECT client_rect; 6679 6684 GetClientRect(swapchain->win_handle, &client_rect); 6685 #endif 6680 6686 6681 6687 if(!swapchain->presentParms.BackBufferCount) … … 6684 6690 swapchain->render_to_fbo = FALSE; 6685 6691 } 6692 #ifndef VBOX_WITH_WDDM 6686 6693 else if(swapchain->presentParms.BackBufferWidth != client_rect.right || 6687 6694 swapchain->presentParms.BackBufferHeight != client_rect.bottom ) … … 6693 6700 swapchain->render_to_fbo = TRUE; 6694 6701 } 6702 #endif 6695 6703 else 6696 6704 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
r38331 r38565 3191 3191 hr = IWineD3DSwapChain_Present((IWineD3DSwapChain *)swapchain, 3192 3192 NULL, NULL, swapchain->win_handle, NULL, 0); 3193 3193 3194 IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain); 3194 3195 return hr; … … 3647 3648 if(dstSwapchain && dstSwapchain == srcSwapchain && dstSwapchain->backBuffer && 3648 3649 ((IWineD3DSurface *) This == dstSwapchain->frontBuffer) && SrcSurface == dstSwapchain->backBuffer[0]) { 3650 #ifdef VBOX_WITH_WDDM 3651 ERR("should never be here!!"); 3652 #endif 3649 3653 /* Half-life does a Blt from the back buffer to the front buffer, 3650 3654 * Full surface size, no flags... Use present instead … … 3889 3893 */ 3890 3894 if (dstSwapchain && (IWineD3DSurface *)This == dstSwapchain->frontBuffer) { 3895 #ifndef VBOX_WITH_WDDM 3891 3896 RECT windowsize; 3892 3897 POINT offset = {0,0}; … … 3904 3909 dst_rect.top -= offset.y; dst_rect.bottom -=offset.y; 3905 3910 dst_rect.top += This->currentDesc.Height - h; dst_rect.bottom += This->currentDesc.Height - h; 3911 #endif 3906 3912 } 3907 3913 else if (surface_is_offscreen((IWineD3DSurface *)This)) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface_gdi.c
r33656 r38565 252 252 hr = IWineD3DSwapChain_Present((IWineD3DSwapChain *)swapchain, 253 253 NULL, NULL, swapchain->win_handle, NULL, 0); 254 254 255 IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain); 255 256 return hr; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/swapchain.c
r38363 r38565 45 45 #define GLINFO_LOCATION This->device->adapter->gl_info 46 46 47 #ifdef VBOX_WITH_WDDM 48 49 IWineD3DSwapChainImpl * swapchain_find(IWineD3DDeviceImpl *pDevice, HWND hWnd) 50 { 51 int i; 52 for (i = 0; i < pDevice->NumberOfSwapChains; ++i) 53 { 54 IWineD3DSwapChainImpl *pSwapchain = (IWineD3DSwapChainImpl*)pDevice->swapchains[i]; 55 if (pSwapchain->win_handle == hWnd) 56 { 57 return pSwapchain; 58 } 59 } 60 61 return NULL; 62 } 63 64 VOID swapchain_invalidate(IWineD3DSwapChainImpl *pSwapchain) 65 { 66 pSwapchain->win_handle = NULL; 67 pSwapchain->hDC = NULL; 68 } 69 70 #endif 71 47 72 /*IWineD3DSwapChain parts follow: */ 48 73 static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface) … … 107 132 } 108 133 #ifdef VBOX_WITH_WDDM 109 if(This-> device_window) {110 /* see VBoxExtGet/ReleaseDC for comments */111 VBoxExtWndDestroy(This->device_window, This->hDC);134 if(This->win_handle) { 135 VBoxExtWndDestroy(This->win_handle, This->hDC); 136 swapchain_invalidate(This); 112 137 } 113 138 else 114 139 { 115 ERR("null device window");140 WARN("null win info"); 116 141 } 117 142 #else … … 243 268 unsigned int sync; 244 269 int retval; 270 271 #ifdef VBOX_WITH_WDDM 272 /* quickly sort out invalid swapchains */ 273 if (!This->hDC) 274 { 275 WARN("Invalid swapchain"); 276 return WINED3D_OK; 277 } 278 #endif 245 279 246 280 IWineD3DSwapChain_SetDestWindowOverride(iface, hDestWindowOverride); … … 291 325 */ 292 326 if (This->presentParms.Windowed) { 327 #ifdef VBOX_WITH_WDDM 328 /* @todo: can we actualy be here? */ 329 #endif 293 330 MapWindowPoints(NULL, This->win_handle, (LPPOINT)&destRect, 2); 294 331 } … … 330 367 331 368 if (pDestRect) dst_rect = *pDestRect; 332 else GetClientRect(This->win_handle, &dst_rect); 369 #ifndef VBOX_WITH_WDDM 370 else 371 GetClientRect(This->win_handle, &dst_rect); 333 372 334 373 if (!render_to_fbo && (dst_rect.left || dst_rect.top … … 338 377 render_to_fbo = TRUE; 339 378 } 379 #else 380 else 381 { 382 dst_rect.left = 0; 383 dst_rect.top = 0; 384 dst_rect.right = This->presentParms.BackBufferWidth; 385 dst_rect.bottom = This->presentParms.BackBufferHeight; 386 } 387 #endif 340 388 341 389 /* Rendering to a window of different size, presenting partial rectangles, … … 568 616 static HRESULT WINAPI IWineD3DSwapChainImpl_SetDestWindowOverride(IWineD3DSwapChain *iface, HWND window) 569 617 { 618 #ifndef VBOX_WITH_WDDM 570 619 IWineD3DSwapChainImpl *swapchain = (IWineD3DSwapChainImpl *)iface; 571 620 … … 575 624 TRACE("Setting swapchain %p window from %p to %p\n", swapchain, swapchain->win_handle, window); 576 625 swapchain->win_handle = window; 577 626 #endif 578 627 return WINED3D_OK; 579 628 } … … 619 668 void swapchain_setup_fullscreen_window(IWineD3DSwapChainImpl *swapchain, UINT w, UINT h) 620 669 { 670 #ifdef VBOX_WITH_WDDM 671 ERR("not supported"); 672 #else 621 673 IWineD3DDeviceImpl *device = swapchain->device; 622 674 HWND window = swapchain->device_window; … … 649 701 650 702 device->filter_messages = filter_messages; 703 #endif 651 704 } 652 705 653 706 void swapchain_restore_fullscreen_window(IWineD3DSwapChainImpl *swapchain) 654 707 { 708 #ifdef VBOX_WITH_WDDM 709 ERR("not supported"); 710 #else 655 711 IWineD3DDeviceImpl *device = swapchain->device; 656 712 HWND window = swapchain->device_window; … … 685 741 device->style = 0; 686 742 device->exStyle = 0; 743 #endif 687 744 } 688 745 … … 698 755 HWND window = NULL; 699 756 #ifdef VBOX_WITH_WDDM 757 IWineD3DSwapChainImpl *overridenSwapchain = NULL; 700 758 HDC hDC = NULL; 701 759 #endif … … 734 792 if (present_parameters->hDeviceWindow) 735 793 { 736 ERR("non-null device window"); 737 return E_FAIL; 738 } 739 hr = VBoxExtWndCreate(present_parameters->BackBufferWidth, present_parameters->BackBufferHeight, &window, &hDC); 740 if (FAILED(hr)) 741 { 742 ERR("VBoxExtWndCreate failed, hr 0x%x", hr); 743 return hr; 794 overridenSwapchain = swapchain_find(device, present_parameters->hDeviceWindow); 795 if (!overridenSwapchain) 796 { 797 ERR("invalid window handle supplied"); 798 return E_FAIL; 799 } 800 801 window = overridenSwapchain->win_handle; 802 hDC = overridenSwapchain->hDC; 803 } 804 else 805 { 806 hr = VBoxExtWndCreate(present_parameters->BackBufferWidth, present_parameters->BackBufferHeight, &window, &hDC); 807 if (FAILED(hr)) 808 { 809 ERR("VBoxExtWndCreate failed, hr 0x%x", hr); 810 return hr; 811 } 744 812 } 745 813 Assert(window); … … 754 822 swapchain->ref = 1; 755 823 swapchain->win_handle = window; 824 #ifndef VBOX_WITH_WDDM 756 825 swapchain->device_window = window; 757 # ifdef VBOX_WITH_WDDM826 #else 758 827 Assert(window); 759 828 swapchain->hDC = hDC; … … 772 841 format_desc = getFormatDescEntry(mode.Format, &adapter->gl_info); 773 842 843 #ifndef VBOX_WITH_WDDM 774 844 GetClientRect(window, &client_rect); 845 #else 846 client_rect.left = 0; 847 client_rect.top = 0; 848 client_rect.right = present_parameters->BackBufferWidth; 849 client_rect.bottom = present_parameters->BackBufferHeight; 850 #endif 775 851 if (present_parameters->Windowed 776 852 && (!present_parameters->BackBufferWidth || !present_parameters->BackBufferHeight … … 966 1042 IWineD3DSwapChain_GetGammaRamp((IWineD3DSwapChain *)swapchain, &swapchain->orig_gamma); 967 1043 1044 #ifdef VBOX_WITH_WDDM 1045 if (overridenSwapchain) 1046 { 1047 swapchain_invalidate(overridenSwapchain); 1048 } 1049 #endif 1050 968 1051 return WINED3D_OK; 969 1052 … … 1018 1101 1019 1102 #ifdef VBOX_WITH_WDDM 1020 if (swapchain->device_window) 1021 { 1022 VBoxExtWndDestroy(swapchain->device_window, swapchain->hDC); 1023 } 1103 if (!overridenSwapchain && swapchain->win_handle) 1104 { 1105 VBoxExtWndDestroy(swapchain->win_handle, swapchain->hDC); 1106 } 1107 1108 swapchain_invalidate(swapchain); 1024 1109 #endif 1025 1110 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/swapchain_base.c
r34304 r38565 191 191 IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; 192 192 HDC hDC; 193 HWND hWnd; 194 #ifndef VBOX_WITH_WDDM 195 hWnd = This->device_window; 196 #else 197 hWnd = This->win_handle; 198 #endif 193 199 TRACE("(%p) : pRamp@%p flags(%d)\n", This, pRamp, Flags); 194 hDC = GetDC( This->device_window);200 hDC = GetDC(hWnd); 195 201 SetDeviceGammaRamp(hDC, (LPVOID)pRamp); 196 ReleaseDC( This->device_window, hDC);202 ReleaseDC(hWnd, hDC); 197 203 return WINED3D_OK; 198 204 … … 203 209 IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; 204 210 HDC hDC; 211 HWND hWnd; 212 #ifndef VBOX_WITH_WDDM 213 hWnd = This->device_window; 214 #else 215 hWnd = This->win_handle; 216 #endif 205 217 TRACE("(%p) : pRamp@%p\n", This, pRamp); 206 hDC = GetDC( This->device_window);218 hDC = GetDC(hWnd); 207 219 GetDeviceGammaRamp(hDC, pRamp); 208 ReleaseDC( This->device_window, hDC);209 return WINED3D_OK; 210 211 } 220 ReleaseDC(hWnd, hDC); 221 return WINED3D_OK; 222 223 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_gl.h
r38146 r38565 1380 1380 PROC (WINAPI *pwglGetProcAddress)(LPCSTR) DECLSPEC_HIDDEN; 1381 1381 BOOL (WINAPI *pwglMakeCurrent)(HDC, HGLRC) DECLSPEC_HIDDEN; 1382 BOOL (WINAPI *pwglSwapLayerBuffers)(HDC ) DECLSPEC_HIDDEN;1382 BOOL (WINAPI *pwglSwapLayerBuffers)(HDC, UINT) DECLSPEC_HIDDEN; 1383 1383 BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN; 1384 1384 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h
r38363 r38565 2686 2686 struct wined3d_context **context; 2687 2687 unsigned int num_contexts; 2688 #endif2689 2690 2688 HWND win_handle; 2691 2689 HWND device_window; 2692 #ifdef VBOX_WITH_WDDM2693 2690 HDC hDC; 2691 #else 2692 HWND win_handle; 2693 HDC hDC; 2694 // WineWndInfo *pWndInfo; 2694 2695 #endif 2695 2696 };
Note:
See TracChangeset
for help on using the changeset viewer.