On Windows, Malia crashes with option -wpp when launch in debug configuration.

To reproduce the bug, compile malia in debug mode under Windows with msvc 2022 (no other versions tested). Run the demo scene with the command .\malia.exe -wpp 3 (or with the -i option, it does not change anything). It seems the crash is due to the wpp option. When a number greater than 2 is given, it crashes.

The line that crash is the 1786 of optix_renderer.cpp. In the updateBackground method, the call to the operator [ ] in "float_data[wave_id]" produces the error. It seems like the buffer float_data only contains 15 elements and it crashes when we try to access the 16nth when wave_id is equal to 15.

Here is the function where it crashes that is defined by the msvc implementation of the stl.

_NODISCARD _CONSTEXPR20 _Ty& operator[](const size_type _Pos) noexcept /* strengthened */ {
        auto& _My_data = _Mypair._Myval2;
#if _CONTAINER_DEBUG_LEVEL > 0
        _STL_VERIFY(
            _Pos < static_cast<size_type>(_My_data._Mylast - _My_data._Myfirst), "vector subscript out of range");
#endif // _CONTAINER_DEBUG_LEVEL > 0

        return _My_data._Myfirst[_Pos];
}

Error message from Windows :