Changeset 39016 in vbox
- Timestamp:
- Oct 18, 2011 11:41:31 AM (13 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/context.c
r38930 r39016 846 846 #ifdef VBOX_WITH_WDDM 847 847 , IWineD3DSwapChainImpl *swapchain 848 #endif 848 # ifdef DEBUG_misha 849 , BOOL fExpectedValid 850 # endif 851 #endif 852 849 853 ) 850 854 { 851 855 #ifdef VBOX_WITH_WDDM 852 if (!swapchain || context->currentSwapchain == swapchain) 856 if (!swapchain) 857 { 858 swapchain = context->currentSwapchain; 859 } 860 861 if (!swapchain) 862 { 863 context->valid = FALSE; 864 # ifdef DEBUG_misha 865 if (fExpectedValid) 866 { 867 ERR("no current swapchain!\n"); 868 } 869 # endif 870 return; 871 } 872 873 if (swapchain == context->currentSwapchain) 853 874 { 854 875 context->valid = swapchain_validate(context->currentSwapchain); … … 882 903 IWineD3DSwapChainImpl *swapchain = NULL; 883 904 884 context_validate(context, NULL); 905 context_validate(context, NULL 906 # ifdef DEBUG_misha 907 , FALSE 908 # endif 909 ); 885 910 if (context->valid) 886 911 return; … … 889 914 if (swapchain) 890 915 { 891 context_validate(context, swapchain); 916 context_validate(context, swapchain 917 # ifdef DEBUG_misha 918 , TRUE 919 # endif 920 ); 892 921 if (!context->valid) 893 922 { … … 1790 1819 IWineD3DSwapChain *swapchain = NULL; 1791 1820 if (target && SUCCEEDED(IWineD3DSurface_GetContainer(target, &IID_IWineD3DSwapChain, (void **)&swapchain))) { 1792 context_validate(context, (IWineD3DSwapChainImpl*)swapchain); 1821 context_validate(context, (IWineD3DSwapChainImpl*)swapchain 1822 # ifdef DEBUG_misha 1823 , TRUE 1824 # endif 1825 ); 1793 1826 IWineD3DSwapChain_Release(swapchain); 1794 1827 } … … 2348 2381 IWineD3DSwapChain *swapchain = NULL; 2349 2382 if (SUCCEEDED(IWineD3DSurface_GetContainer(target, &IID_IWineD3DSwapChain, (void **)&swapchain))) { 2350 context_validate(context, (IWineD3DSwapChainImpl*)swapchain); 2383 context_validate(context, (IWineD3DSwapChainImpl*)swapchain 2384 # ifdef DEBUG_misha 2385 , TRUE 2386 # endif 2387 ); 2351 2388 IWineD3DSwapChain_Release(swapchain); 2352 2389 } … … 2361 2398 2362 2399 context = findThreadContextForSwapChain(swapchain); 2363 context_validate(context, (IWineD3DSwapChainImpl*)swapchain); 2400 context_validate(context, (IWineD3DSwapChainImpl*)swapchain 2401 # ifdef DEBUG_misha 2402 , TRUE 2403 # endif 2404 ); 2364 2405 IWineD3DSwapChain_Release(swapchain); 2365 2406 } … … 2376 2417 swapchain = (IWineD3DSwapChainImpl *)This->swapchains[This->NumberOfSwapChains-1]; /* just fallback to anything to avoid NPE */ 2377 2418 context = findThreadContextForSwapChain((IWineD3DSwapChain*)swapchain); 2378 context_validate(context, swapchain); 2419 context_validate(context, swapchain 2420 # ifdef DEBUG_misha 2421 , TRUE 2422 # endif 2423 ); 2379 2424 } 2380 2425 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
r38982 r39016 1249 1249 if (!ref) 1250 1250 { 1251 #ifdef VBOX_WITH_WDDM 1252 IWineD3DDeviceImpl *device = This->resource.device; 1253 struct wined3d_context *context; 1254 UINT i; 1255 #endif 1251 1256 surface_cleanup(This); 1252 1257 This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent); 1258 1259 #ifdef VBOX_WITH_WDDM 1260 for (i = 0; i < device->numContexts; ++i) 1261 { 1262 context = device->contexts[i]; 1263 /* pretty hacky, @todo: check if the context is acquired and re-acquire it with the new swapchain */ 1264 if (context->current_rt == This) 1265 { 1266 context->current_rt = NULL; 1267 } 1268 } 1269 #endif 1253 1270 1254 1271 TRACE("(%p) Released.\n", This); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/swapchain.c
r38903 r39016 49 49 IWineD3DSwapChainImpl * swapchain_find(IWineD3DDeviceImpl *pDevice, HWND hWnd) 50 50 { 51 inti;51 UINT i; 52 52 for (i = 0; i < pDevice->NumberOfSwapChains; ++i) 53 53 { … … 64 64 VOID swapchain_invalidate(IWineD3DSwapChainImpl *pSwapchain) 65 65 { 66 /* first make sure the swapchain is not used by anyone */ 67 IWineD3DDeviceImpl *device = pSwapchain->device; 68 struct wined3d_context *context; 69 UINT i; 70 for (i = 0; i < device->numContexts; ++i) 71 { 72 context = device->contexts[i]; 73 /* pretty hacky, @todo: check if the context is acquired and re-acquire it with the new swapchain */ 74 if (context->currentSwapchain == pSwapchain) 75 { 76 context->currentSwapchain = NULL; 77 } 78 79 if (pSwapchain->frontBuffer == context->current_rt) 80 { 81 context->current_rt = NULL; 82 } 83 else if (pSwapchain->backBuffer) 84 { 85 UINT j; 86 for (j = 0; j < pSwapchain->presentParms.BackBufferCount; ++j) 87 { 88 if (pSwapchain->backBuffer[j] == context->current_rt) 89 { 90 context->current_rt = NULL; 91 break; 92 } 93 } 94 } 95 } 96 66 97 pSwapchain->win_handle = NULL; 67 98 pSwapchain->hDC = NULL; … … 96 127 if (This->backBuffer) 97 128 { 98 UINTi = This->presentParms.BackBufferCount;129 i = This->presentParms.BackBufferCount; 99 130 100 131 while (i--)
Note:
See TracChangeset
for help on using the changeset viewer.