diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-25 12:37:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-25 12:37:46 +0300 |
commit | 2188047d9da3f1a5fa7a665ab52d2cd7bcb8a4cf (patch) | |
tree | ed913511f0eb2cd2e33ad21e9a9f935e8c77d463 | |
parent | 5f55022276a82f5750c14e8b0f1772d29e5a1d4b (diff) | |
parent | 292685ea39b4e358c87412e41fb1504378ac23bf (diff) |
Merge branch 'blender-v2.92-release'
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_cryptomatte.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_cryptomatte.c b/source/blender/draw/engines/eevee/eevee_cryptomatte.c index 91a230e987c..90948d67895 100644 --- a/source/blender/draw/engines/eevee/eevee_cryptomatte.c +++ b/source/blender/draw/engines/eevee/eevee_cryptomatte.c @@ -161,6 +161,14 @@ void EEVEE_cryptomatte_output_init(EEVEE_ViewLayerData *UNUSED(sldata), g_data->cryptomatte_download_buffer = MEM_malloc_arrayN( sizeof(float), buffer_size * num_cryptomatte_layers, __func__); } + else { + /* During multiview rendering the `cryptomatte_accum_buffer` is deallocated after all views + * have been rendered. Clear it here to be reused by the next view. */ + memset(g_data->cryptomatte_accum_buffer, + 0, + buffer_size * eevee_cryptomatte_pixel_stride(view_layer) * + sizeof(EEVEE_CryptomatteSample)); + } DRW_texture_ensure_fullscreen_2d(&txl->cryptomatte, format, 0); GPU_framebuffer_ensure_config(&fbl->cryptomatte_fb, |