[Bf-blender-cvs] [bdbc6fafc03] blender2.8: GPUTexture: Fix wrong texture size check
Clément Foucault
noreply at git.blender.org
Fri Jul 27 17:51:34 CEST 2018
Commit: bdbc6fafc038afdffdb4d040ea692f15f31a0048
Author: Clément Foucault
Date: Fri Jul 27 17:50:14 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBbdbc6fafc038afdffdb4d040ea692f15f31a0048
GPUTexture: Fix wrong texture size check
===================================================================
M source/blender/gpu/intern/gpu_texture.c
===================================================================
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index e5073196a52..a5dfb6a6b73 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -436,9 +436,9 @@ static bool gpu_texture_try_alloc(
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());
+ return (tex->w > 0) && (tex->w <= GPU_max_texture_size()) &&
+ (tex->h > 0) && (tex->h <= GPU_max_texture_size()) &&
+ (tex->d > 0) && (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;
More information about the Bf-blender-cvs
mailing list