Changeset 43490 in vbox
- Timestamp:
- Oct 1, 2012 11:56:39 AM (12 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r43360 r43490 51 51 # ifdef VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_ENABLE 52 52 53 extern volatile uint32_t g_u322VBoxDispProfileFunctionLoggerIndex = 0; 53 class VBoxDispProfileDevicePostProcess 54 { 55 public: 56 VBoxDispProfileDevicePostProcess(PVBOXWDDMDISP_DEVICE pDevice) : 57 m_pDevice(pDevice) 58 {} 59 60 void postProcess() 61 { 62 if (m_pDevice->pDevice9If) 63 m_pDevice->pAdapter->D3D.D3D.pfnVBoxWineExD3DDev9Finish((IDirect3DDevice9Ex *)m_pDevice->pDevice9If); 64 } 65 private: 66 PVBOXWDDMDISP_DEVICE m_pDevice; 67 }; 54 68 55 69 //static VBoxDispProfileSet g_VBoxDispProfileDDI("D3D_DDI"); 56 # define VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_PROLOGUE(_pObj) VBOXDISPPROFILE_FUNCTION_LOGGER_DEFINE((_pObj)->ProfileDdiFunc) 70 # define VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_PROLOGUE_DEV(_pObj) VBOXDISPPROFILE_FUNCTION_LOGGER_DEFINE((_pObj)->ProfileDdiFunc, VBoxDispProfileDevicePostProcess, VBoxDispProfileDevicePostProcess(_pObj)) 71 # define VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_PROLOGUE_BASE(_pObj) VBOXDISPPROFILE_FUNCTION_LOGGER_DEFINE((_pObj)->ProfileDdiFunc, VBoxDispProfileDummyPostProcess, VBoxDispProfileDummyPostProcess()) 57 72 # define VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_DUMP(_pObj) do {\ 58 73 (_pObj)->ProfileDdiFunc.dump(_pObj); \ … … 68 83 69 84 # define VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_REPORT_FRAME(_pObj) do { \ 70 if (!((_pObj)->ProfileDdiFunc.reportIteration() % 31) && !VBOXVDBG_IS_DWM()) {\85 if (!((_pObj)->ProfileDdiFunc.reportIteration() % 31) /*&& !VBOXVDBG_IS_DWM()*/) {\ 71 86 VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_DUMP(_pObj); \ 72 87 VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_RESET(_pObj); \ … … 75 90 76 91 # else 77 # define VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_PROLOGUE(_pObj) do {} while(0) 92 # define VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_PROLOGUE_DEV(_pObj) do {} while(0) 93 # define VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_PROLOGUE_BASE(_pObj) do {} while(0) 78 94 # define VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_DUMP(_pObj) do {} while(0) 79 95 # define VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_RESET(_pObj) do {} while(0) … … 85 101 # ifdef VBOXDISPPROFILE_DDI_STATISTIC_LOGGER_ENABLE 86 102 //static VBoxDispProfileFpsCounter g_VBoxDispFpsDDI(64); 87 # define VBOXDISPPROFILE_DDI_STATISTIC_LOGGER_PROLOGUE(_pObj) VBOXDISPPROFILE_STATISTIC_LOGGER_DEFINE(&(_pObj)->ProfileDdiFps )103 # define VBOXDISPPROFILE_DDI_STATISTIC_LOGGER_PROLOGUE(_pObj) VBOXDISPPROFILE_STATISTIC_LOGGER_DEFINE(&(_pObj)->ProfileDdiFps, VBoxDispProfileDummyPostProcess, VBoxDispProfileDummyPostProcess()) 88 104 # define VBOXDISPPROFILE_DDI_STATISTIC_LOGGER_DISABLE_CURRENT() do {\ 89 105 VBOXDISPPROFILE_STATISTIC_LOGGER_DISABLE_CURRENT();\ … … 114 130 # endif 115 131 116 # define VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE(_pObj) \ 117 VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_PROLOGUE(_pObj); \ 132 # define VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE_DEV(_pObj) \ 133 VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_PROLOGUE_DEV(_pObj); \ 134 VBOXDISPPROFILE_DDI_STATISTIC_LOGGER_PROLOGUE(_pObj); 135 136 # define VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE_BASE(_pObj) \ 137 VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_PROLOGUE_BASE(_pObj); \ 118 138 VBOXDISPPROFILE_DDI_STATISTIC_LOGGER_PROLOGUE(_pObj); 119 139 … … 128 148 } while (0) 129 149 150 #if 0 130 151 # define VBOXDISPPROFILE_DDI_REPORT_FLUSH(_pDev) do {\ 131 152 VBOXDISPPROFILE_DDI_LOG_AND_DISABLE_CURRENT(); \ … … 133 154 VBOXDISPPROFILE_DDI_FUNCTION_LOGGER_REPORT_FRAME(_pDev); \ 134 155 } while (0) 156 #else 157 # define VBOXDISPPROFILE_DDI_REPORT_FLUSH(_pDev) do {} while (0) 158 #endif 135 159 136 160 # define VBOXDISPPROFILE_DDI_INIT_CMN(_pObj, _name, _cEntries) do { \ … … 157 181 # define VBOXDISPPROFILE_DDI_INIT_DEV(_pDev) VBOXDISPPROFILE_DDI_INIT_CMN(_pDev, "DDI_Dev", 64) 158 182 #else 159 # define VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE(_pObj) do {} while (0) 183 # define VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE_DEV(_pObj) do {} while (0) 184 # define VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE_BASE(_pObj) do {} while (0) 160 185 # define VBOXDISPPROFILE_DDI_REPORT_FRAME(_pDev) do {} while (0) 161 186 # define VBOXDISPPROFILE_DDI_REPORT_FLUSH(_pDev) do {} while (0) … … 175 200 #define VBOXDISP_DDI_PROLOGUE_DEV(_hDevice) \ 176 201 VBOXDISP_DDI_PROLOGUE_CMN(); \ 177 VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE ((PVBOXWDDMDISP_DEVICE)(_hDevice));202 VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE_DEV((PVBOXWDDMDISP_DEVICE)(_hDevice)); 178 203 179 204 #define VBOXDISP_DDI_PROLOGUE_ADP(_hAdapter) \ 180 205 VBOXDISP_DDI_PROLOGUE_CMN(); \ 181 VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE ((PVBOXWDDMDISP_ADAPTER)(_hAdapter));206 VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE_BASE((PVBOXWDDMDISP_ADAPTER)(_hAdapter)); 182 207 183 208 #define VBOXDISP_DDI_PROLOGUE_GLBL() \ 184 209 VBOXDISP_DDI_PROLOGUE_CMN(); \ 185 VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE (&g_VBoxDispProfile);210 VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE_BASE(&g_VBoxDispProfile); 186 211 187 212 #ifdef VBOXDISPMP_TEST -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.cpp
r43334 r43490 77 77 { 78 78 WARN(("no VBoxWineExD3DDev9Flush")); 79 break; 80 } 81 82 pD3D->pfnVBoxWineExD3DDev9FlushToHost = (PFNVBOXWINEEXD3DDEV9_FLUSHTOHOST)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DDev9FlushToHost"); 83 if (!pD3D->pfnVBoxWineExD3DDev9FlushToHost) 84 { 85 WARN(("no VBoxWineExD3DDev9FlushToHost")); 86 break; 87 } 88 89 pD3D->pfnVBoxWineExD3DDev9Finish = (PFNVBOXWINEEXD3DDEV9_FINISH)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DDev9Finish"); 90 if (!pD3D->pfnVBoxWineExD3DDev9Finish) 91 { 92 WARN(("no VBoxWineExD3DDev9Finish")); 79 93 break; 80 94 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.h
r43334 r43490 75 75 PFNVBOXWINEEXD3DSWAPCHAIN9_PRESENT pfnVBoxWineExD3DSwapchain9Present; 76 76 77 PFNVBOXWINEEXD3DDEV9_FLUSHTOHOST pfnVBoxWineExD3DDev9FlushToHost; 78 79 PFNVBOXWINEEXD3DDEV9_FINISH pfnVBoxWineExD3DDev9Finish; 80 77 81 /* module handle */ 78 82 HMODULE hD3DLib; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispProfile.h
r41637 r43490 194 194 }; 195 195 196 template<typename T> class VBoxDispProfileScopeLogger 196 class VBoxDispProfileDummyPostProcess 197 197 { 198 198 public: 199 VBoxDispProfileScopeLogger(T *pEntry) : 199 void postProcess(){} 200 }; 201 202 template<typename T, typename P> class VBoxDispProfileScopeLogger 203 { 204 public: 205 VBoxDispProfileScopeLogger(T *pEntry, P PostProcess) : 200 206 m_pEntry(pEntry), 207 m_PostProcess(PostProcess), 201 208 m_bDisable(FALSE) 202 209 { … … 226 233 void logStep() 227 234 { 235 m_PostProcess.postProcess(); 228 236 uint64_t cNewTime = VBOXDISPPROFILE_GET_TIME_NANO(); 229 237 m_pEntry->step(cNewTime - m_cTime); 230 238 } 231 239 T *m_pEntry; 240 P m_PostProcess; 232 241 uint64_t m_cTime; 233 242 BOOL m_bDisable; … … 373 382 374 383 #ifdef VBOXDISPPROFILE_FUNCTION_LOGGER_GLOBAL_PROFILE 375 # define VBOXDISPPROFILE_FUNCTION_LOGGER_DEFINE(_p ) \384 # define VBOXDISPPROFILE_FUNCTION_LOGGER_DEFINE(_p, _T, _v) \ 376 385 static VBoxDispProfileEntry * __pVBoxDispProfileEntry = NULL; \ 377 386 if (!__pVBoxDispProfileEntry) { __pVBoxDispProfileEntry = _p.alloc(__FUNCTION__); } \ 378 VBoxDispProfileScopeLogger<VBoxDispProfileEntry > __vboxDispProfileFunctionLogger(__pVBoxDispProfileEntry);387 VBoxDispProfileScopeLogger<VBoxDispProfileEntry, _T> __vboxDispProfileFunctionLogger(__pVBoxDispProfileEntry, _v); 379 388 #else 380 389 # ifndef VBOXDISPPROFILE_FUNCTION_LOGGER_INDEX_GEN 381 390 # error "VBOXDISPPROFILE_FUNCTION_LOGGER_INDEX_GEN should be fedined!" 382 391 # endif 383 # define VBOXDISPPROFILE_FUNCTION_LOGGER_DEFINE(_p ) \392 # define VBOXDISPPROFILE_FUNCTION_LOGGER_DEFINE(_p, _T, _v) \ 384 393 static uint32_t __u32VBoxDispProfileIndex = VBOXDISPPROFILE_FUNCTION_LOGGER_INDEX_GEN(); \ 385 394 VBoxDispProfileEntry * __pVBoxDispProfileEntry = _p.get(__u32VBoxDispProfileIndex, __FUNCTION__); \ 386 VBoxDispProfileScopeLogger<VBoxDispProfileEntry > __vboxDispProfileFunctionLogger(__pVBoxDispProfileEntry);395 VBoxDispProfileScopeLogger<VBoxDispProfileEntry, _T> __vboxDispProfileFunctionLogger(__pVBoxDispProfileEntry, _v); 387 396 #endif 388 397 … … 396 405 397 406 398 #define VBOXDISPPROFILE_STATISTIC_LOGGER_DEFINE(_p ) \399 VBoxDispProfileScopeLogger<VBoxDispProfileFpsCounter > __vboxDispProfileStatisticLogger(_p);407 #define VBOXDISPPROFILE_STATISTIC_LOGGER_DEFINE(_p, _T, _v) \ 408 VBoxDispProfileScopeLogger<VBoxDispProfileFpsCounter, _T> __vboxDispProfileStatisticLogger(_p, _v); 400 409 401 410 //#define VBOXDISPPROFILE_FUNCTION_PROLOGUE(_p) \
Note:
See TracChangeset
for help on using the changeset viewer.