diff options
author | Campbell Barton <campbellbarton> | 2022-07-26 16:08:40 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-07-26 16:08:40 +0300 |
commit | 6bd38ccbb5e876fa5fcc05fa830c8348c8ad716e (patch) | |
tree | bc03410c738e816710d577ff4875f4de6a0b04ed /intern/cycles | |
parent | bf49e6040caac1e975982375731c348a1fcb11c1 (diff) |
replace GLEW with libepoxytemp-libepoxy
As discussed in https://developer.blender.org/D12034#412258, GLEW should be replaced by libepoxy to enable dynamic loading of OpenGL.
Build:
```sh
make lite debug ninja BUILD_CMAKE_ARGS="-DWITH_GHOST_X11=OFF -DWITH_GHOST_WAYLAND=ON -DWITH_GHOST_WAYLAND_LIBDECOR=ON -DPYTHON_VERSION=3.10" BUILD_DIR="../blender_build"
```
Verify that there are no X11 dependencies any more:
```sh
lddtree ./blender_build/bin/blender
```
and:
```sh
./blender_build/bin/blender
```
should then start a pure Wayland client.
This also works with GLX (`-DWITH_GHOST_X11=ON -DWITH_GHOST_WAYLAND=OFF`).
This has not been tested on other systems (Windows, macOS) as I do not have access to those systems and the build bot does not allow me to trigger experimental builds any more (I get "you need to have role 'any-control'").
Reviewed By: campbellbarton, brecht, jbakker
Differential Revision: https://developer.blender.org/D15291
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/app/CMakeLists.txt | 4 | ||||
-rw-r--r-- | intern/cycles/app/opengl/display_driver.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/app/opengl/shader.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/app/opengl/window.cpp | 3 | ||||
-rw-r--r-- | intern/cycles/blender/CMakeLists.txt | 4 | ||||
-rw-r--r-- | intern/cycles/cmake/external_libs.cmake | 15 | ||||
-rw-r--r-- | intern/cycles/device/CMakeLists.txt | 5 | ||||
-rw-r--r-- | intern/cycles/device/hip/device_impl.cpp | 1 | ||||
-rw-r--r-- | intern/cycles/hydra/CMakeLists.txt | 4 | ||||
-rw-r--r-- | intern/cycles/hydra/display_driver.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/util/CMakeLists.txt | 1 | ||||
-rw-r--r-- | intern/cycles/util/opengl.h | 2 |
12 files changed, 16 insertions, 29 deletions
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt index 6aea962eab5..d46ece55256 100644 --- a/intern/cycles/app/CMakeLists.txt +++ b/intern/cycles/app/CMakeLists.txt @@ -44,8 +44,8 @@ endif() if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) add_definitions(${GL_DEFINITIONS}) - list(APPEND INC_SYS ${GLEW_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS}) - list(APPEND LIB ${CYCLES_GL_LIBRARIES} ${CYCLES_GLEW_LIBRARIES} ${SDL2_LIBRARIES}) + list(APPEND INC_SYS ${Epoxy_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS}) + list(APPEND LIB ${CYCLES_GL_LIBRARIES} ${Epoxy_LIBRARIES} ${SDL2_LIBRARIES}) endif() cycles_external_libraries_append(LIB) diff --git a/intern/cycles/app/opengl/display_driver.cpp b/intern/cycles/app/opengl/display_driver.cpp index 8b99f3b6feb..d9c72c07ae4 100644 --- a/intern/cycles/app/opengl/display_driver.cpp +++ b/intern/cycles/app/opengl/display_driver.cpp @@ -7,8 +7,8 @@ #include "util/log.h" #include "util/string.h" -#include <GL/glew.h> #include <SDL.h> +#include <epoxy/gl.h> CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/app/opengl/shader.cpp b/intern/cycles/app/opengl/shader.cpp index 9db9ea7fce9..4d22fc2b763 100644 --- a/intern/cycles/app/opengl/shader.cpp +++ b/intern/cycles/app/opengl/shader.cpp @@ -6,7 +6,7 @@ #include "util/log.h" #include "util/string.h" -#include <GL/glew.h> +#include <epoxy/gl.h> CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/app/opengl/window.cpp b/intern/cycles/app/opengl/window.cpp index 7351ae3eecd..f3352decd08 100644 --- a/intern/cycles/app/opengl/window.cpp +++ b/intern/cycles/app/opengl/window.cpp @@ -11,8 +11,8 @@ #include "util/time.h" #include "util/version.h" -#include <GL/glew.h> #include <SDL.h> +#include <epoxy/gl.h> CCL_NAMESPACE_BEGIN @@ -294,7 +294,6 @@ void window_main_loop(const char *title, SDL_RaiseWindow(V.window); V.gl_context = SDL_GL_CreateContext(V.window); - glewInit(); SDL_GL_MakeCurrent(V.window, nullptr); window_reshape(width, height); diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index 4919b99cfe0..c6f8fc39623 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -3,7 +3,6 @@ set(INC .. - ../../glew-mx ../../guardedalloc ../../mikktspace ../../../source/blender/makesdna @@ -13,8 +12,8 @@ set(INC ) set(INC_SYS + ${Epoxy_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} - ${GLEW_INCLUDE_DIR} ) set(SRC @@ -64,6 +63,7 @@ set(LIB cycles_subd cycles_util + ${Epoxy_LIBRARIES} ${PYTHON_LINKFLAGS} ${PYTHON_LIBRARIES} ) diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index 51830250f2e..bc859d830ba 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -505,26 +505,19 @@ if(CYCLES_STANDALONE_REPOSITORY) endif() ########################################################################### -# GLEW +# Epoxy ########################################################################### if(CYCLES_STANDALONE_REPOSITORY) if((WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) OR WITH_CYCLES_HYDRA_RENDER_DELEGATE) if(MSVC AND EXISTS ${_cycles_lib_dir}) - set(GLEW_LIBRARY "${_cycles_lib_dir}/opengl/lib/glew.lib") - set(GLEW_INCLUDE_DIR "${_cycles_lib_dir}/opengl/include") - add_definitions(-DGLEW_STATIC) + set(Epoxy_LIBRARIES "${_cycles_lib_dir}/epoxy/lib/epoxy.lib") + set(Epoxy_INCLUDE_DIRS "${_cycles_lib_dir}/epoxy/include") else() - find_package(GLEW REQUIRED) + find_package(Epoxy REQUIRED) endif() - - set(CYCLES_GLEW_LIBRARIES ${GLEW_LIBRARY}) endif() -else() - # Workaround for unconventional variable name use in Blender. - set(GLEW_INCLUDE_DIR "${GLEW_INCLUDE_PATH}") - set(CYCLES_GLEW_LIBRARIES bf_intern_glew_mx ${BLENDER_GLEW_LIBRARIES}) endif() ########################################################################### diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt index 6418801c572..71789a76406 100644 --- a/intern/cycles/device/CMakeLists.txt +++ b/intern/cycles/device/CMakeLists.txt @@ -3,12 +3,9 @@ set(INC .. - ../../glew-mx ) -set(INC_SYS - ${GLEW_INCLUDE_DIR} -) +set(INC_SYS ) if(WITH_CYCLES_DEVICE_OPTIX OR WITH_CYCLES_DEVICE_CUDA) if(WITH_CUDA_DYNLOAD) diff --git a/intern/cycles/device/hip/device_impl.cpp b/intern/cycles/device/hip/device_impl.cpp index 82db55ea715..a84f1edd70e 100644 --- a/intern/cycles/device/hip/device_impl.cpp +++ b/intern/cycles/device/hip/device_impl.cpp @@ -16,7 +16,6 @@ # include "util/log.h" # include "util/map.h" # include "util/md5.h" -# include "util/opengl.h" # include "util/path.h" # include "util/string.h" # include "util/system.h" diff --git a/intern/cycles/hydra/CMakeLists.txt b/intern/cycles/hydra/CMakeLists.txt index aa194fb936e..60bb40a0d63 100644 --- a/intern/cycles/hydra/CMakeLists.txt +++ b/intern/cycles/hydra/CMakeLists.txt @@ -10,14 +10,14 @@ set(INC ) set(INC_SYS ${USD_INCLUDE_DIRS} - ${GLEW_INCLUDE_DIR} + ${Epoxy_INCLUDE_DIRS} ) set(LIB cycles_scene cycles_session cycles_graph - ${CYCLES_GLEW_LIBRARIES} + ${Epoxy_LIBRARIES} ) cycles_external_libraries_append(LIB) diff --git a/intern/cycles/hydra/display_driver.cpp b/intern/cycles/hydra/display_driver.cpp index 0c0b577c358..1a989605335 100644 --- a/intern/cycles/hydra/display_driver.cpp +++ b/intern/cycles/hydra/display_driver.cpp @@ -11,7 +11,7 @@ #include "hydra/render_buffer.h" #include "hydra/session.h" -#include <GL/glew.h> +#include <epoxy/gl.h> #include <pxr/imaging/hgiGL/texture.h> HDCYCLES_NAMESPACE_OPEN_SCOPE diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt index fddac1dbbcf..17161f2c37b 100644 --- a/intern/cycles/util/CMakeLists.txt +++ b/intern/cycles/util/CMakeLists.txt @@ -3,7 +3,6 @@ set(INC .. - ../../glew-mx ) set(INC_SYS diff --git a/intern/cycles/util/opengl.h b/intern/cycles/util/opengl.h index 090deb861c4..fefee4ec022 100644 --- a/intern/cycles/util/opengl.h +++ b/intern/cycles/util/opengl.h @@ -7,6 +7,6 @@ /* OpenGL header includes, used everywhere we use OpenGL, to deal with * platform differences in one central place. */ -#include <GL/glew.h> +#include <epoxy/gl.h> #endif /* __UTIL_OPENGL_H__ */ |