diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-06-24 16:49:51 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-06-24 18:22:31 +0300 |
commit | c78b831e69faaa206ca457e80581f6371cad73fa (patch) | |
tree | 77923734f4315231766b3fe325cc9d41a8517101 /source/blender/draw/intern/draw_manager.c | |
parent | e761d0bdc93007d3fadf14fc42eff3a71ad5ee26 (diff) |
Fix T78073 EEVEE: new motion blur and overscan produce wrong render
This was caused by the override viewport size not being maintained after
DRW_cache_restart().
Also this fixes issue with the inv_size not being updated correctly.
Diffstat (limited to 'source/blender/draw/intern/draw_manager.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 5b1276d0d6b..3e42c4cdb23 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -373,6 +373,8 @@ void DRW_render_viewport_size_set(int size[2]) { DST.size[0] = size[0]; DST.size[1] = size[1]; + DST.inv_size[0] = 1.0f / size[0]; + DST.inv_size[1] = 1.0f / size[1]; } const float *DRW_viewport_size_get(void) @@ -1945,6 +1947,11 @@ void DRW_custom_pipeline(DrawEngineType *draw_engine_type, /* Used when the render engine want to redo another cache populate inside the same render frame. */ void DRW_cache_restart(void) { + /* Save viewport size. */ + float size[2], inv_size[2]; + copy_v2_v2(size, DST.size); + copy_v2_v2(inv_size, DST.inv_size); + /* Force cache to reset. */ drw_viewport_cache_resize(); @@ -1953,6 +1960,10 @@ void DRW_cache_restart(void) DST.buffer_finish_called = false; DRW_hair_init(); + + /* Restore. */ + copy_v2_v2(DST.size, size); + copy_v2_v2(DST.inv_size, inv_size); } static struct DRWSelectBuffer { |