Cycles: More accurate volume stack size calculation
The idea is to allow having a lot of non-intersecting volumes without allocating volume stack to its full size. With the F11285472 file the memory usage goes from 1400 MiB to 1000 on the RTX6000 card. The fix makes it so the integrator work memory is allocated after scene update which has downside of possible less efficient update when some textures don't fit GPU memory, but has an advantage of making proper decision and having a clear and consistent internal API. Fixes memory part of T92014. Differential Revision: https://developer.blender.org/D12966
This commit is contained in:
@@ -539,19 +539,12 @@ bool Session::update_scene(int width, int height)
|
||||
Camera *cam = scene->camera;
|
||||
cam->set_screen_size(width, height);
|
||||
|
||||
/* First detect which kernel features are used and allocate working memory.
|
||||
* This helps estimate how may device memory is available for the scene and
|
||||
* how much we need to allocate on the host instead. */
|
||||
scene->update_kernel_features();
|
||||
const bool scene_update_result = scene->update(progress);
|
||||
|
||||
path_trace_->load_kernels();
|
||||
path_trace_->alloc_work_memory();
|
||||
|
||||
if (scene->update(progress)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return scene_update_result;
|
||||
}
|
||||
|
||||
static string status_append(const string &status, const string &suffix)
|
||||
|
||||
Reference in New Issue
Block a user