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

Commit ef55ba3

Browse files
refactor
1 parent e842217 commit ef55ba3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/integrators/coro_path.cpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class CoroutinePathTracing final : public ProgressiveIntegrator {
3535
uint _max_depth;
3636
uint _rr_depth;
3737
float _rr_threshold;
38-
luisa::string _scheduler_type;
3938
uint _samples_per_pass;
4039
Scheduler _scheduler;
4140
WavefrontScheduler::Config _wavefront_config;
@@ -47,7 +46,6 @@ class CoroutinePathTracing final : public ProgressiveIntegrator {
4746
_max_depth{std::max(desc->property_uint_or_default("depth", 10u), 1u)},
4847
_rr_depth{std::max(desc->property_uint_or_default("rr_depth", 0u), 0u)},
4948
_rr_threshold{std::max(desc->property_float_or_default("rr_threshold", 0.95f), 0.05f)},
50-
_scheduler_type{desc->property_string_or_default("scheduler_type", "wavefront")},
5149
_samples_per_pass{std::max(desc->property_uint_or_default("samples_per_pass", 16u), 1u)},
5250
_scheduler{[&] {
5351
auto s = desc->property_string_or_default(
@@ -88,7 +86,6 @@ class CoroutinePathTracing final : public ProgressiveIntegrator {
8886
[[nodiscard]] auto max_depth() const noexcept { return _max_depth; }
8987
[[nodiscard]] auto rr_depth() const noexcept { return _rr_depth; }
9088
[[nodiscard]] auto rr_threshold() const noexcept { return _rr_threshold; }
91-
[[nodiscard]] auto scheduler_type() const noexcept { return _scheduler_type; }
9289
[[nodiscard]] auto samples_per_pass() const noexcept { return _samples_per_pass; }
9390
[[nodiscard]] luisa::string_view impl_type() const noexcept override { return LUISA_RENDER_PLUGIN_NAME; }
9491
[[nodiscard]] luisa::unique_ptr<Integrator::Instance> build(
@@ -272,11 +269,12 @@ class CoroutinePathTracingInstance final : public ProgressiveIntegrator::Instanc
272269

273270
// evaluate material
274271
auto surface_tag = it->shape().surface_tag();
275-
if (node<CoroutinePathTracing>()->scheduler_type() == "wavefront") {
276-
$suspend("evaluate_surface", std::pair(surface_tag, "coro_hint"));
277-
} else {
278-
$suspend("evaluate_surface");
272+
if (auto pt = node<CoroutinePathTracing>();
273+
pt->scheduler() == CoroutinePathTracing::Scheduler::Wavefront &&
274+
!pt->wavefront_config().hint_fields.empty()) {
275+
$promise("coro_hint", surface_tag);
279276
}
277+
$suspend("evaluate_surface");
280278
swl = sample_wl();
281279
auto wo = -ray->direction();
282280
auto u_lobe = sampler()->generate_1d();

0 commit comments

Comments
 (0)