Skip to content

Commit 22011fb

Browse files
workaround dx
1 parent 52dd56f commit 22011fb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/base/geometry.cpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ void Geometry::_alpha_skip(SurfaceCandidate &c) const noexcept {
167167
auto ray = c.ray();
168168
auto bary = make_float3(1.f - hit.bary.x - hit.bary.y, hit.bary);
169169
auto it = interaction(hit.inst, hit.prim, bary, -ray->direction());
170+
auto committed = def(false);
170171
$if(it->shape().maybe_non_opaque() & it->shape().has_surface()) {
171172
auto u = xxhash32(make_uint4(hit.inst, hit.prim, compute::as<uint2>(hit.bary))) * 0x1p-32f;
172173
$switch(it->shape().surface_tag()) {
@@ -176,20 +177,22 @@ void Geometry::_alpha_skip(SurfaceCandidate &c) const noexcept {
176177
$case(i) {
177178
// TODO: pass the correct swl and time
178179
if (auto opacity = surface->evaluate_opacity(*it, _pipeline.spectrum()->sample(.5f), 0.f)) {
179-
$if(u < *opacity) {
180-
c.commit();
181-
};
180+
committed = u <= *opacity;
182181
} else {
183-
c.commit();
182+
committed = true;
184183
}
185184
};
186-
}
185+
}
187186
}
188187
$default { compute::unreachable(); };
189188
};
190189
}
191190
$else {
191+
committed = true;
192+
};
193+
$if(committed) {
192194
c.commit();
195+
// $if (terminate_on_any) { c.terminate(); };
193196
};
194197
}
195198

0 commit comments

Comments
 (0)