Changeset 70851 in vbox for trunk/src/VBox/HostServices/SharedOpenGL
- Timestamp:
- Feb 2, 2018 9:54:30 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 120671
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/render
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h
r69474 r70851 247 247 int sync; 248 248 #endif 249 int force_present_main_thread; 249 250 int render_to_app_window; 250 251 int render_to_crut_window; -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
r69500 r70851 116 116 * Disable this to see how the output is without the FBO in the middle of the processing chain. */ 117 117 #define FBO 1 118 /** @def CR_RENDER_FORCE_PRESENT_MAIN_THREAD119 * Force present schedule to main thread. */120 118 /** @def SHOW_WINDOW_BACKGROUND 121 119 * Define this to see the window background even if the window is clipped. */ … … 123 121 * Define this to get some debug info about the messages flow. */ 124 122 #if 0 || defined(DOXYGEN_RUNNING) 125 # define CR_RENDER_FORCE_PRESENT_MAIN_THREAD126 123 # define SHOW_WINDOW_BACKGROUND 1 127 124 # define DEBUG_VERBOSE -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_config.c
r69390 r70851 373 373 render_spu->sync = 0; 374 374 #endif 375 } 376 375 376 /* Config of "render force present main thread" (currently implemented by glx and wgl). */ 377 const char *forcePresent = crGetenv("CR_RENDER_FORCE_PRESENT_MAIN_THREAD"); 378 if (forcePresent) 379 render_spu->force_present_main_thread = crStrToInt(forcePresent) ? 1 : 0; 380 else 381 { 382 #if defined(GLX) 383 /* Customer needed this for avoiding system 3D driver bugs. */ 384 render_spu->force_present_main_thread = 1; 385 #else 386 render_spu->force_present_main_thread = 0; 387 #endif 388 } 389 } 390 -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c
r69390 r70851 1925 1925 } 1926 1926 1927 #define CR_RENDER_FORCE_PRESENT_MAIN_THREAD1928 1929 1927 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry ) 1930 1928 { 1931 /* the CR_RENDER_FORCE_PRESENT_MAIN_THREAD is actually inherited from cocoa backend impl, 1932 * here it forces rendering in WinCmd thread rather than a Main thread. 1933 * it is used for debugging only in any way actually. 1934 * @todo: change to some more generic macro name */ 1935 #ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD 1936 const struct VBOXVR_SCR_COMPOSITOR *pCompositor; 1937 /* we do not want to be blocked with the GUI thread here, so only draw her eif we are really able to do that w/o bllocking */ 1938 int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor); 1939 if (RT_SUCCESS(rc)) 1940 { 1941 renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0, false); 1942 renderspuVBoxCompositorRelease(window); 1943 } 1944 else if (rc == VERR_SEM_BUSY) 1945 #endif 1929 /* The !render_spu.force_present_main_thread code flow is actually inspired 1930 * by cocoa backend impl, here it forces rendering in WinCmd thread rather 1931 * than a Main thread. It defaults to 1, because otherwise there were 1932 * 3D driver incompatibilities on some systems. Elsewhere it causes flicker 1933 * on NVidia GPUs. In principle would need root cause investigation. */ 1934 if (!render_spu.force_present_main_thread) 1935 { 1936 const struct VBOXVR_SCR_COMPOSITOR *pCompositor; 1937 /* we do not want to be blocked with the GUI thread here, so only draw here if we are really able to do that w/o blocking */ 1938 int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor); 1939 if (RT_SUCCESS(rc)) 1940 { 1941 renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0, false); 1942 renderspuVBoxCompositorRelease(window); 1943 } 1944 else if (rc != VERR_SEM_BUSY) 1945 { 1946 /* this is somewhat we do not expect */ 1947 WARN(("renderspuVBoxCompositorTryAcquire failed rc %d", rc)); 1948 return; 1949 } 1950 } 1951 1946 1952 { 1947 1953 Status status; … … 1962 1968 XFlush(render_spu.pCommunicationDisplay); 1963 1969 } 1964 #ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD1965 else1966 {1967 /* this is somewhat we do not expect */1968 WARN(("renderspuVBoxCompositorTryAcquire failed rc %d", rc));1969 }1970 #endif1971 1970 } 1972 1971 -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c
r70789 r70851 1287 1287 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry ) 1288 1288 { 1289 /* the CR_RENDER_FORCE_PRESENT_MAIN_THREAD is actually inherited from cocoa backend impl, 1290 * here it forces rendering in WinCmd thread rather than a Main thread. 1291 * it is used for debugging only in any way actually. 1292 * @todo: change to some more generic macro name */ 1293 #ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD 1294 const struct VBOXVR_SCR_COMPOSITOR *pCompositor; 1295 /* we do not want to be blocked with the GUI thread here, so only draw her eif we are really able to do that w/o bllocking */ 1296 int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor); 1297 if (RT_SUCCESS(rc)) 1298 { 1299 renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0, false); 1300 renderspuVBoxCompositorRelease(window); 1301 } 1302 else if (rc == VERR_SEM_BUSY) 1303 #endif 1289 /* The !render_spu.force_present_main_thread code flow is actually inspired 1290 * by cocoa backend impl, here it forces rendering in WndProc, i.e. main 1291 * thread. It defaults to 0, because it is for debugging and working around 1292 * bugs. In principle would need root cause investigation. */ 1293 if (!render_spu.force_present_main_thread) 1294 { 1295 const struct VBOXVR_SCR_COMPOSITOR *pCompositor; 1296 /* we do not want to be blocked with the GUI thread here, so only draw here if we are really able to do that w/o blocking */ 1297 int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor); 1298 if (RT_SUCCESS(rc)) 1299 { 1300 renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0, false); 1301 renderspuVBoxCompositorRelease(window); 1302 } 1303 else if (rc != VERR_SEM_BUSY) 1304 { 1305 /* this is somewhat we do not expect */ 1306 crWarning("renderspuVBoxCompositorTryAcquire failed rc %d", rc); 1307 } 1308 } 1309 1304 1310 { 1305 1311 render_spu.self.Flush(); … … 1307 1313 RedrawWindow(window->hWnd, NULL, NULL, RDW_INTERNALPAINT); 1308 1314 } 1309 #ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD1310 else1311 {1312 /* this is somewhat we do not expect */1313 crWarning("renderspuVBoxCompositorTryAcquire failed rc %d", rc);1314 }1315 #endif1316 1315 } 1317 1316
Note:
See TracChangeset
for help on using the changeset viewer.