diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2018-06-29 09:42:56 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2018-06-29 09:42:56 +0300 |
commit | 899d100dd44c26ec8633f6d1b5540c11de9226b0 (patch) | |
tree | 03a60f846c66be816730e05c16b91e882f73967e /source/blender/draw/engines/workbench/workbench_deferred.c | |
parent | d34b0faa65f9585d7013a120523e9b87a22c60bd (diff) |
Workbench: Use less GPU memory
When AA was enabled a new buffer was created. As the composite pass is
already done, we can reuse earlier buffers.
For the deferred rendering we reuse the color_buffer_tx and for the
forward rendering we reuse the transparect_accum_tx.
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_deferred.c')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_deferred.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c index c680fd5864c..5eb2344bffe 100644 --- a/source/blender/draw/engines/workbench/workbench_deferred.c +++ b/source/blender/draw/engines/workbench/workbench_deferred.c @@ -72,7 +72,6 @@ static struct { struct GPUTexture *specular_buffer_tx; /* ref only, not alloced */ struct GPUTexture *normal_buffer_tx; /* ref only, not alloced */ struct GPUTexture *composite_buffer_tx; /* ref only, not alloced */ - struct GPUTexture *effect_buffer_tx; /* ref only, not alloced */ SceneDisplay display; /* world light direction for shadows */ int next_object_id; @@ -346,8 +345,6 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata) e_data.specular_buffer_tx = DRW_texture_pool_query_2D(size[0], size[1], GPU_RGBA8, &draw_engine_workbench_solid); e_data.composite_buffer_tx = DRW_texture_pool_query_2D( size[0], size[1], GPU_RGBA16F, &draw_engine_workbench_solid); - e_data.effect_buffer_tx = DRW_texture_pool_query_2D( - size[0], size[1], GPU_RGBA16F, &draw_engine_workbench_solid); if (NORMAL_ENCODING_ENABLED()) { e_data.normal_buffer_tx = DRW_texture_pool_query_2D( @@ -375,7 +372,7 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata) }); GPU_framebuffer_ensure_config(&fbl->effect_fb, { GPU_ATTACHMENT_NONE, - GPU_ATTACHMENT_TEXTURE(e_data.effect_buffer_tx), + GPU_ATTACHMENT_TEXTURE(e_data.color_buffer_tx), }); } @@ -410,7 +407,7 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata) } { - workbench_aa_create_pass(vedata, &e_data.effect_buffer_tx); + workbench_aa_create_pass(vedata, &e_data.color_buffer_tx); } { |