Changeset 43488 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Oct 1, 2012 11:54:33 AM (12 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Wine
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/Makefile.kmk
r42408 r43488 225 225 IN_VBOXLIBWINE \ 226 226 VBOX_WINE_WITH_SHADER_CACHE 227 ifdef VBOX_WINE_WITH_PROFILE 228 wined3dwddm_DEFS += VBOX_WINE_WITH_PROFILE 229 endif 227 230 wined3dwddm_INCS = $(wined3d_INCS) \ 228 231 $(PATH_ROOT)/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9wddm.def
r43334 r43488 13 13 Direct3DCreate9Ex 14 14 VBoxWineExD3DDev9Flush 15 VBoxWineExD3DDev9FlushToHost 16 VBoxWineExD3DDev9Finish 15 17 VBoxWineExD3DDev9CreateTexture 16 18 VBoxWineExD3DDev9CreateCubeTexture -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/device.c
r43334 r43488 786 786 wined3d_mutex_lock(); 787 787 hr = IWineD3DDevice_Flush(This->WineD3DDevice); 788 wined3d_mutex_unlock(); 789 790 return hr; 791 } 792 793 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9FlushToHost(IDirect3DDevice9Ex *iface) 794 { 795 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; 796 HRESULT hr; 797 798 TRACE("iface %p, FlushToHost\n", iface); 799 800 wined3d_mutex_lock(); 801 hr = IWineD3DDevice_FlushToHost(This->WineD3DDevice); 802 wined3d_mutex_unlock(); 803 804 return hr; 805 } 806 807 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9Finish(IDirect3DDevice9Ex *iface) 808 { 809 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; 810 HRESULT hr; 811 812 TRACE("iface %p, Finish\n", iface); 813 814 wined3d_mutex_lock(); 815 hr = IWineD3DDevice_Finish(This->WineD3DDevice); 788 816 wined3d_mutex_unlock(); 789 817 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/vbox/VBoxWineEx.h
r43334 r43488 69 69 typedef FNVBOXWINEEXD3DDEV9_FLUSH *PFNVBOXWINEEXD3DDEV9_FLUSH; 70 70 71 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DDEV9_FLUSHTOHOST(IDirect3DDevice9Ex *iface); 72 typedef FNVBOXWINEEXD3DDEV9_FLUSHTOHOST *PFNVBOXWINEEXD3DDEV9_FLUSHTOHOST; 73 74 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DDEV9_FINISH(IDirect3DDevice9Ex *iface); 75 typedef FNVBOXWINEEXD3DDEV9_FINISH *PFNVBOXWINEEXD3DDEV9_FINISH; 76 71 77 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DDEV9_UPDATE(IDirect3DDevice9Ex *iface, D3DPRESENT_PARAMETERS * pParams, IDirect3DDevice9Ex **outIface); 72 78 typedef FNVBOXWINEEXD3DDEV9_UPDATE *PFNVBOXWINEEXD3DDEV9_UPDATE; … … 114 120 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9Flush(IDirect3DDevice9Ex *iface); /* perform glFlush */ 115 121 122 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9Finish(IDirect3DDevice9Ex *iface); /* perform glFinish */ 123 124 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9FlushToHost(IDirect3DDevice9Ex *iface); /* flash data to host */ 125 116 126 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9Update(IDirect3DDevice9Ex *iface, D3DPRESENT_PARAMETERS * pParams, 117 127 IDirect3DDevice9Ex **outIface); /* update device parameters */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/vbox/libWineStub/include/wine/debug.h
r41428 r43488 359 359 360 360 361 #if def DEBUG_misha362 //# define VBOXWINEDBG_SHADERS363 #endif 364 365 #if def VBOXWINEDBG_SHADERS361 #if 1//fdef DEBUG_misha 362 # define VBOXWINEDBG_SHADERS 363 #endif 364 365 #if defined(VBOXWINEDBG_SHADERS) || defined(VBOX_WINE_WITH_PROFILE) 366 366 #include <stdio.h> 367 367 #include <stdarg.h> 368 368 369 369 void vboxWDbgPrintF(char * szString, ...); 370 370 #endif 371 372 #ifdef VBOXWINEDBG_SHADERS 371 373 # define WDLOG(_m) do {\ 372 374 vboxWDbgPrintF _m ; \ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/vbox/libWineStub/include/wine/wined3d.h
r43334 r43488 8252 8252 const struct VBOXPOINT3D *pDstPoin3D 8253 8253 ); 8254 8255 HRESULT (STDMETHODCALLTYPE *FlushToHost)( 8256 IWineD3DDevice *iface); 8257 8258 HRESULT (STDMETHODCALLTYPE *Finish)( 8259 IWineD3DDevice* This); 8254 8260 #endif 8255 8261 … … 8427 8433 #define IWineD3DDevice_VolBlt(This, pSourceVolume, pDestinationVolume, pSrcBoxArg, pDstPoin3D) (This)->lpVtbl->VolBlt(This, pSourceVolume, pDestinationVolume, pSrcBoxArg, pDstPoin3D) 8428 8434 #define IWineD3DDevice_VolTexBlt(This, pSourceTexture, pDestinationTexture, pSrcBoxArg, pDstPoin3D) (This)->lpVtbl->VolTexBlt(This, pSourceTexture, pDestinationTexture, pSrcBoxArg, pDstPoin3D) 8435 #define IWineD3DDevice_FlushToHost(This) (This)->lpVtbl->FlushToHost(This) 8436 #define IWineD3DDevice_Finish(This) (This)->lpVtbl->Finish(This) 8429 8437 #endif 8430 8438 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/device.c
r43334 r43488 1871 1871 if(!This->d3d_initialized) return WINED3DERR_INVALIDCALL; 1872 1872 1873 #ifdef VBOX_WINE_WITH_PROFILE 1874 VBOXWINEPROFILE_DRAWPRIM_TERM(&This->DrawPrimProfile); 1875 #endif 1876 1873 1877 /* I don't think that the interface guarantees that the device is destroyed from the same thread 1874 1878 * it was created. Thus make sure a context is active for the glDelete* calls … … 7269 7273 return WINED3D_OK; 7270 7274 } 7275 7276 static HRESULT WINAPI IWineD3DDeviceImpl_Finish(IWineD3DDevice *iface) 7277 { 7278 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; 7279 struct wined3d_context *context; 7280 int i; 7281 7282 /* first call swapchain flush to ensure all swapchain-pending data gets flushed */ 7283 for (i = 0; i < This->NumberOfSwapChains; ++i) 7284 { 7285 IWineD3DSwapChain *pSwapchain = This->swapchains[i]; 7286 IWineD3DSwapChain_Flush(pSwapchain); 7287 } 7288 7289 for (i = 0; i < This->numContexts; ++i) 7290 { 7291 context = This->contexts[i]; 7292 if (context_acquire_context(context, NULL, CTXUSAGE_RESOURCELOAD, TRUE)) 7293 { 7294 Assert(context->valid); 7295 wglFinish(); 7296 context_release(context); 7297 } 7298 else 7299 { 7300 WARN("Invalid context, skipping flush.\n"); 7301 } 7302 } 7303 return WINED3D_OK; 7304 } 7305 7306 static HRESULT WINAPI IWineD3DDeviceImpl_FlushToHost(IWineD3DDevice *iface) 7307 { 7308 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; 7309 struct wined3d_context *context; 7310 int i; 7311 7312 /* no context acquisition is needed */ 7313 for (i = 0; i < This->numContexts; ++i) 7314 { 7315 context = This->contexts[i]; 7316 pVBoxFlushToHost(context->glCtx); 7317 } 7318 return WINED3D_OK; 7319 } 7320 7271 7321 7272 7322 /* context activation is done by the caller */ … … 7474 7524 IWineD3DDeviceImpl_VolBlt, 7475 7525 IWineD3DDeviceImpl_VolTexBlt, 7526 IWineD3DDeviceImpl_FlushToHost, 7527 IWineD3DDeviceImpl_Finish, 7476 7528 #endif 7477 7529 }; … … 7519 7571 device->createParms.hFocusWindow = focus_window; 7520 7572 device->createParms.BehaviorFlags = flags; 7573 7574 #ifdef VBOX_WINE_WITH_PROFILE 7575 VBOXWINEPROFILE_DRAWPRIM_INIT(&device->DrawPrimProfile); 7576 #endif 7521 7577 7522 7578 device->devType = device_type; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c
r43333 r43488 5335 5335 }; 5336 5336 5337 #if def VBOXWINEDBG_SHADERS5337 #if defined(VBOXWINEDBG_SHADERS) || defined(VBOX_WINE_WITH_PROFILE) 5338 5338 void vboxWDbgPrintF(char * szString, ...) 5339 5339 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_gl.h
r42499 r43488 1383 1383 1384 1384 HGLRC (WINAPI *pVBoxCreateContext)(HDC, struct VBOXUHGSMI*) DECLSPEC_HIDDEN; 1385 void (WINAPI *pVBoxFlushToHost)(HGLRC) DECLSPEC_HIDDEN; 1385 1386 1386 1387 #define GL_FUNCS_GEN \ … … 1731 1732 1732 1733 #define VBOX_FUNCS_GEN \ 1733 USE_WGL_FUNC(VBoxCreateContext) 1734 USE_WGL_FUNC(VBoxCreateContext) \ 1735 USE_WGL_FUNC(VBoxFlushToHost) 1734 1736 1735 1737 /* OpenGL extensions. */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h
r43334 r43488 1676 1676 #define WINED3DCREATE_MULTITHREADED 0x00000004 1677 1677 1678 #ifdef VBOX_WINE_WITH_PROFILE 1679 1680 #include <iprt/time.h> 1681 1682 #define VBOXWINEPROFILE_GET_TIME_NANO() RTTimeNanoTS() 1683 #define VBOXWINEPROFILE_GET_TIME_MILLI() RTTimeMilliTS() 1684 1685 # define PRLOG(_m) do {\ 1686 vboxWDbgPrintF _m ; \ 1687 } while (0) 1688 1689 typedef struct VBOXWINEPROFILE_ELEMENT 1690 { 1691 uint64_t u64Time; 1692 uint32_t cu32Calls; 1693 } VBOXWINEPROFILE_ELEMENT, *PVBOXWINEPROFILE_ELEMENT; 1694 1695 typedef struct VBOXWINEPROFILE_HASHMAP_ELEMENT 1696 { 1697 VBOXEXT_HASHMAP_ENTRY MapEntry; 1698 VBOXWINEPROFILE_ELEMENT Data; 1699 } VBOXWINEPROFILE_HASHMAP_ELEMENT, *PVBOXWINEPROFILE_HASHMAP_ELEMENT; 1700 1701 #define VBOXWINEPROFILE_HASHMAP_ELEMENT_FROMENTRY(_p) ((PVBOXWINEPROFILE_HASHMAP_ELEMENT)(((uint8_t*)(_p)) - RT_OFFSETOF(VBOXWINEPROFILE_HASHMAP_ELEMENT, MapEntry))) 1702 1703 #define VBOXWINEPROFILE_ELEMENT_DUMP(_p, _pn) do { \ 1704 PRLOG(("%s: t(%u);c(%u)\n", \ 1705 (_pn), \ 1706 (uint32_t)((_p)->u64Time / 1000000), \ 1707 (_p)->cu32Calls \ 1708 )); \ 1709 } while (0) 1710 1711 #define VBOXWINEPROFILE_ELEMENT_RESET(_p) do { \ 1712 memset(_p, 0, sizeof (*(_p))); \ 1713 } while (0) 1714 1715 #define VBOXWINEPROFILE_ELEMENT_STEP(_p, _t) do { \ 1716 (_p)->u64Time += (_t); \ 1717 ++(_p)->cu32Calls; \ 1718 } while (0) 1719 1720 #define VBOXWINEPROFILE_HASHMAP_ELEMENT_CREATE() ( (PVBOXWINEPROFILE_HASHMAP_ELEMENT)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (VBOXWINEPROFILE_HASHMAP_ELEMENT)) ) 1721 1722 #define VBOXWINEPROFILE_HASHMAP_ELEMENT_TERM(_pe) do { \ 1723 HeapFree(GetProcessHeap(), 0, (_pe)); \ 1724 } while (0) 1725 1726 DECLINLINE(PVBOXWINEPROFILE_HASHMAP_ELEMENT) vboxWineProfileHashMapElementGet(PVBOXEXT_HASHMAP pMap, void *pvKey) 1727 { 1728 PVBOXEXT_HASHMAP_ENTRY pEntry = VBoxExtHashGet(pMap, pvKey); 1729 if (pEntry) 1730 { 1731 return VBOXWINEPROFILE_HASHMAP_ELEMENT_FROMENTRY(pEntry); 1732 } 1733 else 1734 { 1735 PVBOXWINEPROFILE_HASHMAP_ELEMENT pElement = VBOXWINEPROFILE_HASHMAP_ELEMENT_CREATE(); 1736 Assert(pElement); 1737 if (pElement) 1738 VBoxExtHashPut(pMap, pvKey, &pElement->MapEntry); 1739 return pElement; 1740 } 1741 } 1742 1743 #define VBOXWINEPROFILE_HASHMAP_ELEMENT_STEP(_pm, _pk, _t) do { \ 1744 PVBOXWINEPROFILE_HASHMAP_ELEMENT pElement = vboxWineProfileHashMapElementGet(_pm, _pk); \ 1745 VBOXWINEPROFILE_ELEMENT_STEP(&pElement->Data, _t); \ 1746 } while (0) 1747 1748 static DECLCALLBACK(bool) vboxWineProfileElementResetCb(struct VBOXEXT_HASHMAP *pMap, void *pvKey, struct VBOXEXT_HASHMAP_ENTRY *pValue, void *pvVisitor) 1749 { 1750 PVBOXWINEPROFILE_HASHMAP_ELEMENT pElement = VBOXWINEPROFILE_HASHMAP_ELEMENT_FROMENTRY(pValue); 1751 VBOXWINEPROFILE_ELEMENT_RESET(&pElement->Data); 1752 return true; 1753 } 1754 1755 static DECLCALLBACK(bool) vboxWineProfileElementDumpCb(struct VBOXEXT_HASHMAP *pMap, void *pvKey, struct VBOXEXT_HASHMAP_ENTRY *pValue, void *pvVisitor) 1756 { 1757 PVBOXWINEPROFILE_HASHMAP_ELEMENT pElement = VBOXWINEPROFILE_HASHMAP_ELEMENT_FROMENTRY(pValue); 1758 char *pName = (char*)pvVisitor; 1759 PRLOG(("%s[%d]:", pName, (uint32_t)pvKey)); 1760 VBOXWINEPROFILE_ELEMENT_DUMP(&pElement->Data, ""); 1761 return true; 1762 } 1763 1764 #define VBOXWINEPROFILE_HASHMAP_RESET(_pm) do { \ 1765 VBoxExtHashVisit((_pm), vboxWineProfileElementResetCb, NULL); \ 1766 } while (0) 1767 1768 #define VBOXWINEPROFILE_HASHMAP_DUMP(_pm, _pn) do { \ 1769 VBoxExtHashVisit((_pm), vboxWineProfileElementDumpCb, (_pn)); \ 1770 } while (0) 1771 1772 static DECLCALLBACK(bool) vboxWineProfileElementCleanupCb(struct VBOXEXT_HASHMAP *pMap, void *pvKey, struct VBOXEXT_HASHMAP_ENTRY *pValue, void *pvVisitor) 1773 { 1774 PVBOXWINEPROFILE_HASHMAP_ELEMENT pElement = VBOXWINEPROFILE_HASHMAP_ELEMENT_FROMENTRY(pValue); 1775 VBOXWINEPROFILE_HASHMAP_ELEMENT_TERM(pElement); 1776 return true; 1777 } 1778 1779 #define VBOXWINEPROFILE_HASHMAP_TERM(_pm) do { \ 1780 VBoxExtHashCleanup((_pm), vboxWineProfileElementCleanupCb, NULL); \ 1781 VBoxExtHashVisit((_pm), vboxWineProfileElementResetCb, NULL); \ 1782 } while (0) 1783 1784 typedef struct VBOXWINEPROFILE_DRAWPRIM 1785 { 1786 uint64_t u64LoadLocationTime; 1787 uint64_t u64CtxAcquireTime; 1788 uint64_t u64PostProcess; 1789 VBOXEXT_HASHMAP MapDrawPrimSlowVs; 1790 VBOXEXT_HASHMAP MapDrawPrimSlow; 1791 VBOXEXT_HASHMAP MapDrawPrimStrided; 1792 VBOXEXT_HASHMAP MapDrawPrimFast; 1793 uint32_t cu32Calls; 1794 } VBOXWINEPROFILE_DRAWPRIM, *PVBOXWINEPROFILE_DRAWPRIM; 1795 1796 #define VBOXWINEPROFILE_DRAWPRIM_RESET_NEXT(_p) do { \ 1797 (_p)->u64LoadLocationTime = 0; \ 1798 (_p)->u64CtxAcquireTime = 0; \ 1799 (_p)->u64PostProcess = 0; \ 1800 VBOXWINEPROFILE_HASHMAP_RESET(&(_p)->MapDrawPrimSlowVs); \ 1801 VBOXWINEPROFILE_HASHMAP_RESET(&(_p)->MapDrawPrimSlow); \ 1802 VBOXWINEPROFILE_HASHMAP_RESET(&(_p)->MapDrawPrimStrided); \ 1803 VBOXWINEPROFILE_HASHMAP_RESET(&(_p)->MapDrawPrimFast); \ 1804 } while (0) 1805 1806 static DECLCALLBACK(uint32_t) vboxWineProfileDrawPrimHashMapHash(void *pvKey) 1807 { 1808 return (uint32_t)pvKey; 1809 } 1810 1811 static DECLCALLBACK(bool) vboxWineProfileDrawPrimHashMapEqual(void *pvKey1, void *pvKey2) 1812 { 1813 return ((uint32_t)pvKey1) == ((uint32_t)pvKey2); 1814 } 1815 1816 #define VBOXWINEPROFILE_DRAWPRIM_INIT(_p) do { \ 1817 memset((_p), 0, sizeof (*(_p))); \ 1818 VBoxExtHashInit(&(_p)->MapDrawPrimSlowVs, vboxWineProfileDrawPrimHashMapHash, vboxWineProfileDrawPrimHashMapEqual); \ 1819 VBoxExtHashInit(&(_p)->MapDrawPrimSlow, vboxWineProfileDrawPrimHashMapHash, vboxWineProfileDrawPrimHashMapEqual); \ 1820 VBoxExtHashInit(&(_p)->MapDrawPrimStrided, vboxWineProfileDrawPrimHashMapHash, vboxWineProfileDrawPrimHashMapEqual); \ 1821 VBoxExtHashInit(&(_p)->MapDrawPrimFast, vboxWineProfileDrawPrimHashMapHash, vboxWineProfileDrawPrimHashMapEqual); \ 1822 } while (0) 1823 1824 #define VBOXWINEPROFILE_DRAWPRIM_TERM(_p) do { \ 1825 memset((_p), 0, sizeof (*(_p))); \ 1826 VBOXWINEPROFILE_HASHMAP_TERM(&(_p)->MapDrawPrimSlowVs); \ 1827 VBOXWINEPROFILE_HASHMAP_TERM(&(_p)->MapDrawPrimSlow); \ 1828 VBOXWINEPROFILE_HASHMAP_TERM(&(_p)->MapDrawPrimStrided); \ 1829 VBOXWINEPROFILE_HASHMAP_TERM(&(_p)->MapDrawPrimFast); \ 1830 } while (0) 1831 #else 1832 # define PRLOG(_m) do {} while (0) 1833 #endif 1678 1834 struct IWineD3DDeviceImpl 1679 1835 { … … 1812 1968 VBOXEXT_HASHCACHE vshaderCache; 1813 1969 VBOXEXT_HASHCACHE pshaderCache; 1970 #endif 1971 1972 #ifdef VBOX_WINE_WITH_PROFILE 1973 VBOXWINEPROFILE_DRAWPRIM DrawPrimProfile; 1814 1974 #endif 1815 1975
Note:
See TracChangeset
for help on using the changeset viewer.