Browse Source

GL: fix Context move constructor.

The missing pieces made the delayed creation broken, it worked properly
when the context was created *and then* moved.
euler-xxx
Vladimír Vondruš 5 years ago
parent
commit
32018051f2
  1. 3
      doc/changelog.dox
  2. 9
      src/Magnum/GL/Context.cpp

3
doc/changelog.dox

@ -295,7 +295,8 @@ See also:
@subsection changelog-latest-bugfixes Bug fixes @subsection changelog-latest-bugfixes Bug fixes
- @ref GL::Context move constructor was not marked @cpp noexcept @ce by - @ref GL::Context move constructor was not marked @cpp noexcept @ce by
accident accident and it was also not really moving everything properly, especially
when delayed creation was done on the moved-to object
- @ref GL::Renderer::MemoryBarrier::ShaderStorage had an incorrect value - @ref GL::Renderer::MemoryBarrier::ShaderStorage had an incorrect value
- Fixed assertions related to OpenGL driver workarounds when the proprietary - Fixed assertions related to OpenGL driver workarounds when the proprietary
AMDGPU PRO drivers are used on Linux AMDGPU PRO drivers are used on Linux

9
src/Magnum/GL/Context.cpp

@ -738,7 +738,9 @@ Context::Context(NoCreateT, Utility::Arguments& args, Int argc, const char** arg
} }
} }
Context::Context(Context&& other) noexcept: _version{other._version}, Context::Context(Context&& other) noexcept:
_functionLoader{other._functionLoader},
_version{other._version},
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
_flags{other._flags}, _flags{other._flags},
#endif #endif
@ -748,7 +750,10 @@ Context::Context(Context&& other) noexcept: _version{other._version},
_supportedExtensions{std::move(other._supportedExtensions)}, _supportedExtensions{std::move(other._supportedExtensions)},
#endif #endif
_state{std::move(other._state)}, _state{std::move(other._state)},
_detectedDrivers{std::move(other._detectedDrivers)} _detectedDrivers{std::move(other._detectedDrivers)},
_driverWorkarounds{std::move(other._driverWorkarounds)},
_disabledExtensions{std::move(other._disabledExtensions)},
_internalFlags{other._internalFlags}
{ {
if(currentContext == &other) currentContext = this; if(currentContext == &other) currentContext = this;
} }

Loading…
Cancel
Save