Cycles: Reduce memory used by background light update

Simple change: just get rid of intermediate data a bit earlier, before
final pixels array is being allocated. This gives around 30% of memory
save during light update (this is about 60meg in the frank sheep file
i'm using here).

This isn't really visible by artists a lot, because actual spike happens
on BVH construction. But it doesn't mean we shouldn't be accurate with
memory usage in other areas.
This commit is contained in:
Sergey Sharybin 2015-02-19 18:15:07 +05:00
parent 27d1446d24
commit 0f652501c7
Notes: blender-bot 2023-02-14 10:02:29 +01:00
Referenced by issue #41964, 2.72 Freestyle renders two times longer on Linux
1 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,8 @@ static void shade_background_pixels(Device *device, DeviceScene *dscene, int res
device->mem_free(d_input);
device->mem_free(d_output);
d_input.clear();
float4 *d_output_data = reinterpret_cast<float4*>(d_output.data_pointer);
pixels.resize(width*height);