diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-02-16 23:19:12 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-02-23 15:35:57 +0300 |
commit | fed61d50c77130bc59849b067d9f7a502908003f (patch) | |
tree | 45490b30746b24809c4b126460913ac5704cf535 /CMakeLists.txt | |
parent | 34479d8b63c9ef04ec14d99647f0c46b676b6ca6 (diff) |
Debug GPU functionality from soc-viewport_fx by Jason Wilkins
patch number D706 with changes:
- WITH_GPU_DEBUG just creates a debug context (and enables the debug messaging
system functions) but leaves the checks we had intact. Old patch
added the debug functionality only if we had the flag on to save some
performance.
Rationale here is that we might not want to recompile blender just to get
the extra information, and having users start blender with a -d flag to
get the extra information is also useful for bug reports. Those checks already
existed and most expensive ones are hidden behind a debug mode check
so performance should not be that bad.
- Did some cleanup of existing functionality:
When things go wrong blender side, just print the error,
don't check for GL errors first.
- Did not port changes needed for GLES to regular glew.h
- Got rid of duplicate or very similar new functionality.
Generally, code is more moving things around/cleanup and should work exactly
as before apart from the debug context, so it's safe to add even now.
It also provides a nice substitute function for glu error descriptions
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 93e34f45854..cdef12cb923 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -403,6 +403,7 @@ option(WITH_GL_EGL "Use the EGL OpenGL system library instead of th option(WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON ) option(WITH_GL_PROFILE_CORE "Support using the OpenGL 3.2+ 'core' profile." OFF) option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF) +option(WITH_GPU_DEBUG "Create a debug OpenGL context (allows inserting custom messages and getting notifications for bad GL use)" OFF) mark_as_advanced( WITH_GLEW_MX @@ -411,6 +412,7 @@ mark_as_advanced( WITH_GL_PROFILE_COMPAT WITH_GL_PROFILE_CORE WITH_GL_PROFILE_ES20 + WITH_GPU_DEBUG ) if(WITH_GL_PROFILE_COMPAT) @@ -2350,6 +2352,10 @@ if(WITH_GL_EGL) list(APPEND GL_DEFINITIONS -DWITH_EGL) endif() +if(WITH_GPU_DEBUG) + list(APPEND GL_DEFINITIONS -DWITH_GPU_DEBUG) +endif() + #----------------------------------------------------------------------------- # Configure OpenMP. if(WITH_OPENMP) @@ -2832,6 +2838,7 @@ if(FIRST_RUN) info_cfg_option(WITH_GL_PROFILE_COMPAT) info_cfg_option(WITH_GL_PROFILE_CORE) info_cfg_option(WITH_GL_PROFILE_ES20) + info_cfg_option(WITH_GPU_DEBUG) if(WIN32) info_cfg_option(WITH_GL_ANGLE) endif() |