Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
OldNew777 committed May 15, 2024
1 parent 9bb08a3 commit 915e3a2
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/integrators/coro_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,16 @@ class CoroutinePathTracing final : public ProgressiveIntegrator {
Wavefront,
Persistent,
};

#define PT_CORO_SIGNATURE float, float, uint
using SchedulerBase = coroutine::CoroScheduler<PT_CORO_SIGNATURE>;
using SimpleScheduler = coroutine::StateMachineCoroScheduler<PT_CORO_SIGNATURE>;
using WavefrontScheduler = coroutine::WavefrontCoroScheduler<PT_CORO_SIGNATURE>;
using PersistentScheduler = coroutine::PersistentThreadsCoroScheduler<PT_CORO_SIGNATURE>;
#undef PT_CORO_SIGNATURE
using SchedulerBase = coroutine::CoroScheduler<float, float, uint>;

private:
uint _max_depth;
uint _rr_depth;
float _rr_threshold;
uint _samples_per_pass;
Scheduler _scheduler;
WavefrontScheduler::Config _wavefront_config;
PersistentScheduler::Config _persistent_config;
coroutine::WavefrontCoroSchedulerConfig _wavefront_config;
coroutine::PersistentThreadsCoroSchedulerConfig _persistent_config;

public:
CoroutinePathTracing(Scene *scene, const SceneNodeDesc *desc) noexcept
Expand Down Expand Up @@ -137,7 +131,8 @@ class CoroutinePathTracingInstance final : public ProgressiveIntegrator::Instanc
auto &stream = *command_buffer.stream();
switch (coro_pt->scheduler()) {
case CoroutinePathTracing::Scheduler::Simple: {
return luisa::make_unique<CoroutinePathTracing::SimpleScheduler>(device, render);
coroutine::StateMachineCoroScheduler s{device, render};
return luisa::make_unique<decltype(s)>(std::move(s));
}
case CoroutinePathTracing::Scheduler::Wavefront: {
auto config = coro_pt->wavefront_config();
Expand All @@ -156,7 +151,8 @@ class CoroutinePathTracingInstance final : public ProgressiveIntegrator::Instanc
config.thread_count,
config.hint_range,
!config.hint_fields.empty() ? config.hint_fields[0] : "NULL");
return luisa::make_unique<CoroutinePathTracing::WavefrontScheduler>(device, render, config);
coroutine::WavefrontCoroScheduler s{device, render, config};
return luisa::make_unique<decltype(s)>(std::move(s));
}
case CoroutinePathTracing::Scheduler::Persistent: {
auto config = coro_pt->persistent_config();
Expand All @@ -165,7 +161,8 @@ class CoroutinePathTracingInstance final : public ProgressiveIntegrator::Instanc
config.block_size,
config.fetch_size,
config.global_memory_ext);
return luisa::make_unique<CoroutinePathTracing::PersistentScheduler>(device, render, config);
coroutine::PersistentThreadsCoroScheduler s{device, render, config};
return luisa::make_unique<decltype(s)>(std::move(s));
}
default:
break;
Expand Down

0 comments on commit 915e3a2

Please sign in to comment.