rtiow: move image registration to prevent race condition.
This commit is contained in:
parent
f965a00e0c
commit
c21acb49fe
@ -543,6 +543,23 @@ pub fn render(scene: Scene, output_dir: &Path) -> std::result::Result<(), std::i
|
||||
core_ids
|
||||
};
|
||||
info!("Creating {} render threads", core_ids.len());
|
||||
output::register_image(
|
||||
output::MAIN_IMAGE.to_string(),
|
||||
(scene.width, scene.height),
|
||||
output::ImageType::RGB01,
|
||||
);
|
||||
if scene.adaptive_subsampling.is_some() {
|
||||
output::register_image(
|
||||
output::ADAPTIVE_DEPTH.to_string(),
|
||||
(scene.width, scene.height),
|
||||
output::ImageType::RGB01,
|
||||
);
|
||||
}
|
||||
output::register_image(
|
||||
output::RAYS_PER_PIXEL.to_string(),
|
||||
(scene.width, scene.height),
|
||||
output::ImageType::GreyNormalized,
|
||||
);
|
||||
// Create a thread for each active CPU core.
|
||||
let mut handles = core_ids
|
||||
.into_iter()
|
||||
@ -584,23 +601,6 @@ pub fn render(scene: Scene, output_dir: &Path) -> std::result::Result<(), std::i
|
||||
}));
|
||||
|
||||
info!("Rendering with {} subsamples", scene.subsamples);
|
||||
output::register_image(
|
||||
output::MAIN_IMAGE.to_string(),
|
||||
(scene.width, scene.height),
|
||||
output::ImageType::RGB01,
|
||||
);
|
||||
if scene.adaptive_subsampling.is_some() {
|
||||
output::register_image(
|
||||
output::ADAPTIVE_DEPTH.to_string(),
|
||||
(scene.width, scene.height),
|
||||
output::ImageType::RGB01,
|
||||
);
|
||||
}
|
||||
output::register_image(
|
||||
output::RAYS_PER_PIXEL.to_string(),
|
||||
(scene.width, scene.height),
|
||||
output::ImageType::GreyNormalized,
|
||||
);
|
||||
|
||||
let pixel_total = scene.width * scene.height;
|
||||
let mut last_time = time::Instant::now();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user