Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-07-27 14:56:07 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-07-27 14:56:07 +0300
commit141e94f87ff29452ed8df82b4c25d8d134a34dad (patch)
tree910149863ea219c8291299cc3558da03786c2c1d /source/blender/gpu/intern/gpu_texture.c
parentbd6d0b94bc17bd0e1a2a89210732a207a0e2b7d7 (diff)
Fix T55888: Eevee: crash when shadow cube size is > 512px
Note that this was only reported to happen on AMD GPU + windows.
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.c')
-rw-r--r--source/blender/gpu/intern/gpu_texture.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 5ac746ec9c1..f5b52db1c85 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -432,6 +432,11 @@ static bool gpu_texture_try_alloc(
glTexImage2D(proxy, 0, internalformat, tex->w, tex->h, 0, data_format, data_type, NULL);
break;
case GL_PROXY_TEXTURE_2D_ARRAY:
+ /* HACK: Some driver wrongly check GL_PROXY_TEXTURE_2D_ARRAY as a GL_PROXY_TEXTURE_3D
+ * checking all dimensions against GPU_max_texture_layers (see T55888). */
+ return (tex->w < GPU_max_texture_size()) &&
+ (tex->h < GPU_max_texture_size()) &&
+ (tex->d < GPU_max_texture_layers());
case GL_PROXY_TEXTURE_3D:
glTexImage3D(proxy, 0, internalformat, tex->w, tex->h, tex->d, 0, data_format, data_type, NULL);
break;