Skip to content

Commit 6fd031c

Browse files
author
Daisuke Kasuga
committed
add the macro to gl init codes
1 parent b0e90c4 commit 6fd031c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

filament/backend/src/opengl/OpenGLContext.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ bool OpenGLContext::queryOpenGLVersion(GLint* major, GLint* minor) noexcept {
5959
// OpenGL version
6060
glGetIntegerv(GL_MAJOR_VERSION, major);
6161
glGetIntegerv(GL_MINOR_VERSION, minor);
62+
63+
CHECK_GL_INIT_ERROR_FOR_OPTIMIZED_BUILD(utils::slog.e)
64+
6265
return (glGetError() == GL_NO_ERROR);
6366
#endif
6467
}
@@ -109,6 +112,8 @@ OpenGLContext::OpenGLContext(OpenGLPlatform& platform,
109112
glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &gets.max_3d_texture_size);
110113
glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &gets.max_array_texture_layers);
111114

115+
CHECK_GL_INIT_ERROR_FOR_OPTIMIZED_BUILD(utils::slog.e)
116+
112117
mFeatureLevel = resolveFeatureLevel(state.major, state.minor, ext, gets, bugs);
113118

114119
#ifdef BACKEND_OPENGL_VERSION_GLES
@@ -149,6 +154,7 @@ OpenGLContext::OpenGLContext(OpenGLPlatform& platform,
149154
glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT,
150155
&gets.uniform_buffer_offset_alignment);
151156
#endif
157+
CHECK_GL_INIT_ERROR_FOR_OPTIMIZED_BUILD(utils::slog.e)
152158
}
153159

154160
#ifdef BACKEND_OPENGL_VERSION_GLES
@@ -235,6 +241,7 @@ OpenGLContext::OpenGLContext(OpenGLPlatform& platform,
235241
}
236242
#endif
237243
#endif
244+
CHECK_GL_INIT_ERROR_FOR_OPTIMIZED_BUILD(utils::slog.e)
238245

239246
// in practice KHR_Debug has never been useful, and actually is confusing. We keep this
240247
// only for our own debugging, in case we need it some day.
@@ -269,6 +276,7 @@ OpenGLContext::OpenGLContext(OpenGLPlatform& platform,
269276
glDebugMessageCallback(cb, nullptr);
270277
}
271278
#endif
279+
CHECK_GL_INIT_ERROR_FOR_OPTIMIZED_BUILD(utils::slog.e)
272280

273281
mTimerQueryFactory = TimerQueryFactory::init(platform, *this);
274282
}
@@ -384,6 +392,8 @@ void OpenGLContext::setDefaultState() noexcept {
384392
glEnable(GL_CLIP_DISTANCE0);
385393
glEnable(GL_CLIP_DISTANCE1);
386394
}
395+
396+
CHECK_GL_INIT_ERROR_FOR_OPTIMIZED_BUILD(utils::slog.e)
387397
}
388398

389399

@@ -761,6 +771,8 @@ void OpenGLContext::initExtensionsGLES(Extensions* ext, GLint major, GLint minor
761771
ext->EXT_discard_framebuffer = true;
762772
ext->OES_vertex_array_object = true;
763773
}
774+
775+
CHECK_GL_INIT_ERROR_FOR_OPTIMIZED_BUILD(utils::slog.e)
764776
}
765777

766778
#endif // BACKEND_OPENGL_VERSION_GLES
@@ -831,6 +843,8 @@ void OpenGLContext::initExtensionsGL(Extensions* ext, GLint major, GLint minor)
831843
if (major > 4 || (major == 4 && minor >= 5)) {
832844
ext->EXT_clip_control = true;
833845
}
846+
847+
CHECK_GL_INIT_ERROR_FOR_OPTIMIZED_BUILD(utils::slog.e)
834848
}
835849

836850
#endif // BACKEND_OPENGL_VERSION_GL

0 commit comments

Comments
 (0)