- Timestamp:
- Jul 11, 2011 1:17:25 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72767
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.cpp
r37840 r37870 186 186 Assert(pAlloc->hAllocation); 187 187 188 HANDLE hSharedHandle = pAlloc->hSharedHandle; 189 190 vboxVDbgPrint(("SharedHandle: (0x%p)\n", hSharedHandle)); 191 188 192 D3DDDICB_LOCK LockData; 189 193 LockData.hAllocation = pAlloc->hAllocation; … … 203 207 { 204 208 UINT bpp = vboxWddmCalcBitsPerPixel(pAlloc->SurfDesc.format); 205 vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n", 209 vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>, ( !vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d )\n", 210 LockData.pData, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, pAlloc->SurfDesc.pitch, 206 211 LockData.pData, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, pAlloc->SurfDesc.pitch)); 207 212 if (pRect) … … 210 215 Assert(pRect->bottom > pRect->top); 211 216 vboxVDbgDoPrintRect("rect: ", pRect, "\n"); 212 vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n", 217 vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>, ( !vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d )\n", 218 ((uint8_t*)LockData.pData) + (pRect->top * pAlloc->SurfDesc.pitch) + ((pRect->left * bpp) >> 3), 219 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, pAlloc->SurfDesc.pitch, 213 220 ((uint8_t*)LockData.pData) + (pRect->top * pAlloc->SurfDesc.pitch) + ((pRect->left * bpp) >> 3), 214 221 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, pAlloc->SurfDesc.pitch)); … … 263 270 { 264 271 UINT bpp = vboxWddmCalcBitsPerPixel((D3DDDIFORMAT)Desc.Format); 265 vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n", 272 vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>, ( !vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d )\n", 273 Lr.pBits, Desc.Width, Desc.Height, bpp, Lr.Pitch, 266 274 Lr.pBits, Desc.Width, Desc.Height, bpp, Lr.Pitch)); 267 275 if (pRect) … … 270 278 Assert(pRect->bottom > pRect->top); 271 279 vboxVDbgDoPrintRect("rect: ", pRect, "\n"); 272 vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n", 280 vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>, ( !vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d )\n", 281 ((uint8_t*)Lr.pBits) + (pRect->top * Lr.Pitch) + ((pRect->left * bpp) >> 3), 282 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, Lr.Pitch, 273 283 ((uint8_t*)Lr.pBits) + (pRect->top * Lr.Pitch) + ((pRect->left * bpp) >> 3), 274 284 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, Lr.Pitch)); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h
r37845 r37870 168 168 ) \ 169 169 { \ 170 vboxVDbgDoDumpRcRectByRc("== "__FUNCTION__": Texture Dump\n", _pRc, NULL, "\n"); \ 170 vboxVDbgPrint(("== "__FUNCTION__": Texture Dump, SharedHandle(0x%p)\n", (_pRc)->aAllocations[0].hSharedHandle)); \ 171 vboxVDbgDoDumpRcRectByRc("", _pRc, NULL, "\n"); \ 171 172 } \ 172 173 } while (0) … … 204 205 ) \ 205 206 { \ 206 vboxVDbgDoDumpSurfRect("==>"__FUNCTION__" Src:\n", (_pSrcSurf), (_pSrcRect), "\n", true); \ 207 vboxVDbgDoDumpSurfRect("==>"__FUNCTION__" Dst:\n", (_pDstSurf), (_pDstRect), "\n", true); \ 207 vboxVDbgPrint(("==>"__FUNCTION__" Src: SharedHandle(0x%p)\n", (_pSrcRc)->aAllocations[0].hSharedHandle)); \ 208 vboxVDbgDoDumpSurfRect("", (_pSrcSurf), (_pSrcRect), "\n", true); \ 209 vboxVDbgPrint(("==>"__FUNCTION__" Dst: SharedHandle(0x%p)\n", (_pDstRc)->aAllocations[0].hSharedHandle)); \ 210 vboxVDbgDoDumpSurfRect("", (_pDstSurf), (_pDstRect), "\n", true); \ 208 211 } \ 209 212 } while (0) … … 215 218 ) \ 216 219 { \ 217 vboxVDbgDoDumpSurfRect("<=="__FUNCTION__" Src:\n", (_pSrcSurf), (_pSrcRect), "\n", true); \ 218 vboxVDbgDoDumpSurfRect("<=="__FUNCTION__" Dst:\n", (_pDstSurf), (_pDstRect), "\n", true); \ 220 vboxVDbgPrint(("<=="__FUNCTION__" Src: SharedHandle(0x%p)\n", (_pSrcRc)->aAllocations[0].hSharedHandle)); \ 221 vboxVDbgDoDumpSurfRect("", (_pSrcSurf), (_pSrcRect), "\n", true); \ 222 vboxVDbgPrint(("<=="__FUNCTION__" Dst: SharedHandle(0x%p)\n", (_pDstRc)->aAllocations[0].hSharedHandle)); \ 223 vboxVDbgDoDumpSurfRect("", (_pDstSurf), (_pDstRect), "\n", true); \ 219 224 } \ 220 225 } while (0) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/cubetexture.c
r35650 r37870 574 574 { 575 575 Assert(shared_handle); 576 VBOXSHRC_SET_INITIALIZED(texture);577 576 for (i = 0; i < texture->baseTexture.levels; ++i) 578 577 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
r37394 r37870 46 46 #define GLINFO_LOCATION (*gl_info) 47 47 48 #ifdef VBOX_WITH_WDDM 49 void surface_shrc_lock_surf(IWineD3DSurfaceImpl *This) 50 { 51 VBOXSHRC_LOCK(This); 52 } 53 54 void surface_shrc_unlock_surf(IWineD3DSurfaceImpl *This) 55 { 56 VBOXSHRC_UNLOCK(This); 57 if (VBOXSHRC_IS_LOCKED(This)) 58 return; 59 60 /* perform data->texture synchronization */ 61 IWineD3DSurface_LoadLocation((IWineD3DSurface*)This, SFLAG_INTEXTURE, NULL); 62 } 63 64 void surface_shrc_lock(IWineD3DSurfaceImpl *This) 65 { 66 if (!VBOXSHRC_IS_SHARED(This)) 67 return; 68 69 surface_shrc_lock_surf(This); 70 } 71 72 void surface_shrc_unlock(IWineD3DSurfaceImpl *This) 73 { 74 if (!VBOXSHRC_IS_SHARED(This)) 75 return; 76 surface_shrc_unlock_surf(This); 77 } 78 #endif 79 48 80 static void surface_cleanup(IWineD3DSurfaceImpl *This) 49 81 { … … 410 442 } 411 443 444 #ifdef VBOX_WITH_WDDM 445 /* this will be a nop for the non-shared resource, 446 * for the shared resource this will ensure the surface is initialized properly */ 447 surface_shrc_lock(surface); 448 #endif 449 412 450 /* "Standalone" surface. */ 413 451 IWineD3DSurface_SetContainer((IWineD3DSurface *)surface, NULL); … … 487 525 { 488 526 Assert(shared_handle); 489 VBOXSHRC_SET_INITIALIZED(surface); 490 IWineD3DSurface_LoadLocation((IWineD3DSurface*)surface, SFLAG_INTEXTURE, NULL); 527 surface_shrc_unlock(surface); 491 528 if (!VBOXSHRC_IS_SHARED_OPENED(surface)) 492 529 { … … 514 551 515 552 #if defined(DEBUG_misha) && defined (VBOX_WITH_WDDM) 516 if (VBOXSHRC_IS_ INITIALIZED(This))553 if (VBOXSHRC_IS_SHARED_UNLOCKED(This)) 517 554 { 518 555 Assert(0); … … 1803 1840 IWineD3DDeviceImpl *myDevice = This->resource.device; 1804 1841 const RECT *pass_rect = pRect; 1842 HRESULT hr = S_OK; 1805 1843 1806 1844 TRACE("(%p) : rect@%p flags(%08x), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory); … … 1814 1852 return WINED3DERR_INVALIDCALL; 1815 1853 } 1854 1855 #ifdef VBOX_WITH_WDDM 1856 surface_shrc_lock(This); 1857 #endif 1858 1816 1859 This->Flags |= SFLAG_LOCKED; 1817 1860 … … 1899 1942 } 1900 1943 1901 return IWineD3DBaseSurfaceImpl_LockRect(iface, pLockedRect, pRect, Flags); 1944 hr = IWineD3DBaseSurfaceImpl_LockRect(iface, pLockedRect, pRect, Flags); 1945 #ifdef VBOX_WITH_WDDM 1946 if (FAILED(hr)) 1947 { 1948 WARN("IWineD3DBaseSurfaceImpl_LockRect failed, hr (%d)\n", hr); 1949 surface_shrc_unlock(This); 1950 } 1951 /* if lock succeeded, we keep the shrc locked until unlock */ 1952 #endif 1953 return hr; 1902 1954 } 1903 1955 … … 2108 2160 IWineD3DSurface_DrawOverlay(iface); 2109 2161 } 2162 2163 #ifdef VBOX_WITH_WDDM 2164 surface_shrc_unlock(This); 2165 #endif 2166 2110 2167 return WINED3D_OK; 2111 2168 } … … 4146 4203 IWineD3DSurfaceImpl *Src = (IWineD3DSurfaceImpl *) SrcSurface; 4147 4204 IWineD3DDeviceImpl *myDevice = This->resource.device; 4205 HRESULT hr = WINED3D_OK; 4148 4206 4149 4207 TRACE("(%p)->(%p,%p,%p,%x,%p)\n", This, DestRect, SrcSurface, SrcRect, Flags, DDBltFx); … … 4155 4213 return WINEDDERR_SURFACEBUSY; 4156 4214 } 4215 4216 #ifdef VBOX_WITH_WDDM 4217 surface_shrc_lock(This); 4218 surface_shrc_lock(Src); 4219 #endif 4157 4220 4158 4221 /* Accessing the depth stencil is supposed to fail between a BeginScene and EndScene pair, … … 4162 4225 if(myDevice->inScene && !(Flags & WINEDDBLT_DEPTHFILL)) { 4163 4226 TRACE("Attempt to access the depth stencil surface in a BeginScene / EndScene pair, returning WINED3DERR_INVALIDCALL\n"); 4164 return WINED3DERR_INVALIDCALL; 4227 hr = WINED3DERR_INVALIDCALL; 4228 goto end; 4165 4229 } else if(IWineD3DSurfaceImpl_BltZ(This, DestRect, SrcSurface, SrcRect, Flags, DDBltFx) == WINED3D_OK) { 4166 4230 TRACE("Z Blit override handled the blit\n"); 4167 return WINED3D_OK; 4231 hr = WINED3D_OK; 4232 goto end; 4168 4233 } 4169 4234 } … … 4172 4237 if( (This->resource.usage & WINED3DUSAGE_RENDERTARGET) || 4173 4238 ( Src && (Src->resource.usage & WINED3DUSAGE_RENDERTARGET) )) { 4174 if(IWineD3DSurfaceImpl_BltOverride(This, DestRect, SrcSurface, SrcRect, Flags, DDBltFx, Filter) == WINED3D_OK) return WINED3D_OK; 4239 if(IWineD3DSurfaceImpl_BltOverride(This, DestRect, SrcSurface, SrcRect, Flags, DDBltFx, Filter) == WINED3D_OK) 4240 { 4241 hr = WINED3D_OK; 4242 goto end; 4243 } 4175 4244 } 4176 4245 4177 4246 #ifdef VBOX_WITH_WDDM 4178 if (IWineD3DSurfaceImpl_BltSys2Vram(This, DestRect, SrcSurface, SrcRect, Flags, DDBltFx, Filter) == WINED3D_OK) return WINED3D_OK; 4247 if (IWineD3DSurfaceImpl_BltSys2Vram(This, DestRect, SrcSurface, SrcRect, Flags, DDBltFx, Filter) == WINED3D_OK) 4248 { 4249 hr = WINED3D_OK; 4250 goto end; 4251 } 4179 4252 #endif 4180 4253 … … 4183 4256 * other Blts are rather rare 4184 4257 */ 4185 return IWineD3DBaseSurfaceImpl_Blt(iface, DestRect, SrcSurface, SrcRect, Flags, DDBltFx, Filter); 4258 hr = IWineD3DBaseSurfaceImpl_Blt(iface, DestRect, SrcSurface, SrcRect, Flags, DDBltFx, Filter); 4259 end: 4260 #ifdef VBOX_WITH_WDDM 4261 surface_shrc_unlock(This); 4262 surface_shrc_unlock(Src); 4263 #endif 4264 return hr; 4186 4265 } 4187 4266 … … 4192 4271 IWineD3DSurfaceImpl *srcImpl = (IWineD3DSurfaceImpl *) Source; 4193 4272 IWineD3DDeviceImpl *myDevice = This->resource.device; 4273 HRESULT hr = WINED3D_OK; 4194 4274 4195 4275 TRACE("(%p)->(%d, %d, %p, %p, %08x\n", iface, dstx, dsty, Source, rsrc, trans); … … 4207 4287 return WINED3DERR_INVALIDCALL; 4208 4288 } 4289 4290 #ifdef VBOX_WITH_WDDM 4291 surface_shrc_lock(This); 4292 surface_shrc_lock(srcImpl); 4293 #endif 4209 4294 4210 4295 /* Special cases for RenderTargets */ … … 4232 4317 Flags |= WINEDDBLT_DONOTWAIT; 4233 4318 4234 if(IWineD3DSurfaceImpl_BltOverride(This, &DstRect, Source, &SrcRect, Flags, NULL, WINED3DTEXF_POINT) == WINED3D_OK) return WINED3D_OK; 4235 } 4236 4237 4238 return IWineD3DBaseSurfaceImpl_BltFast(iface, dstx, dsty, Source, rsrc, trans); 4319 if(IWineD3DSurfaceImpl_BltOverride(This, &DstRect, Source, &SrcRect, Flags, NULL, WINED3DTEXF_POINT) == WINED3D_OK) 4320 { 4321 hr = WINED3D_OK; 4322 goto end; 4323 } 4324 } 4325 4326 4327 hr = IWineD3DBaseSurfaceImpl_BltFast(iface, dstx, dsty, Source, rsrc, trans); 4328 end: 4329 #ifdef VBOX_WITH_WDDM 4330 surface_shrc_unlock(This); 4331 surface_shrc_unlock(srcImpl); 4332 #endif 4333 return hr; 4239 4334 } 4240 4335 … … 4614 4709 4615 4710 #ifdef VBOX_WITH_WDDM 4616 if(VBOXSHRC_IS_ INITIALIZED(This)) {4711 if(VBOXSHRC_IS_SHARED_UNLOCKED(This)) { 4617 4712 /* with the shared resource only texture can be considered valid 4618 4713 * to make sure changes done to the resource in the other device context are visible … … 4731 4826 if(This->Flags & flag) { 4732 4827 TRACE("Location already up to date\n"); 4828 #ifdef VBOX_WITH_WDDM 4829 goto post_process; 4830 #else 4733 4831 return WINED3D_OK; 4832 #endif 4734 4833 } 4735 4834 … … 4933 5032 4934 5033 #ifdef VBOX_WITH_WDDM 4935 if (VBOXSHRC_IS_INITIALIZED(This)) 5034 post_process: 5035 5036 if (VBOXSHRC_IS_SHARED_UNLOCKED(This)) 4936 5037 { 4937 5038 /* with the shared resource only texture can be considered valid -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/texture.c
r35650 r37870 622 622 { 623 623 Assert(shared_handle); 624 VBOXSHRC_SET_INITIALIZED(texture);625 624 for (i = 0; i < texture->baseTexture.levels; ++i) 626 625 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vboxsharedrc.h
r37840 r37870 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_INITIALIZED 0x00000004 /* set once shared rc is initialized */22 21 23 22 #define VBOXSHRC_GET_SHAREFLAFS(_o) ((_o)->resource.sharerc_flags) 24 #define VBOXSHRC_GET_SHAREHANDLE(_o) ((_o)->resource.sharerc_handle) 25 #define VBOXSHRC_SET_SHAREHANDLE(_o, _h) ((_o)->resource.sharerc_handle = (_h)) 26 #define VBOXSHRC_SET_INITIALIZED(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_INITIALIZED) 23 #define VBOXSHRC_GET_SHAREHANDLE(_o) ((HANDLE)(_o)->resource.sharerc_handle) 24 #define VBOXSHRC_SET_SHAREHANDLE(_o, _h) ((_o)->resource.sharerc_handle = (DWORD)(_h)) 27 25 #define VBOXSHRC_COPY_SHAREDATA(_oDst, _oSrc) do { \ 28 26 VBOXSHRC_GET_SHAREFLAFS(_oDst) = VBOXSHRC_GET_SHAREFLAFS(_oSrc); \ … … 33 31 #define VBOXSHRC_IS_SHARED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED)) 34 32 #define VBOXSHRC_IS_SHARED_OPENED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED_OPENED)) 35 #define VBOXSHRC_IS_ INITIALIZED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_INITIALIZED))33 #define VBOXSHRC_IS_SHARED_UNLOCKED(_o) (VBOXSHRC_IS_SHARED(_o) && !VBOXSHRC_IS_LOCKED(_o)) 36 34 35 #define VBOXSHRC_LOCK(_o) do{ \ 36 Assert(VBOXSHRC_IS_SHARED(_o)); \ 37 ++(_o)->resource.sharerc_locks; \ 38 } while (0) 39 #define VBOXSHRC_UNLOCK(_o) do{ \ 40 Assert(VBOXSHRC_IS_SHARED(_o)); \ 41 --(_o)->resource.sharerc_locks; \ 42 Assert((_o)->resource.sharerc_locks < UINT32_MAX/2); \ 43 } while (0) 44 #define VBOXSHRC_IS_LOCKED(_o) ( \ 45 !!((_o)->resource.sharerc_locks) \ 46 ) 37 47 #ifdef VBOX_WINE_WITH_IPRT 38 48 # include <iprt/assert.h> -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h
r37550 r37870 1841 1841 #ifdef VBOX_WITH_WDDM 1842 1842 DWORD sharerc_flags; /* shared resource flags */ 1843 DWORD sharerc_handle; 1843 DWORD sharerc_handle; /* shared resource handle */ 1844 DWORD sharerc_locks; /* lock count */ 1844 1845 #endif 1845 1846 struct list privateData;
Note:
See TracChangeset
for help on using the changeset viewer.