diff --git a/src/util/spec.h b/src/util/spec.h index 5d3b742d..0bc6ce07 100644 --- a/src/util/spec.h +++ b/src/util/spec.h @@ -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 &values() noexcept { return _samples; }