]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
gl_textures: don't load cubemap when not supported
authoruis <uis9936@gmail.com>
Fri, 16 Aug 2024 21:33:44 +0000 (00:33 +0300)
committeruis <uis9936@gmail.com>
Sat, 24 Aug 2024 17:55:59 +0000 (20:55 +0300)
gl_textures.c

index 3ec1ae59a28286e5b0ff93c302ae52dd2385a385..d77f66b905cb856b0a6263f4923560843fbbee62 100644 (file)
@@ -1206,6 +1206,12 @@ static rtexture_t *R_SetupTexture(rtexturepool_t *rtexturepool, const char *iden
                }
        }
 
+       if (texturetype == GLTEXTURETYPE_CUBEMAP && vid.maxtexturesize_cubemap == 0)
+       {
+               Con_Printf ("R_LoadTexture: cubemap texture not supported by driver\n");
+               return NULL;
+       }
+
        texinfo = R_GetTexTypeInfo(textype, flags);
        size = width * height * depth * sides * texinfo->inputbytesperpixel;
        if (size < 1)