Browse Source

Shaders: the early exit is only for assertion testing, document that.

I knew it had to be there, but then forgot and wanted to remove it as
superfluous because such case can't happen from user code. Well...
pull/589/head
Vladimír Vondruš 4 years ago
parent
commit
56cc8734c7
  1. 4
      src/Magnum/Shaders/DistanceFieldVectorGL.cpp
  2. 4
      src/Magnum/Shaders/FlatGL.cpp
  3. 8
      src/Magnum/Shaders/MeshVisualizerGL.cpp
  4. 4
      src/Magnum/Shaders/PhongGL.cpp
  5. 4
      src/Magnum/Shaders/VectorGL.cpp
  6. 4
      src/Magnum/Shaders/VertexColorGL.cpp

4
src/Magnum/Shaders/DistanceFieldVectorGL.cpp

@ -164,7 +164,11 @@ template<UnsignedInt dimensions> typename DistanceFieldVectorGL<dimensions>::Com
} }
template<UnsignedInt dimensions> DistanceFieldVectorGL<dimensions>::DistanceFieldVectorGL(CompileState&& state): DistanceFieldVectorGL{static_cast<DistanceFieldVectorGL&&>(std::move(state))} { template<UnsignedInt dimensions> DistanceFieldVectorGL<dimensions>::DistanceFieldVectorGL(CompileState&& state): DistanceFieldVectorGL{static_cast<DistanceFieldVectorGL&&>(std::move(state))} {
#ifdef CORRADE_GRACEFUL_ASSERT
/* When graceful assertions fire from within compile(), we get a NoCreate'd
CompileState. Exiting makes it possible to test the assert. */
if(!id()) return; if(!id()) return;
#endif
CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink()); CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink());

4
src/Magnum/Shaders/FlatGL.cpp

@ -239,7 +239,11 @@ template<UnsignedInt dimensions> typename FlatGL<dimensions>::CompileState FlatG
} }
template<UnsignedInt dimensions> FlatGL<dimensions>::FlatGL(CompileState&& state): FlatGL{static_cast<FlatGL&&>(std::move(state))} { template<UnsignedInt dimensions> FlatGL<dimensions>::FlatGL(CompileState&& state): FlatGL{static_cast<FlatGL&&>(std::move(state))} {
#ifdef CORRADE_GRACEFUL_ASSERT
/* When graceful assertions fire from within compile(), we get a NoCreate'd
CompileState. Exiting makes it possible to test the assert. */
if(!id()) return; if(!id()) return;
#endif
CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink()); CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink());

8
src/Magnum/Shaders/MeshVisualizerGL.cpp

@ -530,7 +530,11 @@ MeshVisualizerGL2D::MeshVisualizerGL2D(const Flags flags, const UnsignedInt mate
#endif #endif
MeshVisualizerGL2D::MeshVisualizerGL2D(CompileState&& state): MeshVisualizerGL2D{static_cast<MeshVisualizerGL2D&&>(std::move(state))} { MeshVisualizerGL2D::MeshVisualizerGL2D(CompileState&& state): MeshVisualizerGL2D{static_cast<MeshVisualizerGL2D&&>(std::move(state))} {
#ifdef CORRADE_GRACEFUL_ASSERT
/* When graceful assertions fire from within compile(), we get a NoCreate'd
CompileState. Exiting makes it possible to test the assert. */
if(!id()) return; if(!id()) return;
#endif
CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink()); CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink());
@ -902,7 +906,11 @@ MeshVisualizerGL3D::CompileState MeshVisualizerGL3D::compile(Flags flags
} }
MeshVisualizerGL3D::MeshVisualizerGL3D(CompileState&& state): MeshVisualizerGL3D{static_cast<MeshVisualizerGL3D&&>(std::move(state))} { MeshVisualizerGL3D::MeshVisualizerGL3D(CompileState&& state): MeshVisualizerGL3D{static_cast<MeshVisualizerGL3D&&>(std::move(state))} {
#ifdef CORRADE_GRACEFUL_ASSERT
/* When graceful assertions fire from within compile(), we get a NoCreate'd
CompileState. Exiting makes it possible to test the assert. */
if(!id()) return; if(!id()) return;
#endif
CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink()); CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink());

4
src/Magnum/Shaders/PhongGL.cpp

@ -349,7 +349,11 @@ PhongGL::CompileState PhongGL::compile(const Flags flags, const UnsignedInt ligh
} }
PhongGL::PhongGL(CompileState&& state): PhongGL{static_cast<PhongGL&&>(std::move(state))} { PhongGL::PhongGL(CompileState&& state): PhongGL{static_cast<PhongGL&&>(std::move(state))} {
#ifdef CORRADE_GRACEFUL_ASSERT
/* When graceful assertions fire from within compile(), we get a NoCreate'd
CompileState. Exiting makes it possible to test the assert. */
if(!id()) return; if(!id()) return;
#endif
CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink()); CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink());

4
src/Magnum/Shaders/VectorGL.cpp

@ -166,7 +166,11 @@ template<UnsignedInt dimensions> typename VectorGL<dimensions>::CompileState Vec
} }
template<UnsignedInt dimensions> VectorGL<dimensions>::VectorGL(CompileState&& state): VectorGL{static_cast<VectorGL&&>(std::move(state))} { template<UnsignedInt dimensions> VectorGL<dimensions>::VectorGL(CompileState&& state): VectorGL{static_cast<VectorGL&&>(std::move(state))} {
#ifdef CORRADE_GRACEFUL_ASSERT
/* When graceful assertions fire from within compile(), we get a NoCreate'd
CompileState. Exiting makes it possible to test the assert. */
if(!id()) return; if(!id()) return;
#endif
CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink()); CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink());

4
src/Magnum/Shaders/VertexColorGL.cpp

@ -144,7 +144,11 @@ template<UnsignedInt dimensions> typename VertexColorGL<dimensions>::CompileStat
} }
template<UnsignedInt dimensions> VertexColorGL<dimensions>::VertexColorGL(CompileState&& state): VertexColorGL{static_cast<VertexColorGL&&>(std::move(state))} { template<UnsignedInt dimensions> VertexColorGL<dimensions>::VertexColorGL(CompileState&& state): VertexColorGL{static_cast<VertexColorGL&&>(std::move(state))} {
#ifdef CORRADE_GRACEFUL_ASSERT
/* When graceful assertions fire from within compile(), we get a NoCreate'd
CompileState. Exiting makes it possible to test the assert. */
if(!id()) return; if(!id()) return;
#endif
CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink()); CORRADE_INTERNAL_ASSERT_OUTPUT(checkLink());

Loading…
Cancel
Save