GPU not able to allocate texture
authorJeroen Bakker <j.bakker@atmind.nl>
Fri, 5 Apr 2019 10:53:26 +0000 (12:53 +0200)
committerJeroen Bakker <j.bakker@atmind.nl>
Fri, 5 Apr 2019 12:40:54 +0000 (14:40 +0200)
In the case of the report a GL_PROXY_TEXTURE_2D_ARRAY of 2509x2509x1 failed to be allocated.
This is a work around as the GL_PROXY_TEXTURE_* is not reliable.

Reviewed By: brecht, fclem

Maniphest Tasks: T63223

Differential Revision: https://developer.blender.org/D4651

source/blender/gpu/intern/gpu_texture.c

index 8aafe34..3ce42ce 100644 (file)
@@ -661,7 +661,7 @@ GPUTexture *GPU_texture_create_nD(
        GLenum proxy = GL_PROXY_TEXTURE_2D;
 
        if (n == 2) {
-               if (d > 0)
+               if (d > 1)
                        proxy = GL_PROXY_TEXTURE_2D_ARRAY;
        }
        else if (n == 1) {