Просмотр исходного кода

display: Move `copy_async_screenshot()` to `begin_frame()`

This is required by Vulkan, because it needs to happen before the render pass started
rdb 3 лет назад
Родитель
Сommit
b52dc98e36

+ 6 - 1
panda/src/androiddisplay/androidGraphicsWindow.cxx

@@ -119,7 +119,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/cocoadisplay/cocoaGraphicsWindow.mm

@@ -231,7 +231,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/display/callbackGraphicsWindow.cxx

@@ -80,7 +80,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   _gsg->reset_if_new();
   _gsg->reset_if_new();
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
 
 
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 0 - 4
panda/src/display/graphicsEngine.cxx

@@ -1433,8 +1433,6 @@ cull_and_draw_together(GraphicsEngine::Windows wlist,
       }
       }
 
 
       if (win->begin_frame(GraphicsOutput::FM_render, current_thread)) {
       if (win->begin_frame(GraphicsOutput::FM_render, current_thread)) {
-        win->copy_async_screenshot();
-
         if (win->is_any_clear_active()) {
         if (win->is_any_clear_active()) {
           GraphicsStateGuardian *gsg = win->get_gsg();
           GraphicsStateGuardian *gsg = win->get_gsg();
           PStatGPUTimer timer(gsg, win->get_clear_window_pcollector(), current_thread);
           PStatGPUTimer timer(gsg, win->get_clear_window_pcollector(), current_thread);
@@ -1737,8 +1735,6 @@ draw_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) {
         {
         {
           PStatGPUTimer timer(gsg, win->get_draw_window_pcollector(), current_thread);
           PStatGPUTimer timer(gsg, win->get_draw_window_pcollector(), current_thread);
 
 
-          win->copy_async_screenshot();
-
           if (win->is_any_clear_active()) {
           if (win->is_any_clear_active()) {
             PStatGPUTimer timer(gsg, win->get_clear_window_pcollector(), current_thread);
             PStatGPUTimer timer(gsg, win->get_clear_window_pcollector(), current_thread);
             win->get_gsg()->push_group_marker("Clear");
             win->get_gsg()->push_group_marker("Clear");

+ 6 - 1
panda/src/dxgsg9/wdxGraphicsBuffer9.cxx

@@ -142,7 +142,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 3 - 0
panda/src/dxgsg9/wdxGraphicsWindow9.cxx

@@ -117,6 +117,9 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
   bool return_val = _gsg->begin_frame(current_thread);
   bool return_val = _gsg->begin_frame(current_thread);
   _dxgsg->set_render_target();
   _dxgsg->set_render_target();
+  if (return_val) {
+    copy_async_screenshot();
+  }
   return return_val;
   return return_val;
 }
 }
 
 

+ 6 - 1
panda/src/egldisplay/eglGraphicsBuffer.cxx

@@ -94,7 +94,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/egldisplay/eglGraphicsPixmap.cxx

@@ -101,7 +101,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/egldisplay/eglGraphicsWindow.cxx

@@ -118,7 +118,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/glxdisplay/glxGraphicsBuffer.cxx

@@ -97,7 +97,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/glxdisplay/glxGraphicsPixmap.cxx

@@ -100,7 +100,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/glxdisplay/glxGraphicsWindow.cxx

@@ -95,7 +95,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 
 

+ 6 - 1
panda/src/iphonedisplay/iPhoneGraphicsWindow.mm

@@ -90,7 +90,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   _gsg->reset_if_new();
   _gsg->reset_if_new();
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
 
 
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/tinydisplay/tinyGraphicsBuffer.cxx

@@ -63,7 +63,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   tinygsg->reset_if_new();
   tinygsg->reset_if_new();
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/tinydisplay/tinySDLGraphicsWindow.cxx

@@ -73,7 +73,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   tinygsg->reset_if_new();
   tinygsg->reset_if_new();
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/tinydisplay/tinyWinGraphicsWindow.cxx

@@ -79,7 +79,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   tinygsg->reset_if_new();
   tinygsg->reset_if_new();
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/tinydisplay/tinyXGraphicsWindow.cxx

@@ -103,7 +103,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   tinygsg->reset_if_new();
   tinygsg->reset_if_new();
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 2 - 0
panda/src/vulkandisplay/vulkanGraphicsBuffer.cxx

@@ -120,6 +120,8 @@ begin_frame(FrameMode mode, Thread *current_thread) {
     return false;
     return false;
   }
   }
 
 
+  copy_async_screenshot();
+
   /*if (mode == FM_render) {
   /*if (mode == FM_render) {
     clear_cube_map_selection();
     clear_cube_map_selection();
   }*/
   }*/

+ 2 - 0
panda/src/vulkandisplay/vulkanGraphicsWindow.cxx

@@ -127,6 +127,8 @@ begin_frame(FrameMode mode, Thread *current_thread) {
     return false;
     return false;
   }
   }
 
 
+  copy_async_screenshot();
+
   if (mode != FM_render) {
   if (mode != FM_render) {
     return true;
     return true;
   }
   }

+ 6 - 1
panda/src/wgldisplay/wglGraphicsBuffer.cxx

@@ -106,7 +106,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/wgldisplay/wglGraphicsWindow.cxx

@@ -92,7 +92,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**

+ 6 - 1
panda/src/x11display/x11GraphicsWindow.cxx

@@ -258,7 +258,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   }
   }
 
 
   _gsg->set_current_properties(&get_fb_properties());
   _gsg->set_current_properties(&get_fb_properties());
-  return _gsg->begin_frame(current_thread);
+  if (_gsg->begin_frame(current_thread)) {
+    copy_async_screenshot();
+    return true;
+  } else {
+    return false;
+  }
 }
 }
 
 
 /**
 /**