From 8fbb6c080e01943ea15d29c993974f944727675d Mon Sep 17 00:00:00 2001 From: David Cosby Date: Tue, 28 Jan 2025 16:49:33 -0700 Subject: [PATCH 1/2] Disabled intel intrinsics for arm64 architectures --- cyCore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyCore.h b/cyCore.h index 05c6d19..da23152 100644 --- a/cyCore.h +++ b/cyCore.h @@ -52,7 +52,7 @@ #include #include -#if !defined(CY_NO_INTRIN_H) && !defined(CY_NO_EMMINTRIN_H) && !defined(CY_NO_IMMINTRIN_H) +#if !defined(CY_NO_INTRIN_H) && !defined(CY_NO_EMMINTRIN_H) && !defined(CY_NO_IMMINTRIN_H) && !defined(__aarch64__) # include #endif From e8a259a0166d7c901027116e4da253dfc667dff1 Mon Sep 17 00:00:00 2001 From: David Cosby Date: Tue, 28 Jan 2025 22:31:33 -0700 Subject: [PATCH 2/2] Manually reimplemnted gluErrorString() for unsupporting apple devices --- cyGL.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/cyGL.h b/cyGL.h index 6b8eda5..b97f24c 100644 --- a/cyGL.h +++ b/cyGL.h @@ -1209,7 +1209,37 @@ inline void GL::CheckError( char const *sourcefile, int line, char const *call, while ( (error = glGetError()) != GL_NO_ERROR) { *outStream << "OpenGL ERROR: " << sourcefile << " (line " << line << "): "; if ( call ) *outStream << call << " triggered "; + // gluErrorString() is deprecated and appears to not work on Apple devices. + #if !defined(__APPLE__) *outStream << gluErrorString(error) << std::endl; + #else + // Manually reimplements these error messages as I've found them described here: + // https://github.com/gustafsson/freq/blob/master/lib/gpumisc/gluerrorstring.cpp + switch(error) { + case GL_NO_ERROR: *outStream << "GL_NO_ERROR: No error has been recorded" << std::endl; + + case GL_INVALID_ENUM: *outStream << "GL_INVALID_ENUM: An unacceptable value is specified for an enumerated argument. The offending command is ignored and has no other side effect than to set the error flag" << std::endl; + + case GL_INVALID_VALUE: *outStream << "GL_INVALID_VALUE: A numeric argument is out of range. The offending command is ignored and has no other side effect than to set the error flag" << std::endl; + + case GL_INVALID_OPERATION: *outStream << "GL_INVALID_OPERATION: The specified operation is not allowed in the current state. The offending command is ignored and has no other side effect than to set the error flag" << std::endl; + + #ifdef LEGACY_OPENGL + case GL_STACK_OVERFLOW: *outStream << "GL_STACK_OVERFLOW: An attempt has been made to perform an operation that would cause an internal stack to overflow" << std::endl; + + case GL_STACK_UNDERFLOW: *outStream << "GL_STACK_UNDERFLOW: An attempt has been made to perform an operation that would cause an internal stack to underflow" << std::endl; + #endif + + case GL_OUT_OF_MEMORY: *outStream << "GL_OUT_OF_MEMORY: There is not enough memory left to execute the command. The state of the GL is undefined, except for the state of the error flags, after this error is recorded" << std::endl; + + case GL_INVALID_FRAMEBUFFER_OPERATION: *outStream << "GL_INVALID_FRAMEBUFFER_OPERATION: The framebuffer object is not complete. The offending command is ignored and has no other side effect than to set the error flag" << std::endl; + + #ifdef ARB_KHR_robustness + // https://www.opengl.org/wiki/OpenGL_Error + case GL_CONTEXT_LOST: *outStream << "GL_CONTEXT_LOST: Given if the OpenGL context has been lost, due to a graphics card reset" << std::endl; + #endif + } + #endif } } @@ -1787,4 +1817,4 @@ typedef cy::GLSLShader cyGLSLShader; //!< GLSL shader class typedef cy::GLSLProgram cyGLSLProgram; //!< GLSL program class //------------------------------------------------------------------------------- -#endif +#endif \ No newline at end of file