Skip to content

Commit

Permalink
fix disney
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed Sep 11, 2023
1 parent 4e72bdc commit 6b82b94
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/surfaces/disney.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ class DisneyClosureImpl : public DisneyClosureImplBase {
// sample
auto wo_local = _ctx.it.shading().world_to_local(wo);
auto event = def(Surface::event_reflect);
BxDF::SampledDirection wi_sample;
BxDF::SampledDirection wi_sample{.valid = false};
$switch(sampling_tech) {
if (_diffuse) {
$case(diffuse_like_technique_index) {
Expand All @@ -573,7 +573,6 @@ class DisneyClosureImpl : public DisneyClosureImplBase {
event = ite(cos_theta(wo_local) > 0.f, Surface::event_enter, Surface::event_exit);
};
}
$default { unreachable(); };
};
auto eval = Surface::Evaluation::zero(_ctx.color.dimension());
auto wi = _ctx.it.shading().local_to_world(wi_sample.wi);
Expand Down Expand Up @@ -798,7 +797,7 @@ class ThinDisneyClosureImpl : public DisneyClosureImplBase {
// sample
auto wo_local = _ctx.it.shading().world_to_local(wo);
auto event = def(Surface::event_reflect);
BxDF::SampledDirection wi_sample;
BxDF::SampledDirection wi_sample{.valid = false};
$switch(sampling_tech) {
if (_diffuse) {
$case(diffuse_like_technique_index) {
Expand Down Expand Up @@ -827,7 +826,6 @@ class ThinDisneyClosureImpl : public DisneyClosureImplBase {
event = Surface::event_through;
};
}
$default { unreachable(); };
};
auto eval = Surface::Evaluation::zero(_ctx.color.dimension());
auto wi = _ctx.it.shading().local_to_world(wi_sample.wi);
Expand Down
3 changes: 2 additions & 1 deletion src/util/polymorphic_closure.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ class PolymorphicCall {
_closures[i]->post_eval();
};
}
compute::detail::SwitchDefaultStmtBuilder{} % compute::unreachable;
compute::detail::SwitchDefaultStmtBuilder{} %
[] { compute::unreachable(); };
};
}
}
Expand Down

0 comments on commit 6b82b94

Please sign in to comment.