Skip to content

Commit a8e6989

Browse files
committed
fixed limits for long multi-pass renderings
1 parent 204d89b commit a8e6989

File tree

4 files changed

+22
-23
lines changed

4 files changed

+22
-23
lines changed

src/render/integrator.cpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -200,22 +200,22 @@ SamplingIntegrator<Float, Spectrum>::render(Scene *scene,
200200
} else {
201201
size_t wavefront_size = (size_t) film_size.x() *
202202
(size_t) film_size.y() * (size_t) spp_per_pass,
203-
wavefront_size_limit =
204-
dr::is_llvm_v<Float> ? 0xffffffffu : 0x40000000u;
203+
wavefront_size_limit = 0xffffffffu;
205204

206205
if (wavefront_size > wavefront_size_limit) {
207-
spp_per_pass /= (uint32_t) ((wavefront_size + wavefront_size_limit - 1) / wavefront_size_limit);
208-
n_passes = spp / spp_per_pass;
206+
spp_per_pass /=
207+
(uint32_t)((wavefront_size + wavefront_size_limit - 1) /
208+
wavefront_size_limit);
209+
n_passes = spp / spp_per_pass;
209210
wavefront_size = (size_t) film_size.x() * (size_t) film_size.y() *
210211
(size_t) spp_per_pass;
211212

212213
Log(Warn,
213214
"The requested rendering task involves %zu Monte Carlo "
214-
"samples, which exceeds the upper limit of 2^%zu = %zu for "
215-
"this variant. Mitsuba will instead split the rendering task "
216-
"%zu smaller passes to avoid exceeding the limits.",
217-
wavefront_size, dr::log2i(wavefront_size_limit + 1),
218-
wavefront_size_limit, n_passes);
215+
"samples, which exceeds the upper limit of 2^32 = 4294967296 "
216+
"for this variant. Mitsuba will instead split the rendering "
217+
"task into %zu smaller passes to avoid exceeding the limits.",
218+
wavefront_size, n_passes);
219219
}
220220

221221
dr::sync_thread(); // Separate from scene initialization (for timings)
@@ -632,22 +632,21 @@ AdjointIntegrator<Float, Spectrum>::render(Scene *scene,
632632
evaluate = true;
633633
}
634634

635-
size_t wavefront_size_limit =
636-
dr::is_llvm_v<Float> ? 0xffffffffu : 0x40000000u;
637-
635+
constexpr size_t wavefront_size_limit = 0xffffffffu;
638636
if (samples_per_pass > wavefront_size_limit) {
639-
spp_per_pass /= (uint32_t) ((samples_per_pass + wavefront_size_limit - 1) / wavefront_size_limit);
637+
spp_per_pass /=
638+
(uint32_t)((samples_per_pass + wavefront_size_limit - 1) /
639+
wavefront_size_limit);
640640
n_passes = spp / spp_per_pass;
641641
samples_per_pass = (size_t) film_size.x() * (size_t) film_size.y() *
642642
(size_t) spp_per_pass;
643643

644644
Log(Warn,
645645
"The requested rendering task involves %zu Monte Carlo "
646-
"samples, which exceeds the upper limit of 2^%zu = %zu for "
647-
"this variant. Mitsuba will instead split the rendering task "
648-
"%zu smaller passes to avoid exceeding the limits.",
649-
samples_per_pass, dr::log2i(wavefront_size_limit + 1),
650-
wavefront_size_limit, n_passes);
646+
"samples, which exceeds the upper limit of 2^32 = 4294967296 "
647+
"for this variant. Mitsuba will instead split the rendering "
648+
"task into %zu smaller passes to avoid exceeding the limits.",
649+
samples_per_pass, n_passes);
651650
}
652651

653652
Log(Info, "Starting render job (%ux%u, %u sample%s%s)",

src/render/sampler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ MI_VARIANT Sampler<Float, Spectrum>::Sampler(const Sampler &sampler)
3232
MI_VARIANT Sampler<Float, Spectrum>::~Sampler() { }
3333

3434
MI_VARIANT void Sampler<Float, Spectrum>::seed(uint32_t /* seed */,
35-
uint32_t wavefront_size) {
35+
uint32_t wavefront_size) {
3636
if constexpr (dr::is_array_v<Float>) {
3737
// Only overwrite when specified
3838
if (wavefront_size != (uint32_t) -1) {

src/samplers/independent.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ template <typename Float, typename Spectrum>
6868
class IndependentSampler final : public PCG32Sampler<Float, Spectrum> {
6969
public:
7070
MI_IMPORT_BASE(PCG32Sampler, m_sample_count, m_base_seed, m_rng, seed,
71-
seeded, m_samples_per_wavefront, m_wavefront_size,
72-
schedule_state)
71+
seeded, m_samples_per_wavefront, m_wavefront_size,
72+
schedule_state)
7373
MI_IMPORT_TYPES()
7474

7575
IndependentSampler(const Properties &props) : Base(props) { }

src/samplers/stratified.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ template <typename Float, typename Spectrum>
6767
class StratifiedSampler final : public PCG32Sampler<Float, Spectrum> {
6868
public:
6969
MI_IMPORT_BASE(PCG32Sampler, m_sample_count, m_base_seed, m_rng, seeded,
70-
m_samples_per_wavefront, m_dimension_index,
71-
current_sample_index, compute_per_sequence_seed)
70+
m_samples_per_wavefront, m_dimension_index,
71+
current_sample_index, compute_per_sequence_seed)
7272
MI_IMPORT_TYPES()
7373

7474
StratifiedSampler(const Properties &props) : Base(props) {

0 commit comments

Comments
 (0)