GPUTexture: Fix wrong texture size check

This commit is contained in:
Clément Foucault
2018-07-27 17:50:14 +02:00
parent 5c9754c3aa
commit bdbc6fafc0

View File

@@ -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;