Fix "GPUTexture: texture alloc failed. Not enough Video Memory." in area resizing

`gpu_texture_try_alloc` invalidates zero-sized textures.
The message in the console is not correct in this case (because it is not due to lack of memory).
This commit is contained in:
Germano Cavalcante 2018-01-23 22:50:05 -02:00
parent 7389bfdeb0
commit 1686baa7f2
2 changed files with 2 additions and 1 deletions

View File

@ -157,7 +157,7 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
}
DRW_framebuffer_init(&fbl->downsample_fb, &draw_engine_eevee_type,
(int)viewport_size[0] / 2, (int)viewport_size[1] / 2,
max_ii((int)viewport_size[0] / 2, 1), max_ii((int)viewport_size[1] / 2, 1),
&texmax, 1);

View File

@ -2308,6 +2308,7 @@ void DRW_framebuffer_init(
DRWFboTexture textures[MAX_FBO_TEX], int textures_len)
{
BLI_assert(textures_len <= MAX_FBO_TEX);
BLI_assert(width > 0 && height > 0);
bool create_fb = false;
int color_attachment = -1;