Changeset 40388 in vbox
- Timestamp:
- Mar 7, 2012 12:44:46 PM (13 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r40125 r40388 3130 3130 if (RT_SUCCESS(rc)) 3131 3131 { 3132 rc = VbglR3Init();3133 AssertRC(rc);3134 if (RT_SUCCESS(rc))3132 // rc = VbglR3Init(); 3133 // AssertRC(rc); 3134 // if (RT_SUCCESS(rc)) 3135 3135 { 3136 3136 HRESULT hr = vboxDispCmInit(); … … 3146 3146 } 3147 3147 } 3148 VbglR3Term();3148 // VbglR3Term(); 3149 3149 } 3150 3150 } … … 3169 3169 if (hr == S_OK) 3170 3170 { 3171 VbglR3Term();3171 // VbglR3Term(); 3172 3172 /// @todo RTR3Term(); 3173 3173 return TRUE; … … 5672 5672 for (UINT i = 0; i < pRc->cAllocations; ++i) 5673 5673 { 5674 BOOL fSetD ontDelete = FALSE;5674 BOOL fSetDelete = FALSE; 5675 5675 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[i]; 5676 5676 if (pAlloc->hSharedHandle) 5677 5677 { 5678 /* using one and the same shared resource by different clients could lead to the situation where one client can still refer to the resource 5679 * while another one has deleted it 5680 * this could lead to gl state corruption on both host and guest side. 5681 * This is why we take extra care to avoid it. 5682 * Until we do a vboxWddmShRcRefAlloc call below the resource is guarantied to be present, however it can be removed any time after the call 5683 * if cShRcRefs is non-zero, i.e. the current cliet is not the one deleting it. 5684 * We first explicitely say to wine that resource must NOT be accessed any more and that all references to it should be cleaned */ 5685 pAdapter->D3D.pfnVBoxWineExD3DRc9SetShRcState((IDirect3DResource9*)pAlloc->pD3DIf, VBOXWINEEX_SHRC_STATE_GL_DISABLE); 5686 5678 5687 DWORD cShRcRefs; 5679 5688 HRESULT tmpHr = vboxWddmShRcRefAlloc(pDevice, pAlloc, FALSE, &cShRcRefs); 5680 if (cShRcRefs) 5681 { 5682 fSetDontDelete = TRUE; 5689 if (!cShRcRefs) 5690 { 5691 /* the current client IS the one deleting this resource */ 5692 fSetDelete = TRUE; 5683 5693 } 5684 5694 #ifdef DEBUG_misha … … 5692 5702 } 5693 5703 5694 if (fSetD ontDelete)5704 if (fSetDelete) 5695 5705 { 5696 5706 Assert(pAlloc->pD3DIf); 5697 pAdapter->D3D.pfnVBoxWineExD3DRc9Set DontDeleteGl((IDirect3DResource9*)pAlloc->pD3DIf);5707 pAdapter->D3D.pfnVBoxWineExD3DRc9SetShRcState((IDirect3DResource9*)pAlloc->pD3DIf, VBOXWINEEX_SHRC_STATE_GL_DELETE); 5698 5708 } 5699 5709 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.cpp
r38982 r40388 81 81 } 82 82 83 pD3D->pfnVBoxWineExD3DRc9Set DontDeleteGl = (PFNVBOXWINEEXD3DRC9_SETDONTDELETEGL)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DRc9SetDontDeleteGl");84 if (!pD3D->pfnVBoxWineExD3DRc9Set DontDeleteGl)83 pD3D->pfnVBoxWineExD3DRc9SetShRcState = (PFNVBOXWINEEXD3DRC9_SETSHRCSTATE)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DRc9SetShRcState"); 84 if (!pD3D->pfnVBoxWineExD3DRc9SetShRcState) 85 85 { 86 WARN(("no VBoxWineExD3DRc9Set DontDeleteGl"));86 WARN(("no VBoxWineExD3DRc9SetShRcState")); 87 87 break; 88 88 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.h
r38982 r40388 45 45 PFNVBOXWINEEXD3DDEV9_UPDATE pfnVBoxWineExD3DDev9Update; 46 46 47 PFNVBOXWINEEXD3DRC9_SET DONTDELETEGL pfnVBoxWineExD3DRc9SetDontDeleteGl;47 PFNVBOXWINEEXD3DRC9_SETSHRCSTATE pfnVBoxWineExD3DRc9SetShRcState; 48 48 49 49 PFNVBOXWINEEXD3DSWAPCHAIN9_PRESENT pfnVBoxWineExD3DSwapchain9Present; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/Makefile.kmk
r39648 r40388 189 189 wined3dwddm_INCS = vbox/libWineStub/include 190 190 wined3dwddm_DEFS = $(subst VBOX_WINE_WITH_SINGLE_SWAPCHAIN_CONTEXT,,$(wined3d_DEFS)) 191 wined3dwddm_DEFS += VBOX_WITH_WDDM VBOX_WINE_WITH_SINGLE_CONTEXT 191 wined3dwddm_DEFS += VBOX_WITH_WDDM VBOX_WINE_WITH_SINGLE_CONTEXT IN_VBOXLIBWINE 192 192 wined3dwddm_SOURCES = $(subst wined3d.def,wined3dwddm.def,$(wined3d_SOURCES)) vbox/VBoxDbgGl.c 193 193 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9_private.h
r35650 r40388 48 48 #include "wine/wined3d.h" 49 49 50 #ifdef VBOX_WITH_WDDM51 #include "../vbox/VBoxWineEx.h"52 #endif53 50 54 51 /* =========================================================================== -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9wddm.def
r38982 r40388 17 17 VBoxWineExD3DDev9Update 18 18 VBoxWineExD3DSwapchain9Present 19 VBoxWineExD3DRc9Set DontDeleteGl19 VBoxWineExD3DRc9SetShRcState -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/device.c
r39889 r40388 3282 3282 3283 3283 #ifdef VBOX_WITH_WDDM 3284 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DRc9Set DontDeleteGl(IDirect3DResource9 *iface)3284 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DRc9SetShRcState(IDirect3DResource9 *iface, VBOXWINEEX_SHRC_STATE enmState) 3285 3285 { 3286 3286 D3DRESOURCETYPE enmType = IDirect3DResource9_GetType(iface); … … 3292 3292 IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl*)iface ; 3293 3293 wined3d_mutex_lock(); 3294 hr = IWineD3DResource_Set DontDeleteGl((IWineD3DResource*)This->wineD3DSurface);3294 hr = IWineD3DResource_SetShRcState((IWineD3DResource*)This->wineD3DSurface, enmState); 3295 3295 wined3d_mutex_unlock(); 3296 3296 break; … … 3300 3300 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl*)iface ; 3301 3301 wined3d_mutex_lock(); 3302 hr = IWineD3DResource_Set DontDeleteGl((IWineD3DResource*)This->wineD3DVolume);3302 hr = IWineD3DResource_SetShRcState((IWineD3DResource*)This->wineD3DVolume, enmState); 3303 3303 wined3d_mutex_unlock(); 3304 3304 break; … … 3308 3308 IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl*)iface ; 3309 3309 wined3d_mutex_lock(); 3310 hr = IWineD3DResource_Set DontDeleteGl((IWineD3DResource*)This->wineD3DTexture);3310 hr = IWineD3DResource_SetShRcState((IWineD3DResource*)This->wineD3DTexture, enmState); 3311 3311 wined3d_mutex_unlock(); 3312 3312 break; … … 3316 3316 IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl*)iface ; 3317 3317 wined3d_mutex_lock(); 3318 hr = IWineD3DResource_Set DontDeleteGl((IWineD3DResource*)This->wineD3DVolumeTexture);3318 hr = IWineD3DResource_SetShRcState((IWineD3DResource*)This->wineD3DVolumeTexture, enmState); 3319 3319 wined3d_mutex_unlock(); 3320 3320 break; … … 3324 3324 IDirect3DCubeTexture9Impl *This = (IDirect3DCubeTexture9Impl*)iface ; 3325 3325 wined3d_mutex_lock(); 3326 hr = IWineD3DResource_Set DontDeleteGl((IWineD3DResource*)This->wineD3DCubeTexture);3326 hr = IWineD3DResource_SetShRcState((IWineD3DResource*)This->wineD3DCubeTexture, enmState); 3327 3327 wined3d_mutex_unlock(); 3328 3328 break; … … 3332 3332 IDirect3DVertexBuffer9Impl *This = (IDirect3DVertexBuffer9Impl*)iface ; 3333 3333 wined3d_mutex_lock(); 3334 hr = IWineD3DResource_Set DontDeleteGl((IWineD3DResource*)This->wineD3DVertexBuffer);3334 hr = IWineD3DResource_SetShRcState((IWineD3DResource*)This->wineD3DVertexBuffer, enmState); 3335 3335 wined3d_mutex_unlock(); 3336 3336 break; … … 3340 3340 IDirect3DIndexBuffer9Impl *This = (IDirect3DIndexBuffer9Impl*)iface ; 3341 3341 wined3d_mutex_lock(); 3342 hr = IWineD3DResource_Set DontDeleteGl((IWineD3DResource*)This->wineD3DIndexBuffer);3342 hr = IWineD3DResource_SetShRcState((IWineD3DResource*)This->wineD3DIndexBuffer, enmState); 3343 3343 wined3d_mutex_unlock(); 3344 3344 break; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wine/wined3d.h
r39602 r40388 3434 3434 3435 3435 #ifdef VBOX_WITH_WDDM 3436 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 3437 IWineD3DResource* This); 3436 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 3437 IWineD3DResource* This, 3438 VBOXWINEEX_SHRC_STATE enmState); 3438 3439 #endif 3439 3440 … … 3461 3462 #define IWineD3DResource_GetType(This) (This)->lpVtbl->GetType(This) 3462 3463 # ifdef VBOX_WITH_WDDM 3463 # define IWineD3DResource_Set DontDeleteGl(This) (This)->lpVtbl->SetDontDeleteGl(This)3464 # define IWineD3DResource_SetShRcState(This, enmState) (This)->lpVtbl->SetShRcState(This, enmState) 3464 3465 # endif 3465 3466 #endif … … 4069 4070 4070 4071 #ifdef VBOX_WITH_WDDM 4071 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 4072 IWineD3DResource* This); 4072 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 4073 IWineD3DResource* This, 4074 VBOXWINEEX_SHRC_STATE enmState); 4073 4075 #endif 4074 4076 … … 4689 4691 4690 4692 #ifdef VBOX_WITH_WDDM 4691 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 4692 IWineD3DResource* This); 4693 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 4694 IWineD3DResource* This, 4695 VBOXWINEEX_SHRC_STATE enmState); 4693 4696 #endif 4694 4697 … … 4908 4911 4909 4912 #ifdef VBOX_WITH_WDDM 4910 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 4911 IWineD3DResource* This); 4913 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 4914 IWineD3DResource* This, 4915 VBOXWINEEX_SHRC_STATE enmState); 4912 4916 #endif 4913 4917 … … 5159 5163 5160 5164 #ifdef VBOX_WITH_WDDM 5161 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 5162 IWineD3DTexture* This); 5165 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 5166 IWineD3DTexture* This, 5167 VBOXWINEEX_SHRC_STATE enmState); 5163 5168 #endif 5164 5169 … … 5410 5415 5411 5416 #ifdef VBOX_WITH_WDDM 5412 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 5413 IWineD3DCubeTexture* This); 5417 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 5418 IWineD3DCubeTexture* This, 5419 VBOXWINEEX_SHRC_STATE enmState); 5414 5420 #endif 5415 5421 … … 5665 5671 5666 5672 #ifdef VBOX_WITH_WDDM 5667 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 5668 IWineD3DResource* This); 5673 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 5674 IWineD3DResource* This, 5675 VBOXWINEEX_SHRC_STATE enmState); 5669 5676 #endif 5670 5677 … … 6426 6433 6427 6434 #ifdef VBOX_WITH_WDDM 6428 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 6429 IWineD3DResource* This); 6435 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 6436 IWineD3DResource* This, 6437 VBOXWINEEX_SHRC_STATE enmState); 6430 6438 #endif 6431 6439 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/vbox/VBoxWineEx.h
r38982 r40388 15 15 #ifndef ___VBoxWineEx_h__ 16 16 #define ___VBoxWineEx_h__ 17 18 typedef enum 19 { 20 VBOXWINEEX_SHRC_STATE_UNDEFINED = 0, 21 /* the underlying GL resource can not be used because it can be removed concurrently by other SHRC client */ 22 VBOXWINEEX_SHRC_STATE_GL_DISABLE, 23 /* the given client is requested to delete the underlying GL resource on SHRC termination */ 24 VBOXWINEEX_SHRC_STATE_GL_DELETE 25 } VBOXWINEEX_SHRC_STATE; 26 27 #ifndef IN_VBOXLIBWINE 17 28 18 29 #define VBOXWINEEX_VERSION 1 … … 42 53 typedef FNVBOXWINEEXD3DDEV9_UPDATE *PFNVBOXWINEEXD3DDEV9_UPDATE; 43 54 44 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DRC9_SET DONTDELETEGL(IDirect3DResource9 *iface);45 typedef FNVBOXWINEEXD3DRC9_SET DONTDELETEGL *PFNVBOXWINEEXD3DRC9_SETDONTDELETEGL;55 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DRC9_SETSHRCSTATE(IDirect3DResource9 *iface, VBOXWINEEX_SHRC_STATE enmState); 56 typedef FNVBOXWINEEXD3DRC9_SETSHRCSTATE *PFNVBOXWINEEXD3DRC9_SETSHRCSTATE; 46 57 47 58 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DSWAPCHAIN9_PRESENT(IDirect3DSwapChain9 *iface, IDirect3DSurface9 *surf); … … 69 80 IDirect3DDevice9Ex **outIface); /* update device parameters */ 70 81 71 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DRc9Set DontDeleteGl(IDirect3DResource9 *iface);82 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DRc9SetShRcState(IDirect3DResource9 *iface, VBOXWINEEX_SHRC_STATE enmState); 72 83 73 84 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9Present(IDirect3DSwapChain9 *iface, … … 77 88 #endif 78 89 90 #endif /* #ifndef IN_VBOXLIBWINE */ 91 79 92 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/vbox/libWineStub/include/wine/wined3d.h
r39602 r40388 6 6 #ifndef __WIDL_WINED3D_H 7 7 #define __WIDL_WINED3D_H 8 9 #ifdef VBOX_WITH_WDDM 10 #include "../../../vbox/VBoxWineEx.h" 11 #endif 8 12 9 13 # define DECLSPEC_HIDDEN … … 3432 3436 3433 3437 #ifdef VBOX_WITH_WDDM 3434 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 3435 IWineD3DResource* This); 3438 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 3439 IWineD3DResource* This, 3440 VBOXWINEEX_SHRC_STATE enmState); 3436 3441 #endif 3437 3442 … … 3459 3464 #define IWineD3DResource_GetType(This) (This)->lpVtbl->GetType(This) 3460 3465 # ifdef VBOX_WITH_WDDM 3461 # define IWineD3DResource_Set DontDeleteGl(This) (This)->lpVtbl->SetDontDeleteGl(This)3466 # define IWineD3DResource_SetShRcState(This, enmState) (This)->lpVtbl->SetShRcState(This, enmState) 3462 3467 # endif 3463 3468 #endif … … 4067 4072 4068 4073 #ifdef VBOX_WITH_WDDM 4069 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 4070 IWineD3DResource* This); 4074 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 4075 IWineD3DResource* This, 4076 VBOXWINEEX_SHRC_STATE enmState); 4071 4077 #endif 4072 4078 … … 4687 4693 4688 4694 #ifdef VBOX_WITH_WDDM 4689 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 4690 IWineD3DResource* This); 4695 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 4696 IWineD3DResource* This, 4697 VBOXWINEEX_SHRC_STATE enmState); 4691 4698 #endif 4692 4699 … … 4906 4913 4907 4914 #ifdef VBOX_WITH_WDDM 4908 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 4909 IWineD3DResource* This); 4915 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 4916 IWineD3DResource* This, 4917 VBOXWINEEX_SHRC_STATE enmState); 4910 4918 #endif 4911 4919 … … 5157 5165 5158 5166 #ifdef VBOX_WITH_WDDM 5159 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 5160 IWineD3DResource* This); 5167 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 5168 IWineD3DResource* This, 5169 VBOXWINEEX_SHRC_STATE enmState); 5161 5170 #endif 5162 5171 … … 5408 5417 5409 5418 #ifdef VBOX_WITH_WDDM 5410 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 5411 IWineD3DResource* This); 5419 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 5420 IWineD3DResource* This, 5421 VBOXWINEEX_SHRC_STATE enmState); 5412 5422 #endif 5413 5423 … … 5663 5673 5664 5674 #ifdef VBOX_WITH_WDDM 5665 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 5666 IWineD3DResource* This); 5675 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 5676 IWineD3DResource* This, 5677 VBOXWINEEX_SHRC_STATE enmState); 5667 5678 #endif 5668 5679 … … 6424 6435 6425 6436 #ifdef VBOX_WITH_WDDM 6426 HRESULT (STDMETHODCALLTYPE *SetDontDeleteGl)( 6427 IWineD3DResource* This); 6437 HRESULT (STDMETHODCALLTYPE *SetShRcState)( 6438 IWineD3DResource* This, 6439 VBOXWINEEX_SHRC_STATE enmState); 6428 6440 #endif 6429 6441 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/basetexture.c
r39899 r40388 296 296 TRACE("(%p) : About to bind texture\n", This); 297 297 298 #ifdef VBOX_WITH_WDDM 299 Assert(!VBOXSHRC_IS_DISABLED(This)); 300 #endif 301 298 302 This->baseTexture.is_srgb = srgb; /* SRGB mode cache for PreLoad calls outside drawprim */ 299 303 if(srgb) { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/buffer.c
r38982 r40388 1450 1450 buffer_GetType, 1451 1451 #ifdef VBOX_WITH_WDDM 1452 IWineD3DResourceImpl_Set DontDeleteGl,1452 IWineD3DResourceImpl_SetShRcState, 1453 1453 #endif 1454 1454 /* IWineD3DBuffer methods */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/cubetexture.c
r38982 r40388 246 246 247 247 #ifdef VBOX_WITH_WDDM 248 static HRESULT WINAPI IWineD3DCubeTextureImpl_Set DontDeleteGl(IWineD3DCubeTexture *iface) {248 static HRESULT WINAPI IWineD3DCubeTextureImpl_SetShRcState(IWineD3DCubeTexture *iface, VBOXWINEEX_SHRC_STATE enmState) { 249 249 IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl*)iface; 250 HRESULT hr = IWineD3DResourceImpl_Set DontDeleteGl((IWineD3DResource*)iface);250 HRESULT hr = IWineD3DResourceImpl_SetShRcState((IWineD3DResource*)iface, enmState); 251 251 unsigned int i, j; 252 252 253 253 if (FAILED(hr)) 254 254 { 255 ERR("IWineD3DResource_Set DontDeleteGlfailed");255 ERR("IWineD3DResource_SetShRcState failed"); 256 256 return hr; 257 257 } … … 260 260 for (j = WINED3DCUBEMAP_FACE_POSITIVE_X; j <= WINED3DCUBEMAP_FACE_NEGATIVE_Z; ++j) { 261 261 if (This->surfaces[j][i]) { 262 HRESULT tmpHr = IWineD3DResource_Set DontDeleteGl((IWineD3DResource*)This->surfaces[j][i]);262 HRESULT tmpHr = IWineD3DResource_SetShRcState((IWineD3DResource*)This->surfaces[j][i], enmState); 263 263 Assert(tmpHr == S_OK); 264 264 } 265 265 } 266 266 } 267 268 device_cleanup_durtify_texture_target(This->resource.device, ((IWineD3DSurfaceImpl*)This->surfaces[j][i])->texture_target); 267 269 268 270 return WINED3D_OK; … … 444 446 IWineD3DCubeTextureImpl_GetType, 445 447 #ifdef VBOX_WITH_WDDM 446 IWineD3DCubeTextureImpl_Set DontDeleteGl,448 IWineD3DCubeTextureImpl_SetShRcState, 447 449 #endif 448 450 /* IWineD3DBaseTexture */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/device.c
r39602 r40388 7010 7010 } 7011 7011 return WINED3D_OK; 7012 } 7013 7014 /* context activation is done by the caller */ 7015 void device_cleanup_durtify_texture_target(IWineD3DDeviceImpl *This, GLuint texture_target) 7016 { 7017 const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; 7018 unsigned int i; 7019 GLint active_texture=GL_TEXTURE0_ARB; 7020 ENTER_GL(); 7021 glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture); 7022 7023 for (i = 0; i < gl_info->limits.textures; ++i) 7024 { 7025 /* Make appropriate texture active */ 7026 GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + i)); 7027 checkGLcall("glActiveTextureARB"); 7028 7029 /* don't do glGet GL_TEXTURE_BINDING_xxx just ensure nothing is bound to IWineD3DSurfaceImpl::texture_target, 7030 * and dirtify the state later */ 7031 if (texture_target == GL_TEXTURE_2D) 7032 glBindTexture(texture_target, This->dummyTextureName[i]); 7033 else 7034 glBindTexture(texture_target, 0); 7035 } 7036 7037 /* restore tha active texture unit */ 7038 GL_EXTCALL(glActiveTextureARB(active_texture)); 7039 checkGLcall("glActiveTextureARB"); 7040 LEAVE_GL(); 7041 7042 /* dirtify */ 7043 for (i = 0; i < gl_info->limits.textures; ++i) 7044 { 7045 DWORD active_sampler = This->rev_tex_unit_map[active_texture - GL_TEXTURE0_ARB + i]; 7046 7047 if (active_sampler != WINED3D_UNMAPPED_STAGE) 7048 { 7049 IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(active_sampler)); 7050 } 7051 } 7052 7053 /* do flush to ensure this all goes to host */ 7054 wglFlush(); 7012 7055 } 7013 7056 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/resource.c
r38982 r40388 288 288 289 289 #ifdef VBOX_WITH_WDDM 290 HRESULT WINAPI IWineD3DResourceImpl_Set DontDeleteGl(IWineD3DResource *iface) {290 HRESULT WINAPI IWineD3DResourceImpl_SetShRcState(IWineD3DResource *iface, VBOXWINEEX_SHRC_STATE enmState) { 291 291 IWineD3DResourceImpl *This = (IWineD3DResourceImpl*)iface; 292 292 if (!VBOXSHRC_IS_SHARED(This)) … … 296 296 } 297 297 298 VBOXSHRC_SET_DONT_DELETE(This); 299 return WINED3D_OK; 300 } 301 #endif 298 switch (enmState) 299 { 300 case VBOXWINEEX_SHRC_STATE_GL_DISABLE: 301 VBOXSHRC_SET_DISABLE(This); 302 break; 303 case VBOXWINEEX_SHRC_STATE_GL_DELETE: 304 VBOXSHRC_SET_DELETE(This); 305 break; 306 default: 307 ERR("invalid arg"); 308 return E_INVALIDARG; 309 } 310 311 return WINED3D_OK; 312 } 313 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
r39899 r40388 672 672 IWineD3DSurface_BindTexture((IWineD3DSurface *)This, srgb); 673 673 } 674 674 675 675 676 /* This function checks if the primary render target uses the 8bit paletted format. */ … … 2868 2869 IWineD3DBaseTexture *baseTexture = NULL; 2869 2870 2871 #ifdef VBOX_WITH_WDDM 2872 Assert(!VBOXSHRC_IS_DISABLED(This)); 2873 #endif 2874 2870 2875 TRACE("(%p)Checking to see if the container is a base texture\n", This); 2871 2876 if (IWineD3DSurface_GetContainer(iface, &IID_IWineD3DBaseTexture, (void **)&baseTexture) == WINED3D_OK) { … … 5344 5349 } 5345 5350 5351 #ifdef VBOX_WITH_WDDM 5352 static HRESULT WINAPI IWineD3DSurfaceImpl_SetShRcState(IWineD3DSurface *iface, VBOXWINEEX_SHRC_STATE enmState) { 5353 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl*)iface; 5354 IWineD3DBaseTextureImpl *texture = NULL; 5355 HRESULT hr; 5356 unsigned int i; 5357 5358 if (SUCCEEDED(IWineD3DSurface_GetContainer(iface, &IID_IWineD3DBaseTexture, (void **)&texture))) 5359 { 5360 /* this is a texture, check that the */ 5361 switch (enmState) 5362 { 5363 case VBOXWINEEX_SHRC_STATE_GL_DISABLE: 5364 if (!VBOXSHRC_IS_DISABLED(texture)) 5365 { 5366 ERR("directly doing SetShRcState for texture surface not allowed!"); 5367 return E_FAIL; 5368 } 5369 break; 5370 case VBOXWINEEX_SHRC_STATE_GL_DELETE: 5371 if (!VBOXSHRC_IS_DELETE(texture)) 5372 { 5373 ERR("directly doing SetShRcState for texture surface not allowed!"); 5374 return E_FAIL; 5375 } 5376 break; 5377 default: 5378 ERR("invalid arg"); 5379 return E_INVALIDARG; 5380 } 5381 5382 IWineD3DBaseTexture_Release(texture); 5383 } 5384 5385 5386 hr = IWineD3DResourceImpl_SetShRcState((IWineD3DResource*)iface, enmState); 5387 if (FAILED(hr)) 5388 { 5389 ERR("IWineD3DResource_SetShRcState failed"); 5390 return hr; 5391 } 5392 5393 if (!texture) 5394 device_cleanup_durtify_texture_target(This->resource.device, This->texture_target); 5395 5396 return WINED3D_OK; 5397 } 5398 #endif 5399 5346 5400 const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl = 5347 5401 { … … 5361 5415 IWineD3DBaseSurfaceImpl_GetType, 5362 5416 #ifdef VBOX_WITH_WDDM 5363 IWineD3D ResourceImpl_SetDontDeleteGl,5417 IWineD3DSurfaceImpl_SetShRcState, 5364 5418 #endif 5365 5419 /* IWineD3DSurface */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface_gdi.c
r38982 r40388 667 667 IWineD3DBaseSurfaceImpl_GetType, 668 668 #ifdef VBOX_WITH_WDDM 669 IWineD3DResourceImpl_Set DontDeleteGl,669 IWineD3DResourceImpl_SetShRcState, 670 670 #endif 671 671 /* IWineD3DSurface */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/texture.c
r39899 r40388 232 232 233 233 #ifdef VBOX_WITH_WDDM 234 static HRESULT WINAPI IWineD3DTextureImpl_Set DontDeleteGl(IWineD3DTexture *iface) {234 static HRESULT WINAPI IWineD3DTextureImpl_SetShRcState(IWineD3DTexture *iface, VBOXWINEEX_SHRC_STATE enmState) { 235 235 IWineD3DTextureImpl *This = (IWineD3DTextureImpl*)iface; 236 HRESULT hr = IWineD3DResourceImpl_Set DontDeleteGl((IWineD3DResource*)iface);236 HRESULT hr = IWineD3DResourceImpl_SetShRcState((IWineD3DResource*)iface, enmState); 237 237 unsigned int i; 238 238 239 239 if (FAILED(hr)) 240 240 { 241 ERR("IWineD3DResource_Set DontDeleteGlfailed");241 ERR("IWineD3DResource_SetShRcState failed"); 242 242 return hr; 243 243 } … … 247 247 if (This->surfaces[i]) 248 248 { 249 HRESULT tmpHr = IWineD3DResource_Set DontDeleteGl((IWineD3DResource*)This->surfaces[i]);249 HRESULT tmpHr = IWineD3DResource_SetShRcState((IWineD3DResource*)This->surfaces[i], enmState); 250 250 Assert(tmpHr == S_OK); 251 251 } 252 252 } 253 254 device_cleanup_durtify_texture_target(This->resource.device, This->target); 253 255 254 256 return WINED3D_OK; … … 299 301 300 302 TRACE("(%p) : relay to BaseTexture\n", This); 303 304 #ifdef VBOX_WITH_WDDM 305 Assert(!VBOXSHRC_IS_DISABLED(This)); 306 #endif 301 307 302 308 hr = basetexture_bind((IWineD3DBaseTexture *)iface, srgb, &set_gl_texture_desc); … … 451 457 IWineD3DTextureImpl_GetType, 452 458 #ifdef VBOX_WITH_WDDM 453 IWineD3DTextureImpl_Set DontDeleteGl,459 IWineD3DTextureImpl_SetShRcState, 454 460 #endif 455 461 /* IWineD3DBaseTexture */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vboxsharedrc.h
r39648 r40388 19 19 #define VBOXSHRC_F_SHARED 0x00000001 /* shared rc */ 20 20 #define VBOXSHRC_F_SHARED_OPENED 0x00000002 /* if set shared rc is opened, otherwise it is created */ 21 #define VBOXSHRC_F_DONT_DELETE 0x00000004 /* don't delete gl resources on d3d resource deletion */ 21 #define VBOXSHRC_F_GL_DISABLE 0x00000004 /* don't delete gl resources on d3d resource deletion */ 22 #define VBOXSHRC_F_GL_DELETE 0x00000008 /* don't delete gl resources on d3d resource deletion */ 22 23 23 24 #define VBOXSHRC_GET_SHAREFLAFS(_o) ((_o)->resource.sharerc_flags) … … 30 31 #define VBOXSHRC_SET_SHARED(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_SHARED) 31 32 #define VBOXSHRC_SET_SHARED_OPENED(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_SHARED_OPENED) 32 #define VBOXSHRC_SET_DONT_DELETE(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_DONT_DELETE) 33 #define VBOXSHRC_SET_DISABLE(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_GL_DISABLE) 34 #define VBOXSHRC_SET_DELETE(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) = (VBOXSHRC_GET_SHAREFLAFS(_o) | VBOXSHRC_F_GL_DELETE) & (~VBOXSHRC_F_GL_DISABLE)) 33 35 34 36 #define VBOXSHRC_IS_SHARED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED)) 35 37 #define VBOXSHRC_IS_SHARED_OPENED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED_OPENED)) 36 38 #define VBOXSHRC_IS_SHARED_UNLOCKED(_o) (VBOXSHRC_IS_SHARED(_o) && !VBOXSHRC_IS_LOCKED(_o)) 37 #define VBOXSHRC_ CAN_DELETE(_d,_o) ( \38 !VBOXSHRC_IS_SHARED(_o) \39 || !(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_DONT_DELETE) \39 #define VBOXSHRC_IS_DISABLED(_o) ( \ 40 VBOXSHRC_IS_SHARED(_o) \ 41 && (VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_GL_DISABLE) \ 40 42 ) 43 #define VBOXSHRC_IS_DELETE(_o) ( \ 44 VBOXSHRC_IS_SHARED(_o) \ 45 && (VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_GL_DELETE) \ 46 ) 47 48 #define VBOXSHRC_CAN_DELETE(_d, _o) (!VBOXSHRC_IS_DISABLED(_o)) 41 49 42 50 #define VBOXSHRC_LOCK(_o) do{ \ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/volume.c
r38982 r40388 382 382 IWineD3DVolumeImpl_GetType, 383 383 #ifdef VBOX_WITH_WDDM 384 IWineD3DResourceImpl_Set DontDeleteGl,384 IWineD3DResourceImpl_SetShRcState, 385 385 #endif 386 386 /* IWineD3DVolume */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/volumetexture.c
r38982 r40388 340 340 IWineD3DVolumeTextureImpl_GetType, 341 341 #ifdef VBOX_WITH_WDDM 342 IWineD3DResourceImpl_Set DontDeleteGl,342 IWineD3DResourceImpl_SetShRcState, 343 343 #endif 344 344 /* BaseTexture */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h
r39899 r40388 1811 1811 LRESULT device_process_message(IWineD3DDeviceImpl *device, HWND window, 1812 1812 UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; 1813 #else 1814 void device_cleanup_durtify_texture_target(IWineD3DDeviceImpl *This, GLuint texture_target); 1813 1815 #endif 1814 1816 void device_resource_add(IWineD3DDeviceImpl *This, IWineD3DResource *resource) DECLSPEC_HIDDEN; … … 1902 1904 1903 1905 #ifdef VBOX_WITH_WDDM 1904 HRESULT WINAPI IWineD3DResourceImpl_Set DontDeleteGl(IWineD3DResource *iface);1906 HRESULT WINAPI IWineD3DResourceImpl_SetShRcState(IWineD3DResource *iface, VBOXWINEEX_SHRC_STATE enmState); 1905 1907 #endif 1906 1908 -
trunk/src/VBox/GuestHost/OpenGL/util/error.c
r40267 r40388 251 251 va_end( args ); 252 252 253 #if defined(WINDOWS) && defined(DEBUG) /* && !defined(IN_GUEST) */253 #if defined(WINDOWS) && defined(DEBUG) && !defined(IN_GUEST) 254 254 DebugBreak(); 255 255 #endif
Note:
See TracChangeset
for help on using the changeset viewer.