Explorar el Código

Fix luminance formats in core-profile-only OpenGL contexts

rdb hace 10 años
padre
commit
efe8ec60ee
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      panda/src/glstuff/glGraphicsStateGuardian_src.cxx

+ 8 - 0
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -8644,6 +8644,7 @@ get_internal_image_format(Texture *tex, bool force_sized) const {
 #endif
 #endif
 
 
   case Texture::F_luminance:
   case Texture::F_luminance:
+#ifdef SUPPORT_FIXED_FUNCTION
 #ifndef OPENGLES
 #ifndef OPENGLES
     if (tex->get_component_type() == Texture::T_float) {
     if (tex->get_component_type() == Texture::T_float) {
       return GL_LUMINANCE16F_ARB;
       return GL_LUMINANCE16F_ARB;
@@ -8656,8 +8657,12 @@ get_internal_image_format(Texture *tex, bool force_sized) const {
     {
     {
       return force_sized ? GL_LUMINANCE8 : GL_LUMINANCE;
       return force_sized ? GL_LUMINANCE8 : GL_LUMINANCE;
     }
     }
+#else
+    return force_sized ? GL_R8 : GL_RED;
+#endif
   case Texture::F_luminance_alpha:
   case Texture::F_luminance_alpha:
   case Texture::F_luminance_alphamask:
   case Texture::F_luminance_alphamask:
+#ifdef SUPPORT_FIXED_FUNCTION
 #ifndef OPENGLES
 #ifndef OPENGLES
     if (tex->get_component_type() == Texture::T_float || tex->get_component_type() == Texture::T_unsigned_short) {
     if (tex->get_component_type() == Texture::T_float || tex->get_component_type() == Texture::T_unsigned_short) {
       return GL_LUMINANCE_ALPHA16F_ARB;
       return GL_LUMINANCE_ALPHA16F_ARB;
@@ -8666,6 +8671,9 @@ get_internal_image_format(Texture *tex, bool force_sized) const {
     {
     {
       return force_sized ? GL_LUMINANCE8_ALPHA8 : GL_LUMINANCE_ALPHA;
       return force_sized ? GL_LUMINANCE8_ALPHA8 : GL_LUMINANCE_ALPHA;
     }
     }
+#else
+    return force_sized ? GL_RG8 : GL_RG;
+#endif
 
 
 #ifndef OPENGLES_1
 #ifndef OPENGLES_1
   case Texture::F_srgb:
   case Texture::F_srgb: