Browse Source

Merge branch 'release/1.10.x'

rdb 3 years ago
parent
commit
7b5ec481f3

+ 2 - 1
panda/src/display/graphicsEngine.cxx

@@ -1707,7 +1707,8 @@ draw_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) {
       if (host->flip_ready()) {
         if (display_cat.is_spam()) {
           display_cat.spam()
-            << "Flipping window " << win->get_name() << "\n";
+            << "Flipping window " << host->get_name()
+            << " before drawing window " << win->get_name() << "\n";
         }
         PStatTimer timer(_flip_pcollector, current_thread);
         host->begin_flip();

+ 53 - 0
panda/src/glstuff/glGraphicsBuffer_src.cxx

@@ -859,6 +859,50 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot,
     // case RTP_stencil: gl_format = GL_STENCIL_INDEX8; break
     default:
       if (_fb_properties.get_alpha_bits() == 0) {
+#ifndef OPENGLES_1
+        if (_fb_properties.get_float_color() &&
+            glgsg->has_extension("GL_EXT_color_buffer_float")) {
+          // This extension supports the full range of floating-point formats.
+          if (_fb_properties.get_color_bits() > 16 * 3 ||
+              _fb_properties.get_red_bits() > 16 ||
+              _fb_properties.get_green_bits() > 16 ||
+              _fb_properties.get_blue_bits() > 16) {
+            // 32-bit, which is always floating-point.
+            if (_fb_properties.get_blue_bits() > 0 ||
+                _fb_properties.get_color_bits() == 1 ||
+                _fb_properties.get_color_bits() > 32 * 2) {
+              gl_format = GL_RGB32F;
+            } else if (_fb_properties.get_green_bits() > 0 ||
+                       _fb_properties.get_color_bits() > 32) {
+              gl_format = GL_RG32F;
+            } else {
+              gl_format = GL_R32F;
+            }
+          } else {
+            // 16-bit floating-point.
+            if (_fb_properties.get_blue_bits() > 10 ||
+                _fb_properties.get_color_bits() == 1 ||
+                _fb_properties.get_color_bits() > 32) {
+              gl_format = GL_RGB16F;
+            } else if (_fb_properties.get_blue_bits() > 0) {
+              if (_fb_properties.get_red_bits() > 11 ||
+                  _fb_properties.get_green_bits() > 11) {
+                gl_format = GL_RGB16F;
+              } else {
+                gl_format = GL_R11F_G11F_B10F;
+              }
+            } else if (_fb_properties.get_green_bits() > 0 ||
+                       _fb_properties.get_color_bits() > 16) {
+              gl_format = GL_RG16F;
+            } else {
+              gl_format = GL_R16F;
+            }
+          }
+        } else if (_fb_properties.get_float_color() &&
+                   glgsg->has_extension("GL_EXT_color_buffer_half_float")) {
+          gl_format = GL_RGB16F_EXT;
+        } else
+#endif
         if (_fb_properties.get_color_bits() <= 16) {
           gl_format = GL_RGB565_OES;
         } else if (_fb_properties.get_color_bits() <= 24) {
@@ -866,6 +910,15 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot,
         } else {
           gl_format = GL_RGB10_EXT;
         }
+#ifndef OPENGLES_1
+      } else if (_fb_properties.get_float_color() &&
+                 _fb_properties.get_color_bits() > 16 * 3 &&
+                 glgsg->has_extension("GL_EXT_color_buffer_float")) {
+        gl_format = GL_RGBA32F_EXT;
+      } else if (_fb_properties.get_float_color() &&
+                 glgsg->has_extension("GL_EXT_color_buffer_half_float")) {
+        gl_format = GL_RGBA16F_EXT;
+#endif
       } else if (_fb_properties.get_color_bits() == 0) {
         gl_format = GL_ALPHA8_EXT;
       } else if (_fb_properties.get_color_bits() <= 12

+ 7 - 1
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -10764,9 +10764,15 @@ get_internal_image_format(Texture *tex, bool force_sized) const {
     } else {
       return GL_RGBA16_SNORM;
     }
+#elif !defined(OPENGLES_1)
+  case Texture::F_rgba16:
+    return GL_RGBA16F;
+#endif  // OPENGLES
+
+#ifndef OPENGLES_1
   case Texture::F_rgba32:
     return GL_RGBA32F;
-#endif  // OPENGLES
+#endif
 
   case Texture::F_rgb:
     switch (component_type) {

+ 1 - 1
panda/src/vision/webcamVideoCursorV4L.cxx

@@ -217,7 +217,7 @@ WebcamVideoCursorV4L(WebcamVideoV4L *src) : MovieVideoCursor(src) {
 
   int mode = O_RDWR;
   if (!v4l_blocking) {
-    mode = O_NONBLOCK;
+    mode |= O_NONBLOCK;
   }
 
   _fd = open(src->_device.c_str(), mode);