@@ -130,14 +130,11 @@ void RasterizerGLES3::clear_depth(float p_depth) {
130130
131131#ifdef CAN_DEBUG
132132static void GLAPIENTRY _gl_debug_print (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const GLvoid *userParam) {
133- if (type == _EXT_DEBUG_TYPE_OTHER_ARB) {
133+ // These are ultimately annoying, so removing for now.
134+ if (type == _EXT_DEBUG_TYPE_OTHER_ARB || type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) {
134135 return ;
135136 }
136137
137- if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) {
138- return ; // these are ultimately annoying, so removing for now
139- }
140-
141138 char debSource[256 ], debType[256 ], debSev[256 ];
142139
143140 if (source == _EXT_DEBUG_SOURCE_API_ARB) {
@@ -152,6 +149,8 @@ static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GL
152149 strcpy (debSource, " Application" );
153150 } else if (source == _EXT_DEBUG_SOURCE_OTHER_ARB) {
154151 strcpy (debSource, " Other" );
152+ } else {
153+ ERR_FAIL_MSG (vformat (" GL ERROR: Invalid or unhandled source '%d' in debug callback." , source));
155154 }
156155
157156 if (type == _EXT_DEBUG_TYPE_ERROR_ARB) {
@@ -162,10 +161,8 @@ static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GL
162161 strcpy (debType, " Undefined behavior" );
163162 } else if (type == _EXT_DEBUG_TYPE_PORTABILITY_ARB) {
164163 strcpy (debType, " Portability" );
165- } else if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) {
166- strcpy (debType, " Performance" );
167- } else if (type == _EXT_DEBUG_TYPE_OTHER_ARB) {
168- strcpy (debType, " Other" );
164+ } else {
165+ ERR_FAIL_MSG (vformat (" GL ERROR: Invalid or unhandled type '%d' in debug callback." , type));
169166 }
170167
171168 if (severity == _EXT_DEBUG_SEVERITY_HIGH_ARB) {
@@ -174,6 +171,8 @@ static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GL
174171 strcpy (debSev, " Medium" );
175172 } else if (severity == _EXT_DEBUG_SEVERITY_LOW_ARB) {
176173 strcpy (debSev, " Low" );
174+ } else {
175+ ERR_FAIL_MSG (vformat (" GL ERROR: Invalid or unhandled severity '%d' in debug callback." , severity));
177176 }
178177
179178 String output = String () + " GL ERROR: Source: " + debSource + " \t Type: " + debType + " \t ID: " + itos (id) + " \t Severity: " + debSev + " \t Message: " + message;
0 commit comments