Alternative Upload geometry data in parallel to multiple GPUs using the "Multi-Device" #107552

Open
William Leeson wants to merge 137 commits from leesonw/blender-cluster:upload_changed into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 5 additions and 9 deletions
Showing only changes of commit a916e34033 - Show all commits

View File

@ -697,7 +697,7 @@ void GeometryManager::device_data_xfer_and_bvh_update(int idx,
bool need_update_scene_bvh,
Progress &progress)
{
auto sub_dscene = scene->dscenes[idx];
auto sub_dscene = scene->dscenes[idx].get();
sub_dscene->data.bvh.bvh_layout = BVH_LAYOUT_NONE;
// Get the device to use for this DeviceScene from one of the buffers
Device *sub_device = sub_dscene->tri_verts.device;
@ -1137,7 +1137,7 @@ bool GeometryManager::displacement_and_curve_shadow_transparency(
/* Could break this out across all the devices as
the results are read back to the host. For now, the computations
are done on the first device. */
DeviceScene *sub_dscene = scene->dscenes.front();
DeviceScene *sub_dscene = scene->dscenes.front().get();
Device *sub_device = sub_dscene->tri_verts.device;
{
scoped_callback_timer timer([scene](double time) {

View File

@ -63,9 +63,9 @@ Scene::Scene(const SceneParams &params_, Device *device)
{
/* Create a DeviceScene for each device */
device->foreach_device([this](Device *sub_device) {
auto sub_dscene = new DeviceScene(sub_device);
this->dscenes.push_back(sub_dscene);
auto sub_dscene = make_unique<DeviceScene>(sub_device);
memset((void *)&sub_dscene->data, 0, sizeof(sub_dscene->data));
this->dscenes.push_back(std::move(sub_dscene));
});
memset((void *)&dscene.data, 0, sizeof(dscene.data));
@ -98,10 +98,6 @@ Scene::Scene(const SceneParams &params_, Device *device)
Scene::~Scene()
{
foreach (DeviceScene *sub_scene, dscenes) {
delete sub_scene;
}
free_memory(true);
}

View File

@ -186,7 +186,7 @@ class Scene : public NodeOwner {
AttributeSizes attrib_sizes;
/* Stores a DeviceScene for each sub-device */
std::vector<DeviceScene *> dscenes;
std::vector<unique_ptr<DeviceScene>> dscenes;
/* Stats time logging */
struct SceneTimes {