浏览代码

glgsg: Do not prefer depth-stencil ms renderbuffers on macOS

Fixes #1719
rdb 10 月之前
父节点
当前提交
fa64a52fca
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      panda/src/glstuff/glGraphicsBuffer_src.cxx

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

@@ -523,6 +523,18 @@ rebuild_bitplanes() {
       // but it's a waste.  Let's not do it unless the user requested stencil.
       _use_depth_stencil = false;
 
+#ifdef __APPLE__
+    } else if (_fb_properties.get_depth_bits() > 0 && _requested_multisamples) {
+      // Apple's OpenGL driver doesn't like blitting depth-stencil targets.
+      // See GitHub issue #1719
+      _use_depth_stencil = false;
+      if (_fb_properties.get_depth_bits() < 24) {
+        // Make sure we do get at least as many depth bits as we would have
+        // gotten if we did get a depth-stencil buffer.
+        _fb_properties.set_depth_bits(24);
+      }
+#endif
+
     } else if (_fb_properties.get_depth_bits() > 0) {
       // Let's use a depth stencil buffer by default, if a depth buffer was
       // requested.