Skip to content

Commit 8e66c2e

Browse files
committed
aov: enforce constness in selector (minor change)
1 parent 90d8a86 commit 8e66c2e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/slg/film/filmoutput.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,13 +569,12 @@ void Film::Output(
569569

570570
using Buffer10 = std::unique_ptr< GenericFrameBuffer<1, 0, u_int> >;
571571

572-
std::optional<std::reference_wrapper<Buffer10>> _channel;
573572
auto selector = [&](const FilmOutputs::FilmOutputType t) -> const Buffer10 &
574573
{
575574
switch (t) {
576-
case FilmOutputs::MATERIAL_ID: return std::ref(channel_MATERIAL_ID);
577-
case FilmOutputs::OBJECT_ID: return std::ref(channel_OBJECT_ID);
578-
case FilmOutputs::SAMPLECOUNT: return std::ref(channel_SAMPLECOUNT);
575+
case FilmOutputs::MATERIAL_ID: return std::cref(channel_MATERIAL_ID);
576+
case FilmOutputs::OBJECT_ID: return std::cref(channel_OBJECT_ID);
577+
case FilmOutputs::SAMPLECOUNT: return std::cref(channel_SAMPLECOUNT);
579578
default: throw runtime_error(
580579
"Unknown film output type in Film::Output(): " + ToString(type)
581580
);

0 commit comments

Comments
 (0)