-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue while using new release of GLM (0.9.6.0) : quaternion & align #283
Comments
Hi, The first issue has been resolved in #282. The second one... erm, I don't know. Does current 0.9.6 branch https://github.com/g-truc/glm/archive/0.9.6.zip resolve your issues? Thanks, |
Hi, Thanks for the first issue fix ! Marc De : Christophe Riccio [mailto:[email protected]] Hi, The first issue has been resolved in #282#282. The second one... erm, I don't know. Does current 0.9.6 branch https://github.com/g-truc/glm/archive/0.9.6.zip resolve your issues? Thanks, — ply to this email directly or view it on GitHubhttps://github.com//issues/283#issuecomment-65556450. |
I reproduced it: 32 bit issue! Thanks, |
Hi, Thanks a lot for your quick answers ! glm ::vec4 * array = new glm ::vec4[4] ; Best regards, Marc LE RENARD De : Christophe Riccio [mailto:[email protected]] I reproduced it: 32 bit issue! Thanks, — |
Maybe that's your fault here, try with delete[] instead. :p
|
That’s it ! I have made a vector instead since my last email, everything is working now with the FORCE defines. Marc LE RENARD De : Christophe Riccio [mailto:[email protected]] Maybe that's your fault here, try with delete[] instead. :p
— |
This issue should be fixed in GLM 0.9.6 branch for GLM 0.9.6.1 release without the need of GLM_FORCE_PURE. Thanks for reporting, |
Just wanted to let you know that this is still a problem in glm 0.9.6.1. |
Hi, Can you post what GLM_MESSAGES is giving you? Thanks, |
followed by dozens of lines of:
The errors go away when I #define GLM_FORCE_PURE. |
So I just got latest from the master branch of glm (0.9.7) and I too ran into the alignment issue. I'm compiling with vs2013 november ctp. I compile for both x86 and x64. When I do my compiling I run with /W4, which spit out a lot of warnings about non standard extensions.
This warning has to do with anonymous structs inside another anonymous struct or union. Whenever this was introduced into the vector types, is when the alignment issue popped up. Only the x86 architecture is showing errors about alignment. After figuring that out, I commented out the following line in glm/detail/setup.hpp #define GLM_HAS_ANONYMOUS_UNION !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) That fixed all the issues. Ill do some digging into why the msvc compiler has alignment issues with that code. Possibly file a bug with microsoft. For now I changed the line to following #define GLM_HAS_ANONYMOUS_UNION !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && !(GLM_COMPILER & GLM_COMPILER_VC) (added '&& !(GLM_COMPILER & GLM_COMPILER_VC' to the end) |
I'm still having the same problem with glm 0.9.6.3 when compiling x86 code with Visual Studio Community 2013:
in the code:
|
Try passing by reference. |
@noizex I can do that as a workaround, but then I get other problems:
for the object Mesh which has two glm:mat4 members. My code also hits a breakpoint in ntdll on deleting another object with glm::mat4 members. There is still something wrong here. EDIT: cinder/Cinder@56fd399 |
For classes that use glm's aligned members I just inherit from a special allocator which allows allocating on heap without warnings. It works and does not cause crashes or memory leaks so I think it's okay. Link to that class is here: https://dl.dropboxusercontent.com/u/1040763/aligned_allocator.h. Then:
That's what I found after some reasearch about aligned members, but treat it with some reserve as I'm not C++ expert :) |
We are updating GLM from 0.9.5.4 (everything went well with #define GLM_FORCE_RADIANS) to 0.9.6.0 and it seems something goes wrong : Here is the message given by Visual 2012:
GLM: Windows platform detected
GLM: Visual C++ compiler detected
GLM: 32 bits model
GLM: C++ with language extensions
GLM: #define GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_LANG_CXX11 or GLM_FORCE_CXX1Y to force using a specific version of the C++ language
GLM: SSE2 instruction set
GLM: #define GLM_FORCE_PURE to avoid using platform specific instruction sets
GLM: Swizzling operators enabled
GLM: .length() returns glm::length_t, a typedef of int following the GLSL specification
GLM: #define GLM_FORCE_SIZE_T_LENGTH for .length() to return a size_t
GLM: Core library included
GLM: GLM_GTC_constants extension included
GLM: GLM_GTC_matrix_transform extension included
GLM: GLM_GTC_matrix_inverse extension included
GLM: GLM_GTC_quaternion extension included
XXXXXXX\glm-0.9.6.0\glm\gtc\quaternion.hpp(116): error C2071: 'glm::tquat<T,P>::operator glm::tmat3x3<T,P>' : classe de stockage non conforme
XXXXXXX\glm-0.9.6.0\glm\gtc\quaternion.hpp(138) : voir la référence à l'instanciation de la classe modèle 'glm::tquat<T,P>' en cours de compilation
XXXXXXXXX\glm-0.9.6.0\glm\gtc\quaternion.hpp(117): error C2071: 'glm::tquat<T,P>::operator glm::tmat4x4<T,P>' : classe de stockage non conforme
Other issue appeared : the data won't be aligned if not given as reference ?
le paramètre formel avec __declspec(align('16')) ne sera pas aligné
Thanks in advance,
The text was updated successfully, but these errors were encountered: