Przeglądaj źródła

glgsg: fix error with multisampled float depth buffer

Fixes #416
rdb 7 lat temu
rodzic
commit
75826c9a51
1 zmienionych plików z 9 dodań i 0 usunięć
  1. 9 0
      panda/src/glstuff/glGraphicsBuffer_src.cxx

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

@@ -1097,6 +1097,15 @@ bind_slot_multisample(bool rb_resize, Texture **attach, RenderTexturePlane slot,
 #endif
 #endif
       glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, _rbm[slot]);
       glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, _rbm[slot]);
       GLuint format = GL_DEPTH_COMPONENT;
       GLuint format = GL_DEPTH_COMPONENT;
+#ifndef OPENGLES
+      if (_fb_properties.get_float_depth()) {
+        if (!glgsg->_use_remapped_depth_range) {
+          format = GL_DEPTH_COMPONENT32F;
+        } else {
+          format = GL_DEPTH_COMPONENT32F_NV;
+        }
+      } else
+#endif
       if (tex) {
       if (tex) {
         switch (tex->get_format()) {
         switch (tex->get_format()) {
           case Texture::F_depth_component16:
           case Texture::F_depth_component16: