gentoo/dev-games/ogre/files/ogre-2.1-fix_warnings.patch
Sven Eden 2e8d95ccd9
dev-games/ogre: Bump to 2.1 - First major 2.1 release
Changes from the pre-release:
 * gles2 USE flag is gone, the GLES2 render system is not ported, yet
 * Added "fine-granularity" USE flag to enable XXXX
   which has a noticable performance impact.
 * double-precision USE flag is back in. But if activated, both
   OGRE_SIMD_NEON and OGRE_SIMD_SSE2 must be disabled, so the
   performance impact is quite big.
 * mobile USE flag is gone, this needs further testing. Also I think
   that building for mobile devices is not really interesting on
   Gentoo, is it?
 * Fixed a few warnings and issues, and spoke with upstream about
   them. ( See: https://github.com/OGRECave/ogre-next/issues/90 )
 * Fixed a missing include compilation issue and reported it to
   upstream. ( See: OGRECave/ogre-next#132 )

Package-Manager: Portage-2.3.101, Repoman-2.3.22
Signed-off-by: Sven Eden <yamakuzure@gmx.net>
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2020-08-25 22:59:57 +01:00

16 lines
873 B
Diff

--- a/Samples/2.0/Tutorials/Tutorial_Terrain/src/Terra/TerrainCell.cpp 2020-04-28 18:10:40.416995414 +0200
+++ b/Samples/2.0/Tutorials/Tutorial_Terrain/src/Terra/TerrainCell.cpp 2020-04-28 18:30:46.074920186 +0200
@@ -133,7 +133,11 @@
gpuPtr[0] = m_verticesPerLine;
gpuPtr[1] = m_lodLevel;
gpuPtr[2] = vao->getPrimitiveCount() / m_verticesPerLine - 2u;
- gpuPtr[3] = *reinterpret_cast<uint32*>( &m_parentTerra->m_skirtSize );
+ /* Triggers: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
+ * gpuPtr[3] = *reinterpret_cast<uint32*>( &m_parentTerra->m_skirtSize );
+ * See: http://zaynar.co.uk/docs/float-aliasing.html
+ */
+ memcpy(&gpuPtr[3], &m_parentTerra->m_skirtSize, sizeof(gpuPtr[3]));
//ivec4 xzTexPosBounds
((int32*RESTRICT_ALIAS)gpuPtr)[4] = m_gridX;