Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed Dec 23, 2023
1 parent 5816f61 commit e12f2ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/util/spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ class SampledSpectrum {
LUISA_ASSERT(rhs.dimension() == 1u || dimension() == rhs.dimension(),
"Invalid spectrum dimensions for operator=: {} vs {}.",
dimension(), rhs.dimension());
compute::outline([&] {
if (rhs.dimension() == 1u) {
for (auto i = 0u; i < dimension(); i++) { _samples[i] = rhs[i]; }
});
} else {
_samples = rhs._samples;
}
return *this;
}
[[nodiscard]] Local<float> &values() noexcept { return _samples; }
Expand Down

0 comments on commit e12f2ba

Please sign in to comment.