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

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed May 15, 2024
1 parent e842217 commit ef55ba3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/integrators/coro_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class CoroutinePathTracing final : public ProgressiveIntegrator {
uint _max_depth;
uint _rr_depth;
float _rr_threshold;
luisa::string _scheduler_type;
uint _samples_per_pass;
Scheduler _scheduler;
WavefrontScheduler::Config _wavefront_config;
Expand All @@ -47,7 +46,6 @@ class CoroutinePathTracing final : public ProgressiveIntegrator {
_max_depth{std::max(desc->property_uint_or_default("depth", 10u), 1u)},
_rr_depth{std::max(desc->property_uint_or_default("rr_depth", 0u), 0u)},
_rr_threshold{std::max(desc->property_float_or_default("rr_threshold", 0.95f), 0.05f)},
_scheduler_type{desc->property_string_or_default("scheduler_type", "wavefront")},
_samples_per_pass{std::max(desc->property_uint_or_default("samples_per_pass", 16u), 1u)},
_scheduler{[&] {
auto s = desc->property_string_or_default(
Expand Down Expand Up @@ -88,7 +86,6 @@ class CoroutinePathTracing final : public ProgressiveIntegrator {
[[nodiscard]] auto max_depth() const noexcept { return _max_depth; }
[[nodiscard]] auto rr_depth() const noexcept { return _rr_depth; }
[[nodiscard]] auto rr_threshold() const noexcept { return _rr_threshold; }
[[nodiscard]] auto scheduler_type() const noexcept { return _scheduler_type; }
[[nodiscard]] auto samples_per_pass() const noexcept { return _samples_per_pass; }
[[nodiscard]] luisa::string_view impl_type() const noexcept override { return LUISA_RENDER_PLUGIN_NAME; }
[[nodiscard]] luisa::unique_ptr<Integrator::Instance> build(
Expand Down Expand Up @@ -272,11 +269,12 @@ class CoroutinePathTracingInstance final : public ProgressiveIntegrator::Instanc

// evaluate material
auto surface_tag = it->shape().surface_tag();
if (node<CoroutinePathTracing>()->scheduler_type() == "wavefront") {
$suspend("evaluate_surface", std::pair(surface_tag, "coro_hint"));
} else {
$suspend("evaluate_surface");
if (auto pt = node<CoroutinePathTracing>();
pt->scheduler() == CoroutinePathTracing::Scheduler::Wavefront &&
!pt->wavefront_config().hint_fields.empty()) {
$promise("coro_hint", surface_tag);
}
$suspend("evaluate_surface");
swl = sample_wl();
auto wo = -ray->direction();
auto u_lobe = sampler()->generate_1d();
Expand Down

0 comments on commit ef55ba3

Please sign in to comment.