Fix T66860 Crash on opening .blend file from 2.79

This was caused by the preview render of the material property panel being
1px wide. The computed half buffers width were rounded to 0.
This commit is contained in:
Clément Foucault
2019-07-15 13:07:42 +02:00
parent 761135a284
commit 65a3624877
3 changed files with 7 additions and 1 deletions

View File

@@ -97,6 +97,9 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata),
int buffer_size[2] = {(int)viewport_size[0] / 2, (int)viewport_size[1] / 2};
buffer_size[0] = max_ii(1, buffer_size[0]);
buffer_size[1] = max_ii(1, buffer_size[1]);
eGPUTextureFormat down_format = DRW_state_draw_background() ? GPU_R11F_G11F_B10F : GPU_RGBA16F;
effects->dof_down_near = DRW_texture_pool_query_2d(

View File

@@ -159,6 +159,9 @@ int EEVEE_screen_raytrace_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
const bool high_qual_input = true; /* TODO dither low quality input */
const eGPUTextureFormat format = (high_qual_input) ? GPU_RGBA16F : GPU_RGBA8;
tracing_res[0] = max_ii(1, tracing_res[0]);
tracing_res[1] = max_ii(1, tracing_res[1]);
/* MRT for the shading pass in order to output needed data for the SSR pass. */
effects->ssr_specrough_input = DRW_texture_pool_query_2d(
size_fs[0], size_fs[1], format, &draw_engine_eevee_type);

View File

@@ -173,7 +173,7 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata, Object *camera)
}
const float *full_size = DRW_viewport_size_get();
int size[2] = {full_size[0] / 2, full_size[1] / 2};
int size[2] = {max_ii(1, (int)full_size[0] / 2), max_ii(1, (int)full_size[1] / 2)};
#if 0
/* NOTE: We Ceil here in order to not miss any edge texel if using a NPO2 texture. */
int shrink_h_size[2] = {ceilf(size[0] / 8.0f), size[1]};