From 817d8c6a9921eb85a78b206133d516599ef1d5f9 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 17 Feb 2024 07:22:07 -0500 Subject: [PATCH] Build: Always require EGL All supported platforms now include sufficiently new EGL libraries to build both the EGL back end and the EGL/X11 front end, and the ability to build VirtualGL without those features is not well-tested and is tricky to maintain. The ability to build VirtualGL without EGL will continue to be maintained in the 3.0.x branch on a break/fix basis. Note that this eliminates the ability to build VirtualGL on Solaris. However, we have not officially supported Solaris for quite some time (https://virtualgl.org/Documentation/OSSupport), and the only reason why I have even bothered to test VirtualGL on Solaris is because nVidia continues to release drivers for it. Since the VirtualGL 3.0.x branch is still in the Maintenance support category, all non-disruptive fixes have been back-ported to it from the main (3.1.x) branch (and will continue to be back-ported until VirtualGL 3.2 is released), so the only functional differences between the tip of 3.0.x and the tip of main relate to EGL features that aren't relevant for Solaris. --- BUILDING-win.md | 2 +- BUILDING.md | 5 +- CMakeLists.txt | 6 +-- cmakescripts/BuildPackages.cmake | 4 -- common/rr.h | 2 - demos/CMakeLists.txt | 34 ++++++------ release/deb-control.in | 2 +- release/rpm.spec.in | 16 ++---- server/CMakeLists.txt | 54 +++++++------------ server/TempContext.h | 8 --- server/VirtualDrawable.cpp | 46 ++-------------- server/VirtualDrawable.h | 6 --- server/VirtualPixmap.cpp | 2 - server/VirtualWin.cpp | 12 ----- server/backend.cpp | 90 +++----------------------------- server/dlfaker.c | 2 - server/dlfakerut-test.c | 12 ----- server/dlfakerut.c | 26 --------- server/faker-gl.cpp | 4 -- server/faker-glx.cpp | 2 - server/faker-mapfile.c | 4 -- server/faker-sym.cpp | 10 ---- server/faker-sym.h | 12 ----- server/faker-x11.cpp | 16 ------ server/faker-xcb.cpp | 8 --- server/faker.cpp | 16 ------ server/faker.h | 8 --- server/fakerconfig.cpp | 4 -- server/glxvisual.cpp | 16 ------ server/glxvisual.h | 2 - server/libdeepbindtest.c | 4 -- server/servertest.in | 3 +- 32 files changed, 55 insertions(+), 383 deletions(-) diff --git a/BUILDING-win.md b/BUILDING-win.md index 4ae4fe651..8399ba087 100644 --- a/BUILDING-win.md +++ b/BUILDING-win.md @@ -10,7 +10,7 @@ called "VirtualGL-Utils". Build Requirements ------------------ -- [CMake](http://www.cmake.org) v2.8.12 or later +- [CMake](http://www.cmake.org) v3.10 or later - Microsoft Visual C++ 2005 or later diff --git a/BUILDING.md b/BUILDING.md index c9f51e001..2f54d4dc5 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -5,10 +5,7 @@ Building VirtualGL Build Requirements ------------------ -- [CMake](http://www.cmake.org) v2.8.12 or later - * CMake v3.1 or later is required if building the VirtualGL Faker with the - OpenCL interposer enabled (this is the default on Linux and FreeBSD but can - be changed using the `VGL_FAKEOPENCL` CMake variable.) +- [CMake](http://www.cmake.org) v3.10 or later - libjpeg-turbo SDK v1.2 or later * The libjpeg-turbo SDK binary packages can be downloaded from diff --git a/CMakeLists.txt b/CMakeLists.txt index df796fa28..be0a02b11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,11 +2,7 @@ # SETUP ############################################################################### -cmake_minimum_required(VERSION 2.8.12) -# Shut up CMake 3.1 and later -if(POLICY CMP0053) - cmake_policy(SET CMP0053 NEW) -endif() +cmake_minimum_required(VERSION 3.10) if(WIN32) project(VirtualGL-Utils) diff --git a/cmakescripts/BuildPackages.cmake b/cmakescripts/BuildPackages.cmake index 63b1395e8..186dfb213 100644 --- a/cmakescripts/BuildPackages.cmake +++ b/cmakescripts/BuildPackages.cmake @@ -78,10 +78,6 @@ add_custom_target(srpm pkgscripts/makesrpm SOURCES pkgscripts/makesrpm DEPENDS dist) -set(EGLDEPENDS "") -if(VGL_EGLBACKEND) - set(EGLDEPENDS ", libegl1:${DEBARCH}") -endif() configure_file(release/makedpkg.in pkgscripts/makedpkg) configure_file(release/deb-control.in pkgscripts/deb-control) diff --git a/common/rr.h b/common/rr.h index 2b4b6fcdf..309a2ca26 100644 --- a/common/rr.h +++ b/common/rr.h @@ -159,10 +159,8 @@ typedef struct _FakerConfig char defaultfbconfig[MAXSTR]; char dlsymloader; char egl; - #ifdef EGLBACKEND char egllib[MAXSTR]; char eglxIgnorePixmapBit; - #endif double flushdelay; int forcealpha; double fps; diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index adfc5a413..9c88ae1f2 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -19,17 +19,15 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") endif() install(TARGETS glxinfo DESTINATION ${CMAKE_INSTALL_BINDIR}) -if(VGL_EGLBACKEND) - add_executable(eglinfo eglinfo.c glinfo_common.c) - target_link_libraries(eglinfo ${OPENGL_gl_LIBRARY} ${OPENGL_egl_LIBRARY}) - install(TARGETS eglinfo DESTINATION ${CMAKE_INSTALL_BINDIR}) +add_executable(eglinfo eglinfo.c glinfo_common.c) +target_link_libraries(eglinfo ${OPENGL_gl_LIBRARY} ${OPENGL_egl_LIBRARY}) +install(TARGETS eglinfo DESTINATION ${CMAKE_INSTALL_BINDIR}) - add_executable(eglxinfo eglinfo.c glinfo_common.c) - target_compile_definitions(eglxinfo PUBLIC -DEGLX) - target_link_libraries(eglxinfo ${OPENGL_gl_LIBRARY} ${OPENGL_egl_LIBRARY} - ${X11_X11_LIB}) - install(TARGETS eglxinfo DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif() +add_executable(eglxinfo eglinfo.c glinfo_common.c) +target_compile_definitions(eglxinfo PUBLIC -DEGLX) +target_link_libraries(eglxinfo ${OPENGL_gl_LIBRARY} ${OPENGL_egl_LIBRARY} + ${X11_X11_LIB}) +install(TARGETS eglxinfo DESTINATION ${CMAKE_INSTALL_BINDIR}) set(GLXSPHERES glxspheres) if(BITS EQUAL 64) @@ -40,16 +38,14 @@ target_link_libraries(${GLXSPHERES} ${OPENGL_gl_LIBRARY} ${X11_X11_LIB} ${OPENGL_glu_LIBRARY} m) install(TARGETS ${GLXSPHERES} DESTINATION ${CMAKE_INSTALL_BINDIR}) -if(VGL_EGLBACKEND) - set(EGLXSPHERES eglxspheres) - if(BITS EQUAL 64) - set(EGLXSPHERES eglxspheres64) - endif() - add_executable(${EGLXSPHERES} eglxspheres.c xfonts.c) - target_link_libraries(${EGLXSPHERES} ${OPENGL_gl_LIBRARY} ${OPENGL_egl_LIBRARY} - ${X11_X11_LIB} ${OPENGL_glu_LIBRARY} m) - install(TARGETS ${EGLXSPHERES} DESTINATION ${CMAKE_INSTALL_BINDIR}) +set(EGLXSPHERES eglxspheres) +if(BITS EQUAL 64) + set(EGLXSPHERES eglxspheres64) endif() +add_executable(${EGLXSPHERES} eglxspheres.c xfonts.c) +target_link_libraries(${EGLXSPHERES} ${OPENGL_gl_LIBRARY} ${OPENGL_egl_LIBRARY} + ${X11_X11_LIB} ${OPENGL_glu_LIBRARY} m) +install(TARGETS ${EGLXSPHERES} DESTINATION ${CMAKE_INSTALL_BINDIR}) foreach(program pbdemo) add_executable(${program} ${program}.c pbutil.c) diff --git a/release/deb-control.in b/release/deb-control.in index bfd724799..a00c246e9 100644 --- a/release/deb-control.in +++ b/release/deb-control.in @@ -7,7 +7,7 @@ Essential: no Maintainer: @PKGVENDOR@ <@PKGEMAIL@> Homepage: @PKGURL@ Installed-Size: {__SIZE} -Depends: libxtst6:@DEBARCH@, libxv1:@DEBARCH@, libglu1-mesa:@DEBARCH@@EGLDEPENDS@ +Depends: libxtst6:@DEBARCH@, libxv1:@DEBARCH@, libglu1-mesa:@DEBARCH@, libegl1:@DEBARCH@ Description: A toolkit for displaying OpenGL applications to thin clients VirtualGL is a toolkit that allows most Linux/Unix OpenGL applications to be remotely displayed with 3D hardware acceleration to thin clients, regardless diff --git a/release/rpm.spec.in b/release/rpm.spec.in index 2c181c576..45ca611fe 100644 --- a/release/rpm.spec.in +++ b/release/rpm.spec.in @@ -44,7 +44,6 @@ # Path under which docs should be installed %define docdir %{_defaultdocdir}/%{name}-%{version} -%define eglbackend @VGL_EGLBACKEND@ %define fakeopencl @VGL_FAKEOPENCL@ Summary: A toolkit for displaying OpenGL applications to thin clients @@ -206,10 +205,8 @@ rm %{_tmppath}/%{name}-%{version}-%{release}-find-requires %{bindir}/tcbench %{bindir}/nettest %{bindir}/cpustat -%if %{eglbackend} - %{bindir}/eglinfo - %{bindir}/eglxinfo -%endif +%{bindir}/eglinfo +%{bindir}/eglxinfo %{bindir}/glxinfo %{bindir}/vglclient %{bindir}/vglconfig @@ -220,15 +217,10 @@ rm %{_tmppath}/%{name}-%{version}-%{release}-find-requires %{bindir}/vglrun %if "%{_bits}" == "64" %{bindir}/glxspheres64 + %{bindir}/eglxspheres64 %else %{bindir}/glxspheres -%endif -%if %{eglbackend} - %if "%{_bits}" == "64" - %{bindir}/eglxspheres64 - %else - %{bindir}/eglxspheres - %endif + %{bindir}/eglxspheres %endif %if "%{bindir}" != "%{_bindir}" && %{binsymlinks} %{_bindir}/vglclient diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 821c287c9..7047a0edc 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -45,24 +45,7 @@ boolean_number(VGL_FAKEOPENCL) boolean_number(VGL_FAKEOPENCL PARENT_SCOPE) report_option(VGL_FAKEOPENCL "OpenCL interposer") if(VGL_FAKEOPENCL) - cmake_minimum_required(VERSION 3.1) include(FindOpenCL) - include_directories(${OpenCL_INCLUDE_DIRS}) -endif() - -set(DEFAULT_VGL_EGLBACKEND 0) -if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - set(DEFAULT_VGL_EGLBACKEND 1) -endif() -option(VGL_EGLBACKEND "Include the EGL back end, which allows the VirtualGL Faker to be used without a 3D X server" - ${DEFAULT_VGL_EGLBACKEND}) -boolean_number(VGL_EGLBACKEND) -boolean_number(VGL_EGLBACKEND PARENT_SCOPE) -report_option(VGL_EGLBACKEND "EGL back end") -if(VGL_EGLBACKEND) - cmake_minimum_required(VERSION 3.10) - set(EGL_LIBRARY ${OPENGL_egl_LIBRARY}) - add_definitions(-DEGLBACKEND) endif() get_directory_property(DEFS_PROP COMPILE_DEFINITIONS) @@ -104,7 +87,13 @@ endif() set(FAKER_SOURCES backend.cpp ContextHash.cpp + ContextHashEGL.cpp + EGLXDisplayHash.cpp + EGLXVirtualWin.cpp + EGLXWindowHash.cpp + FakePbuffer.cpp faker.cpp + faker-egl.cpp faker-gl.cpp faker-glx.cpp faker-sym.cpp @@ -114,7 +103,9 @@ set(FAKER_SOURCES GlobalCriticalSection.cpp GLXDrawableHash.cpp glxvisual.cpp + PbufferHashEGL.cpp PixmapHash.cpp + RBOContext.cpp TransPlugin.cpp VirtualDrawable.cpp VirtualPixmap.cpp @@ -127,15 +118,6 @@ set(FAKER_SOURCES if(VGL_USEXV) set(FAKER_SOURCES ${FAKER_SOURCES};XVTrans.cpp) endif() -if(VGL_EGLBACKEND) - # EGL back end - set(FAKER_SOURCES - ${FAKER_SOURCES};ContextHashEGL.cpp;FakePbuffer.cpp;PbufferHashEGL.cpp;RBOContext.cpp) - # EGL front end - set(FAKER_SOURCES - ${FAKER_SOURCES};faker-egl.cpp;EGLXDisplayHash.cpp;EGLXVirtualWin.cpp; - EGLXWindowHash.cpp) -endif() set(FAKERLIBS ${VGL_FAKER_NAME};${VGL_FAKER_NAME}-nodl) if(VGL_FAKEOPENCL) @@ -170,10 +152,12 @@ foreach(fakerlib ${FAKERLIBS}) target_link_libraries(${fakerlib} vglcommon ${FBXFAKERLIB} vglsocket m ${LIBDL}) if(${fakerlib} STREQUAL ${VGL_FAKER_NAME}) - target_link_libraries(${fakerlib} ${OPENGL_gl_LIBRARY} ${EGL_LIBRARY}) + target_link_libraries(${fakerlib} ${OPENGL_gl_LIBRARY} + ${OPENGL_egl_LIBRARY}) endif() if(${fakerlib} STREQUAL ${VGL_FAKER_NAME}-opencl) - target_link_libraries(${fakerlib} ${OPENGL_gl_LIBRARY} ${EGL_LIBRARY} ${OpenCL_LIBRARIES}) + target_link_libraries(${fakerlib} ${OPENGL_gl_LIBRARY} + ${OPENGL_egl_LIBRARY} OpenCL::OpenCL) endif() if(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND GNUCXX) # For some reason, on SunOS/GCC CMake tries to use the C compiler to link @@ -249,10 +233,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") add_library(deepbindtest SHARED libdeepbindtest.c) if(VGL_FAKEOPENCL) target_compile_definitions(deepbindtest PUBLIC -DFAKEOPENCL) - target_link_libraries(deepbindtest ${OpenCL_LIBRARIES}) + target_link_libraries(deepbindtest OpenCL::OpenCL) endif() target_link_libraries(deepbindtest ${X11_X11_LIB} ${OPENGL_gl_LIBRARY} - ${EGL_LIBRARY} ${LIBDL}) + ${OPENGL_egl_LIBRARY} ${LIBDL}) set_target_properties(deepbindtest PROPERTIES LINK_FLAGS "${MINUSZ}defs") endif() @@ -266,12 +250,10 @@ target_link_libraries(fakerut "${MINUSZ}now ${OPENGL_gl_LIBRARY}" ${OPENGL_glu_LIBRARY} "${MINUSZ}now ${X11_X11_LIB}" ${LIBDL} vglutil ${XCB_XCB_LIB} ${XCB_GLX_LIB} ${X11_XCB_LIB}) -if(VGL_EGLBACKEND) - add_executable(eglxfakerut eglxfakerut.cpp) - target_link_libraries(eglxfakerut "${MINUSZ}now ${OPENGL_gl_LIBRARY}" - "${MINUSZ}now ${X11_X11_LIB}" "${MINUSZ}now ${EGL_LIBRARY}" ${LIBDL} - vglutil) -endif() +add_executable(eglxfakerut eglxfakerut.cpp) +target_link_libraries(eglxfakerut "${MINUSZ}now ${OPENGL_gl_LIBRARY}" + "${MINUSZ}now ${X11_X11_LIB}" "${MINUSZ}now ${OPENGL_egl_LIBRARY}" ${LIBDL} + vglutil) add_library(vgltrans_test SHARED testplugin.cpp VGLTrans.cpp) unset(VGLTRANS_TEST_LINK_FLAGS) diff --git a/server/TempContext.h b/server/TempContext.h index 58a87132e..66aa68482 100644 --- a/server/TempContext.h +++ b/server/TempContext.h @@ -33,7 +33,6 @@ namespace faker GLXContext ctx, bool eglx_ = false) : dpy(dpy_), ctxChanged(false), eglx(eglx_) { - #ifdef EGLBACKEND if(eglx) { oldctx = (GLXContext)_eglGetCurrentContext(); @@ -42,7 +41,6 @@ namespace faker oldapi = _eglQueryAPI(); } else - #endif { oldctx = backend::getCurrentContext(); oldread = backend::getCurrentReadDrawable(); @@ -53,7 +51,6 @@ namespace faker if((read || draw) && (oldread != read || olddraw != draw || oldctx != ctx)) { - #ifdef EGLBACKEND if(eglx) { _eglBindAPI(EGL_OPENGL_API); @@ -62,7 +59,6 @@ namespace faker THROW("Could not bind OpenGL context to window (window may have disappeared)"); } else - #endif { if(!backend::makeCurrent(dpy, draw, read, ctx)) THROW("Could not bind OpenGL context to window (window may have disappeared)"); @@ -81,7 +77,6 @@ namespace faker { if(ctxChanged) { - #ifdef EGLBACKEND if(eglx) { _eglMakeCurrent((EGLDisplay)dpy, (EGLSurface)olddraw, @@ -89,7 +84,6 @@ namespace faker if(oldapi != EGL_NONE) _eglBindAPI(oldapi); } else - #endif backend::makeCurrent(dpy, olddraw, oldread, oldctx); ctxChanged = false; } @@ -100,9 +94,7 @@ namespace faker Display *dpy; GLXContext oldctx; GLXDrawable oldread, olddraw; - #ifdef EGLBACKEND EGLenum oldapi; - #endif bool ctxChanged; bool eglx; }; diff --git a/server/VirtualDrawable.cpp b/server/VirtualDrawable.cpp index 26441e8ee..d7b64432e 100644 --- a/server/VirtualDrawable.cpp +++ b/server/VirtualDrawable.cpp @@ -1,6 +1,6 @@ // Copyright (C)2004 Landmark Graphics Corporation // Copyright (C)2005, 2006 Sun Microsystems, Inc. -// Copyright (C)2009-2015, 2017-2021 D. R. Commander +// Copyright (C)2009-2015, 2017-2021, 2024 D. R. Commander // // This library is free software and may be redistributed and/or modified under // the terms of the wxWindows Library License, Version 3.1 or (at your option) @@ -50,15 +50,11 @@ static Window create_window(Display *dpy, XVisualInfo *vis, int width, VirtualDrawable::OGLDrawable::OGLDrawable(Display *dpy_, int width_, int height_, VGLFBConfig config_) : cleared(false), stereo(false), - glxDraw(0), dpy(dpy_), width(width_), height(height_), depth(0), - config(config_), glFormat(0), pm(0), win(0), isPixmap(false) + glxDraw(0), dpy(dpy_), edpy(EGL_NO_DISPLAY), width(width_), height(height_), + depth(0), config(config_), glFormat(0), pm(0), win(0), isPixmap(false) { if(!config_ || width_ < 1 || height_ < 1) THROW("Invalid argument"); - #ifdef EGLBACKEND - edpy = EGL_NO_DISPLAY; - #endif - int pbattribs[] = { GLX_PBUFFER_WIDTH, width, GLX_PBUFFER_HEIGHT, height, GLX_PRESERVED_CONTENTS, True, None }; glxDraw = backend::createPbuffer(dpy, config, pbattribs); @@ -70,8 +66,6 @@ VirtualDrawable::OGLDrawable::OGLDrawable(Display *dpy_, int width_, // EGL Pbuffer constructor -#ifdef EGLBACKEND - VirtualDrawable::OGLDrawable::OGLDrawable(EGLDisplay edpy_, int width_, int height_, EGLConfig config_, const EGLint *pbAttribs_) : cleared(false), stereo(false), glxDraw(0), dpy(NULL), edpy(edpy_), width(width_), @@ -97,23 +91,17 @@ VirtualDrawable::OGLDrawable::OGLDrawable(EGLDisplay edpy_, int width_, setVisAttribs(); } -#endif - // Pixmap constructor VirtualDrawable::OGLDrawable::OGLDrawable(int width_, int height_, int depth_, VGLFBConfig config_, const int *attribs) : cleared(false), stereo(false), - glxDraw(0), width(width_), height(height_), depth(depth_), config(config_), - glFormat(0), pm(0), win(0), isPixmap(true) + glxDraw(0), edpy(EGL_NO_DISPLAY), width(width_), height(height_), + depth(depth_), config(config_), glFormat(0), pm(0), win(0), isPixmap(true) { if(!config_ || width_ < 1 || height_ < 1 || depth_ < 0) THROW("Invalid argument"); - #ifdef EGLBACKEND - edpy = EGL_NO_DISPLAY; - #endif - XVisualInfo *vis = NULL; if((vis = _glXGetVisualFromFBConfig(DPY3D, GLXFBC(config))) == NULL) goto bailout; @@ -139,7 +127,6 @@ void VirtualDrawable::OGLDrawable::setVisAttribs(void) { int pixelsize; - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) { EGLint redSize, greenSize, blueSize, alphaSize; @@ -158,7 +145,6 @@ void VirtualDrawable::OGLDrawable::setVisAttribs(void) pixelsize = rgbSize + alphaSize; } else - #endif { if(glxvisual::getFBConfigAttrib(dpy, config, GLX_STEREO)) stereo = true; @@ -196,11 +182,9 @@ VirtualDrawable::OGLDrawable::~OGLDrawable(void) } else { - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) _eglDestroySurface(edpy, (EGLSurface)glxDraw); else - #endif backend::destroyPbuffer(dpy, glxDraw); glxDraw = 0; } @@ -221,9 +205,7 @@ void VirtualDrawable::OGLDrawable::clear(void) void VirtualDrawable::OGLDrawable::swap(void) { - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) return; - #endif if(isPixmap) _glXSwapBuffers(DPY3D, glxDraw); else @@ -239,9 +221,7 @@ VirtualDrawable::VirtualDrawable(Display *dpy_, Drawable x11Draw_) if(!dpy_ || !x11Draw_) THROW("Invalid argument"); dpy = dpy_; x11Draw = x11Draw_; - #ifdef EGLBACKEND edpy = EGL_NO_DISPLAY; - #endif oglDraw = NULL; profReadback.setName("Readback "); autotestFrameCount = 0; @@ -264,11 +244,9 @@ VirtualDrawable::~VirtualDrawable(void) delete oglDraw; oglDraw = NULL; if(ctx) { - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) _eglDestroyContext(edpy, (EGLContext)ctx); else - #endif backend::destroyContext(dpy, ctx); ctx = 0; } @@ -280,10 +258,8 @@ int VirtualDrawable::init(int width, int height, VGLFBConfig config_) { if(!config_ || width < 1 || height < 1) THROW("Invalid argument"); - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) THROW("VirtualDrawable::init() method not supported with EGL/X11"); - #endif CriticalSection::SafeLock l(mutex); if(oglDraw && oglDraw->getWidth() == width && oglDraw->getHeight() == height @@ -301,10 +277,8 @@ int VirtualDrawable::init(int width, int height, VGLFBConfig config_) void VirtualDrawable::setDirect(Bool direct_) { - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) THROW("VirtualDrawable::setDirect() method not supported with EGL/X11"); - #endif if(direct_ != True && direct_ != False) return; CriticalSection::SafeLock l(mutex); @@ -353,7 +327,6 @@ void VirtualDrawable::initReadbackContext(void) { if(!isInit()) THROW("VirtualDrawable instance has not been fully initialized"); - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) { EGLenum api = _eglQueryAPI(); @@ -364,7 +337,6 @@ void VirtualDrawable::initReadbackContext(void) if(api != EGL_NONE) _eglBindAPI(api); } else - #endif { if((ctx = backend::createContext(dpy, config, NULL, direct, NULL)) == 0) THROW("Could not create OpenGL context for readback"); @@ -450,12 +422,8 @@ void VirtualDrawable::readPixels(GLint x, GLint y, GLint width, GLint pitch, if(!checkRenderMode()) return; initReadbackContext(); - #ifdef EGLBACKEND TempContext tc(edpy != EGL_NO_DISPLAY ? (Display *)edpy : dpy, getGLXDrawable(), getGLXDrawable(), ctx, edpy != EGL_NO_DISPLAY); - #else - TempContext tc(dpy, getGLXDrawable(), getGLXDrawable(), ctx); - #endif backend::readBuffer(readBuf); @@ -589,12 +557,8 @@ void VirtualDrawable::copyPixels(GLint srcX, GLint srcY, GLint width, GLint drawBuf) { initReadbackContext(); - #ifdef EGLBACKEND TempContext tc(edpy != EGL_NO_DISPLAY ? (Display *)edpy : dpy, draw, getGLXDrawable(), ctx, edpy != EGL_NO_DISPLAY); - #else - TempContext tc(dpy, draw, getGLXDrawable(), ctx); - #endif backend::readBuffer(readBuf); backend::drawBuffer(drawBuf); diff --git a/server/VirtualDrawable.h b/server/VirtualDrawable.h index 87e75c5d0..5614d476b 100644 --- a/server/VirtualDrawable.h +++ b/server/VirtualDrawable.h @@ -55,10 +55,8 @@ namespace faker OGLDrawable(Display *dpy, int width, int height, VGLFBConfig config); OGLDrawable(int width, int height, int depth, VGLFBConfig config, const int *attribs); - #ifdef EGLBACKEND OGLDrawable(EGLDisplay edpy, int width, int height, EGLConfig config, const EGLint *pbAttribs); - #endif ~OGLDrawable(void); GLXDrawable getGLXDrawable(void) { return glxDraw; } @@ -85,9 +83,7 @@ namespace faker bool cleared, stereo; GLXDrawable glxDraw; Display *dpy; - #ifdef EGLBACKEND EGLDisplay edpy; - #endif int width, height, depth, rgbSize; VGLFBConfig config; GLenum glFormat; @@ -103,9 +99,7 @@ namespace faker util::CriticalSection mutex; Display *dpy; Drawable x11Draw; - #ifdef EGLBACKEND EGLDisplay edpy; - #endif OGLDrawable *oglDraw; VGLFBConfig config; GLXContext ctx; Bool direct; diff --git a/server/VirtualPixmap.cpp b/server/VirtualPixmap.cpp index cf37f2e24..99adfacd8 100644 --- a/server/VirtualPixmap.cpp +++ b/server/VirtualPixmap.cpp @@ -46,11 +46,9 @@ int VirtualPixmap::init(int width, int height, int depth, VGLFBConfig config_, && oglDraw->getDepth() == depth && FBCID(oglDraw->getFBConfig()) == FBCID(config_)) return 0; - #ifdef EGLBACKEND if(fconfig.egl) oglDraw = new OGLDrawable(dpy, width, height, config_); else - #endif oglDraw = new OGLDrawable(width, height, depth, config_, attribs); if(config && FBCID(config_) != FBCID(config) && ctx) { diff --git a/server/VirtualWin.cpp b/server/VirtualWin.cpp index a2712a312..aba5b35bb 100644 --- a/server/VirtualWin.cpp +++ b/server/VirtualWin.cpp @@ -81,9 +81,7 @@ VirtualWin::VirtualWin(Display *dpy_, Window win) : win); } stereoVisual = false; - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) - #endif stereoVisual = glxvisual::visAttrib(dpy, DefaultScreen(dpy), xwa.visual->visualid, GLX_STEREO); } @@ -173,10 +171,8 @@ void VirtualWin::cleanup(void) void VirtualWin::initFromWindow(VGLFBConfig config_) { - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) THROW("VirtualWin::initFromWindow() method not supported with EGL/X11"); - #endif XSync(dpy, False); XWindowAttributes xwa; @@ -217,10 +213,8 @@ void VirtualWin::checkResize(void) GLXDrawable VirtualWin::updateGLXDrawable(void) { - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) THROW("VirtualWin::updateGLXDrawable() method not supported with EGL/X11"); - #endif GLXDrawable retval = 0; CriticalSection::SafeLock l(mutex); @@ -244,10 +238,8 @@ GLXDrawable VirtualWin::updateGLXDrawable(void) void VirtualWin::swapBuffers(void) { - #ifdef EGLBACKEND if(edpy != EGL_NO_DISPLAY) THROW("VirtualWin::swapBuffers() method not supported with EGL/X11"); - #endif CriticalSection::SafeLock l(mutex); if(deletedByWM) THROW("Window has been deleted by window manager"); @@ -388,12 +380,8 @@ TempContext *VirtualWin::setupPluginTempContext(GLint drawBuf) else { initReadbackContext(); - #ifdef EGLBACKEND tc = new TempContext(edpy != EGL_NO_DISPLAY ? (Display *)edpy : dpy, getGLXDrawable(), getGLXDrawable(), ctx, edpy != EGL_NO_DISPLAY); - #else - tc = new TempContext(dpy, getGLXDrawable(), getGLXDrawable(), ctx); - #endif backend::readBuffer(drawBuf); } diff --git a/server/backend.cpp b/server/backend.cpp index cb34cdd6d..fc1147ad4 100644 --- a/server/backend.cpp +++ b/server/backend.cpp @@ -11,12 +11,10 @@ // wxWindows Library License for more details. #include "backend.h" -#ifdef EGLBACKEND #include "ContextHashEGL.h" #include "PbufferHashEGL.h" #include "EGLError.h" #include "BufferState.h" -#endif #include "PixmapHash.h" #include "glxvisual.h" #include "threadlocal.h" @@ -30,8 +28,6 @@ namespace backend { -#ifdef EGLBACKEND - #define CATCH_EGL(minorCode) \ catch(EGLError &e) \ { \ @@ -68,12 +64,9 @@ static FakePbuffer *getCurrentFakePbuffer(EGLint readdraw) return NULL; } -#endif - void bindFramebuffer(GLenum target, GLuint framebuffer, bool ext) { - #ifdef EGLBACKEND const GLenum *oldDrawBufs = NULL; GLsizei nDrawBufs = 0; GLenum oldReadBuf = GL_NONE; FakePbuffer *drawpb = NULL, *readpb = NULL; @@ -112,10 +105,8 @@ void bindFramebuffer(GLenum target, GLuint framebuffer, bool ext) CTXHASHEGL.setReadFBO(_eglGetCurrentContext(), framebuffer); } } - #endif if(ext) _glBindFramebufferEXT(target, framebuffer); else _glBindFramebuffer(target, framebuffer); - #ifdef EGLBACKEND if(fconfig.egl) { if(oldDrawBufs) @@ -128,13 +119,11 @@ void bindFramebuffer(GLenum target, GLuint framebuffer, bool ext) } if(oldReadBuf) readpb->setReadBuffer(oldReadBuf, false); } - #endif } void deleteFramebuffers(GLsizei n, const GLuint *framebuffers) { - #ifdef EGLBACKEND if(fconfig.egl) { if(n > 0 && framebuffers) @@ -151,7 +140,6 @@ void deleteFramebuffers(GLsizei n, const GLuint *framebuffers) } } } - #endif _glDeleteFramebuffers(n, framebuffers); } @@ -159,7 +147,6 @@ void deleteFramebuffers(GLsizei n, const GLuint *framebuffers) GLXContext createContext(Display *dpy, VGLFBConfig config, GLXContext share, Bool direct, const int *glxAttribs) { - #ifdef EGLBACKEND if(fconfig.egl) { if(!direct) return NULL; @@ -296,7 +283,6 @@ GLXContext createContext(Display *dpy, VGLFBConfig config, GLXContext share, return 0; } else - #endif { if(glxAttribs && glxAttribs[0] != None) return _glXCreateContextAttribsARB(DPY3D, GLXFBC(config), share, direct, @@ -311,7 +297,6 @@ GLXContext createContext(Display *dpy, VGLFBConfig config, GLXContext share, GLXPbuffer createPbuffer(Display *dpy, VGLFBConfig config, const int *glxAttribs) { - #ifdef EGLBACKEND if(fconfig.egl) { try @@ -324,15 +309,12 @@ GLXPbuffer createPbuffer(Display *dpy, VGLFBConfig config, CATCH_EGL(X_GLXCreatePbuffer) return 0; } - else - #endif - return _glXCreatePbuffer(DPY3D, GLXFBC(config), glxAttribs); + else return _glXCreatePbuffer(DPY3D, GLXFBC(config), glxAttribs); } void destroyContext(Display *dpy, GLXContext ctx) { - #ifdef EGLBACKEND if(fconfig.egl) { try @@ -350,15 +332,12 @@ void destroyContext(Display *dpy, GLXContext ctx) } CATCH_EGL(X_GLXDestroyContext) } - else - #endif - _glXDestroyContext(DPY3D, ctx); + else _glXDestroyContext(DPY3D, ctx); } void destroyPbuffer(Display *dpy, GLXPbuffer pbuf) { - #ifdef EGLBACKEND if(fconfig.egl) { try @@ -367,15 +346,12 @@ void destroyPbuffer(Display *dpy, GLXPbuffer pbuf) } CATCH_EGL(X_GLXDestroyPbuffer) } - else - #endif - _glXDestroyPbuffer(DPY3D, pbuf); + else _glXDestroyPbuffer(DPY3D, pbuf); } void drawBuffer(GLenum mode) { - #ifdef EGLBACKEND if(fconfig.egl) { FakePbuffer *pb = getCurrentFakePbuffer(EGL_DRAW); @@ -385,14 +361,12 @@ void drawBuffer(GLenum mode) return; } } - #endif _glDrawBuffer(mode); } void drawBuffers(GLsizei n, const GLenum *bufs) { - #ifdef EGLBACKEND if(fconfig.egl) { FakePbuffer *pb = getCurrentFakePbuffer(EGL_DRAW); @@ -402,54 +376,44 @@ void drawBuffers(GLsizei n, const GLenum *bufs) return; } } - #endif _glDrawBuffers(n, bufs); } GLXContext getCurrentContext(void) { - #ifdef EGLBACKEND if(fconfig.egl) return getCurrentContextEGL(); else - #endif return _glXGetCurrentContext(); } Display *getCurrentDisplay(void) { - #ifdef EGLBACKEND if(fconfig.egl) { FakePbuffer *pb = PBHASHEGL.find(getCurrentDrawableEGL()); return pb ? pb->getDisplay() : NULL; } - else - #endif - return _glXGetCurrentDisplay(); + else return _glXGetCurrentDisplay(); } GLXDrawable getCurrentDrawable(void) { - #ifdef EGLBACKEND if(fconfig.egl) return getCurrentDrawableEGL(); else - #endif return _glXGetCurrentDrawable(); } GLXDrawable getCurrentReadDrawable(void) { - #ifdef EGLBACKEND if(fconfig.egl) return getCurrentReadDrawableEGL(); else - #endif return _glXGetCurrentReadDrawable(); } @@ -457,7 +421,6 @@ GLXDrawable getCurrentReadDrawable(void) int getFBConfigAttrib(Display *dpy, VGLFBConfig config, int attribute, int *value) { - #ifdef EGLBACKEND if(fconfig.egl) { if(!value) return GLX_BAD_VALUE; @@ -564,16 +527,13 @@ int getFBConfigAttrib(Display *dpy, VGLFBConfig config, int attribute, return GLX_BAD_ATTRIBUTE; } } // fconfig.egl - else - #endif - return _glXGetFBConfigAttrib(DPY3D, GLXFBC(config), attribute, value); + else return _glXGetFBConfigAttrib(DPY3D, GLXFBC(config), attribute, value); } void getFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) { - #ifdef EGLBACKEND bool isDefault = false; if(fconfig.egl) @@ -625,21 +585,17 @@ void getFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, } } } - #endif _glGetFramebufferAttachmentParameteriv(target, attachment, pname, params); - #ifdef EGLBACKEND if(fconfig.egl) { if(isDefault && *params == GL_RENDERBUFFER) *params = GL_FRAMEBUFFER_DEFAULT; } - #endif } void getFramebufferParameteriv(GLenum target, GLenum pname, GLint *params) { - #ifdef EGLBACKEND if(fconfig.egl) { if(!params) @@ -665,14 +621,12 @@ void getFramebufferParameteriv(GLenum target, GLenum pname, GLint *params) } } } - #endif _glGetFramebufferParameteriv(target, pname, params); } void getIntegerv(GLenum pname, GLint *params) { - #ifdef EGLBACKEND if(fconfig.egl) { if(!_eglBindAPI(EGL_OPENGL_API)) @@ -751,7 +705,6 @@ void getIntegerv(GLenum pname, GLint *params) } } } - #endif _glGetIntegerv(pname, params); } @@ -759,7 +712,6 @@ void getIntegerv(GLenum pname, GLint *params) void getNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname, GLint *param) { - #ifdef EGLBACKEND if(fconfig.egl) { if(!param) @@ -784,18 +736,15 @@ void getNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname, else framebuffer = pb->getFBO(); } } - #endif _glGetNamedFramebufferParameteriv(framebuffer, pname, param); } Bool isDirect(GLXContext ctx) { - #ifdef EGLBACKEND if(fconfig.egl) return True; else - #endif return _glXIsDirect(DPY3D, ctx); } @@ -803,7 +752,6 @@ Bool isDirect(GLXContext ctx) Bool makeCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) { - #ifdef EGLBACKEND if(fconfig.egl) { try @@ -886,15 +834,12 @@ Bool makeCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, CATCH_EGL(X_GLXMakeContextCurrent) return 0; } - else - #endif - return _glXMakeContextCurrent(DPY3D, draw, read, ctx); + else return _glXMakeContextCurrent(DPY3D, draw, read, ctx); } void namedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf, bool ext) { - #ifdef EGLBACKEND if(fconfig.egl) { FakePbuffer *pb; @@ -905,7 +850,6 @@ void namedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf, bool ext) return; } } - #endif if(ext) _glFramebufferDrawBufferEXT(framebuffer, buf); else _glNamedFramebufferDrawBuffer(framebuffer, buf); } @@ -914,7 +858,6 @@ void namedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf, bool ext) void namedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n, const GLenum *bufs, bool ext) { - #ifdef EGLBACKEND if(fconfig.egl) { FakePbuffer *pb; @@ -925,7 +868,6 @@ void namedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n, return; } } - #endif if(ext) _glFramebufferDrawBuffersEXT(framebuffer, n, bufs); else _glNamedFramebufferDrawBuffers(framebuffer, n, bufs); } @@ -933,7 +875,6 @@ void namedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n, void namedFramebufferReadBuffer(GLuint framebuffer, GLenum mode, bool ext) { - #ifdef EGLBACKEND if(fconfig.egl) { FakePbuffer *pb; @@ -944,7 +885,6 @@ void namedFramebufferReadBuffer(GLuint framebuffer, GLenum mode, bool ext) return; } } - #endif if(ext) _glFramebufferReadBufferEXT(framebuffer, mode); else _glNamedFramebufferReadBuffer(framebuffer, mode); } @@ -952,7 +892,6 @@ void namedFramebufferReadBuffer(GLuint framebuffer, GLenum mode, bool ext) int queryContext(Display *dpy, GLXContext ctx, int attribute, int *value) { - #ifdef EGLBACKEND if(fconfig.egl) { int retval = Success; @@ -984,7 +923,6 @@ int queryContext(Display *dpy, GLXContext ctx, int attribute, int *value) return retval; } else - #endif { int retval = _glXQueryContext(DPY3D, ctx, attribute, value); if(fconfig.amdgpuHack && ctx && attribute == GLX_RENDER_TYPE && value @@ -998,7 +936,6 @@ int queryContext(Display *dpy, GLXContext ctx, int attribute, int *value) void queryDrawable(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value) { - #ifdef EGLBACKEND if(fconfig.egl) { FakePbuffer *pb = NULL; @@ -1033,16 +970,13 @@ void queryDrawable(Display *dpy, GLXDrawable draw, int attribute, return; } } - else - #endif - _glXQueryDrawable(DPY3D, draw, attribute, value); + else _glXQueryDrawable(DPY3D, draw, attribute, value); } Bool queryExtension(Display *dpy, int *majorOpcode, int *eventBase, int *errorBase) { - #ifdef EGLBACKEND if(fconfig.egl) { // If the 2D X server has a GLX extension, then we hijack its major opcode @@ -1069,14 +1003,12 @@ Bool queryExtension(Display *dpy, int *majorOpcode, int *eventBase, // When using the GLX back end, all GLX errors will come from the 3D X // server. else - #endif return _XQueryExtension(DPY3D, "GLX", majorOpcode, eventBase, errorBase); } void readBuffer(GLenum mode) { - #ifdef EGLBACKEND if(fconfig.egl) { FakePbuffer *pb = getCurrentFakePbuffer(EGL_READ); @@ -1086,7 +1018,6 @@ void readBuffer(GLenum mode) return; } } - #endif _glReadBuffer(mode); } @@ -1094,7 +1025,6 @@ void readBuffer(GLenum mode) void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *data) { - #ifdef EGLBACKEND if(fconfig.egl) { bool fallthrough = true; @@ -1142,14 +1072,12 @@ void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, } if(!fallthrough) return; } - #endif _glReadPixels(x, y, width, height, format, type, data); } void swapBuffers(Display *dpy, GLXDrawable drawable) { - #ifdef EGLBACKEND if(fconfig.egl) { try @@ -1165,9 +1093,7 @@ void swapBuffers(Display *dpy, GLXDrawable drawable) } CATCH_EGL(X_GLXSwapBuffers) } - else - #endif - _glXSwapBuffers(DPY3D, drawable); + else _glXSwapBuffers(DPY3D, drawable); } } // namespace diff --git a/server/dlfaker.c b/server/dlfaker.c index f01164b69..86192223c 100644 --- a/server/dlfaker.c +++ b/server/dlfaker.c @@ -128,9 +128,7 @@ void *dlopen(const char *filename, int flag) || (!strncmp(filename, "libOpenCL.", 10) && fakeOpenCL) || (strstr(filename, "/libOpenCL.") && fakeOpenCL) #endif - #ifdef EGLBACKEND || !strncmp(filename, "libEGL.", 7) || strstr(filename, "/libEGL.") - #endif || !strncmp(filename, "libX11.", 7) || strstr(filename, "/libX11.") || (flag & RTLD_LAZY && (!strncmp(filename, "libopengl.", 10) diff --git a/server/dlfakerut-test.c b/server/dlfakerut-test.c index 3a45d61a7..a5039a2c7 100644 --- a/server/dlfakerut-test.c +++ b/server/dlfakerut-test.c @@ -15,8 +15,6 @@ #include -#ifdef EGLBACKEND - #define CASE(c) case c: return #c static const char *getEGLErrorString(void) @@ -50,8 +48,6 @@ static const char *getEGLErrorString(void) goto bailout; \ } -#endif - int test(const char *testName, int testOpenCL, int testEGLX); @@ -115,12 +111,10 @@ int test(const char *testName, int testOpenCL, int testEGLX) GLX_GREEN_SIZE, 8, GLX_BLUE_SIZE, 8, None, None }; XVisualInfo *v = NULL; GLXContext ctx = 0; XSetWindowAttributes swa; - #ifdef EGLBACKEND EGLDisplay edpy = 0; EGLContext ectx = 0; EGLSurface surface = 0; EGLint cfgAttribs[] = { EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_NONE }; EGLConfig config = 0; EGLint nc = 0; - #endif #ifdef FAKEOPENCL cl_uint nPlatforms = 0, pi, nDevices = 0, di; cl_context oclctx = 0; @@ -235,8 +229,6 @@ int test(const char *testName, int testOpenCL, int testEGLX) #endif - #ifdef EGLBACKEND - if(testEGLX) { _glXMakeCurrent(dpy, 0, 0); _glXDestroyContext(dpy, ctx); ctx = 0; @@ -263,8 +255,6 @@ int test(const char *testName, int testOpenCL, int testEGLX) TRY(checkWindowColor(dpy, win, 0xff0000)); } - #endif - fprintf(stderr, "SUCCESS\n"); bailout: @@ -277,7 +267,6 @@ int test(const char *testName, int testOpenCL, int testEGLX) { _glXMakeCurrent(dpy, 0, 0); _glXDestroyContext(dpy, ctx); } - #ifdef EGLBACKEND if(edpy) { if(ectx) @@ -290,7 +279,6 @@ int test(const char *testName, int testOpenCL, int testEGLX) } _eglTerminate(edpy); } - #endif if(win && dpy) XDestroyWindow(dpy, win); if(v) XFree(v); if(dpy) XCloseDisplay(dpy); diff --git a/server/dlfakerut.c b/server/dlfakerut.c index 40d957f32..ba1315373 100644 --- a/server/dlfakerut.c +++ b/server/dlfakerut.c @@ -13,9 +13,7 @@ */ #include -#ifdef EGLBACKEND #include -#endif #ifdef FAKEOPENCL #include #endif @@ -68,8 +66,6 @@ _glXMakeCurrentType _glXMakeCurrent = NULL; typedef void (*_glXSwapBuffersType)(Display *, GLXDrawable); _glXSwapBuffersType _glXSwapBuffers = NULL; -#ifdef EGLBACKEND - typedef EGLBoolean (*_eglChooseConfigType)(EGLDisplay, const EGLint *, EGLConfig *, EGLint, EGLint *); _eglChooseConfigType _eglChooseConfig = NULL; @@ -111,8 +107,6 @@ _eglSwapBuffersType _eglSwapBuffers = NULL; typedef EGLBoolean (*_eglTerminateType)(EGLDisplay); _eglTerminateType _eglTerminate = NULL; -#endif - typedef void (*_glClearType)(GLbitfield); _glClearType _glClear = NULL; @@ -151,18 +145,14 @@ _clReleaseContextType _clReleaseContext = NULL; #endif void *glxdllhnd = NULL; -#ifdef EGLBACKEND void *egldllhnd = NULL; -#endif void *gldllhnd = NULL; #ifdef FAKEOPENCL void *ocldllhnd = NULL; #endif int fakeOpenCL = 0, eglx = 0; const char *libGLX = "libGL.so", *libOpenGL = "libGL.so"; -#ifdef EGLBACKEND const char *libEGL = "libEGL.so"; -#endif #define LSYM(dllhnd, s) \ dlerror(); \ @@ -193,8 +183,6 @@ static int loadSymbols1(char *prefix) LSYM(glxdllhnd, glXMakeCurrent); LSYM(glxdllhnd, glXSwapBuffers); - #ifdef EGLBACKEND - if(eglx) { if(prefix) @@ -221,8 +209,6 @@ static int loadSymbols1(char *prefix) LSYM(egldllhnd, eglTerminate); } - #endif - if(prefix) { char temps[256]; @@ -270,9 +256,7 @@ static int loadSymbols1(char *prefix) static void unloadSymbols1(void) { if(glxdllhnd) dlclose(glxdllhnd); - #ifdef EGLBACKEND if(egldllhnd) dlclose(egldllhnd); - #endif if(gldllhnd) dlclose(gldllhnd); #ifdef FAKEOPENCL if(ocldllhnd) dlclose(ocldllhnd); @@ -284,11 +268,9 @@ static void unloadSymbols1(void) _##s = (_##s##Type)_glXGetProcAddressARB((const GLubyte *)#s); \ if(!_##s) THROW("Could not load symbol " #s) -#ifdef EGLBACKEND #define LSYMEGL(s) \ _##s = (_##s##Type)_eglGetProcAddress(#s); \ if(!_##s) THROW("Could not load symbol " #s) -#endif static int loadSymbols2(void) { @@ -304,8 +286,6 @@ static int loadSymbols2(void) LSYMGLX(glClear); LSYMGLX(glClearColor); - #ifdef EGLBACKEND - if(eglx) { LSYM(egldllhnd, eglGetProcAddress); @@ -322,8 +302,6 @@ static int loadSymbols2(void) LSYMEGL(eglTerminate); } - #endif - bailout: return retval; } @@ -402,20 +380,16 @@ int main(int argc, char **argv) libGLX = "libGLX.so"; libOpenGL = "libOpenGL.so"; } - #ifdef EGLBACKEND else if(!strcasecmp(argv[i], "--eglx")) eglx = 1; - #endif } } fprintf(stderr, "GLX library = %s%s%s\n", prefix ? prefix : "", prefix ? "/" : "", libGLX); - #ifdef EGLBACKEND if(eglx) fprintf(stderr, "EGL library = %s%s%s\n", prefix ? prefix : "", prefix ? "/" : "", libEGL); - #endif fprintf(stderr, "OpenGL library = %s%s%s\n", prefix ? prefix : "", prefix ? "/" : "", libOpenGL); diff --git a/server/faker-gl.cpp b/server/faker-gl.cpp index f7eefea7b..ec4c49fa7 100644 --- a/server/faker-gl.cpp +++ b/server/faker-gl.cpp @@ -17,9 +17,7 @@ #include #include "ContextHash.h" #include "WindowHash.h" -#ifdef EGLBACKEND #include "EGLXWindowHash.h" -#endif #include "faker.h" static void doGLReadback(bool spoilLast, bool sync) @@ -865,7 +863,6 @@ void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) TRY(); - #ifdef EGLBACKEND if(faker::getEGLXContextCurrent()) { /////////////////////////////////////////////////////////////////////////// @@ -909,7 +906,6 @@ void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) /////////////////////////////////////////////////////////////////////////// } else - #endif { /////////////////////////////////////////////////////////////////////////// OPENTRACE(glViewport); PRARGI(x); PRARGI(y); PRARGI(width); diff --git a/server/faker-glx.cpp b/server/faker-glx.cpp index cf354aa3f..ecd05f9b7 100644 --- a/server/faker-glx.cpp +++ b/server/faker-glx.cpp @@ -859,7 +859,6 @@ static const char *getGLXExtensions(void) const char *realGLXExtensions = fconfig.egl ? "" : _glXQueryExtensionsString(DPY3D, DefaultScreen(DPY3D)); - #ifdef EGLBACKEND if(fconfig.egl) { faker::init3D(); @@ -871,7 +870,6 @@ static const char *getGLXExtensions(void) return glxextensions; } else - #endif { CHECKSYM_NONFATAL(glXCreateContextAttribsARB) if(__glXCreateContextAttribsARB diff --git a/server/faker-mapfile.c b/server/faker-mapfile.c index 33d1c04a1..e17da3f7b 100644 --- a/server/faker-mapfile.c +++ b/server/faker-mapfile.c @@ -89,8 +89,6 @@ glXQueryGLXPbufferSGIX; glXSelectEventSGIX; - #ifdef EGLBACKEND - /* EGL 1.0 */ eglChooseConfig; eglCopyBuffers; @@ -163,8 +161,6 @@ /* EGL_KHR_wait_sync */ eglWaitSyncKHR; - #endif - /* OpenGL */ glBindFramebuffer; glBindFramebufferEXT; diff --git a/server/faker-sym.cpp b/server/faker-sym.cpp index a3aea5400..a921189dc 100644 --- a/server/faker-sym.cpp +++ b/server/faker-sym.cpp @@ -21,10 +21,8 @@ static void *gldllhnd = NULL; static void *loadGLSymbol(const char *, bool); -#ifdef EGLBACKEND static void *egldllhnd = NULL; static void *loadEGLSymbol(const char *, bool); -#endif #ifdef FAKEOPENCL static void *ocldllhnd = NULL; static void *loadOCLSymbol(const char *, bool); @@ -72,10 +70,8 @@ void *loadSymbol(const char *name, bool optional) } if(!strncmp(name, "gl", 2)) return loadGLSymbol(name, optional); - #ifdef EGLBACKEND else if(!strncmp(name, "egl", 3)) return loadEGLSymbol(name, optional); - #endif #ifdef FAKEOPENCL else if(!strncmp(name, "cl", 2)) return loadOCLSymbol(name, optional); @@ -183,8 +179,6 @@ static void *loadGLSymbol(const char *name, bool optional) } -#ifdef EGLBACKEND - static void *loadEGLSymbol(const char *name, bool optional) { char *err = NULL; @@ -250,8 +244,6 @@ static void *loadEGLSymbol(const char *name, bool optional) return sym; } -#endif - #ifdef FAKEOPENCL @@ -416,9 +408,7 @@ namespace faker { void unloadSymbols(void) { if(gldllhnd && gldllhnd != RTLD_NEXT) dlclose(gldllhnd); - #ifdef EGLBACKEND if(egldllhnd && egldllhnd != RTLD_NEXT) dlclose(egldllhnd); - #endif #ifdef FAKEOPENCL if(ocldllhnd && ocldllhnd != RTLD_NEXT) dlclose(ocldllhnd); #endif diff --git a/server/faker-sym.h b/server/faker-sym.h index 2f47f3ff8..4f3f70da5 100644 --- a/server/faker-sym.h +++ b/server/faker-sym.h @@ -19,11 +19,9 @@ #define GL_GLEXT_PROTOTYPES #define GLX_GLXEXT_PROTOTYPES #include -#ifdef EGLBACKEND #include #define EGL_EGLEXT_PROTOTYPES #include -#endif #ifdef FAKEOPENCL #include #endif @@ -556,9 +554,6 @@ FUNCDEF2(GLXFBConfigSGIX, glXGetFBConfigFromVisualSGIX, Display *, dpy, XVisualInfo *, vis, glXGetFBConfigFromVisualSGIX) -#ifdef EGLBACKEND - - // EGL 1.0 functions FUNCDEF5(EGLBoolean, eglChooseConfig, EGLDisplay, display, @@ -745,9 +740,6 @@ FUNCDEF3(EGLint, eglWaitSyncKHR, EGLDisplay, display, EGLSyncKHR, sync, EGLint, flags, eglWaitSyncKHR) -#endif - - // GL functions VFUNCDEF2(glBindFramebuffer, GLenum, target, GLuint, framebuffer, @@ -1071,8 +1063,6 @@ FUNCDEF1(GLboolean, glUnmapBuffer, GLenum, target, NULL) // EGL functions used by the faker (but not interposed.) -#ifdef EGLBACKEND - FUNCDEF1(EGLBoolean, eglBindAPI, EGLenum, api, NULL) FUNCDEF2(EGLBoolean, eglDestroyContext, EGLDisplay, display, @@ -1088,8 +1078,6 @@ FUNCDEF2(const char *, eglQueryDeviceStringEXT, EGLDeviceEXT, device, EGLint, FUNCDEF0(EGLenum, eglQueryAPI, NULL) -#endif - // We load all XCB functions dynamically, so that the same VirtualGL binary // can be used to support systems with and without XCB libraries. diff --git a/server/faker-x11.cpp b/server/faker-x11.cpp index 8c1b55e2d..4c0a168dd 100644 --- a/server/faker-x11.cpp +++ b/server/faker-x11.cpp @@ -20,9 +20,7 @@ #ifdef FAKEXCB #include "XCBConnHash.h" #endif -#ifdef EGLBACKEND #include "EGLXWindowHash.h" -#endif #include "keycodetokeysym.h" @@ -381,12 +379,10 @@ Status XGetGeometry(Display *dpy, Drawable drawable, Window *root, int *x, if((vw = WINHASH.find(dpy, drawable)) != NULL && width > 0 && height > 0) vw->resize(width, height); - #ifdef EGLBACKEND faker::EGLXVirtualWin *eglxvw; if((eglxvw = EGLXWINHASH.find(dpy, drawable)) != NULL && width > 0 && height > 0) eglxvw->resize(width, height); - #endif ///////////////////////////////////////////////////////////////////////////// STOPTRACE(); if(root) PRARGX(*root); if(x) PRARGI(*x); if(y) PRARGI(*y); @@ -701,9 +697,7 @@ char *XServerVendor(Display *dpy) static void handleEvent(Display *dpy, XEvent *xe) { faker::VirtualWin *vw; - #ifdef EGLBACKEND faker::EGLXVirtualWin *eglxvw; - #endif if(IS_EXCLUDED(dpy)) return; @@ -724,7 +718,6 @@ static void handleEvent(Display *dpy, XEvent *xe) STOPTRACE(); CLOSETRACE(); ///////////////////////////////////////////////////////////////////////// } - #ifdef EGLBACKEND if((eglxvw = EGLXWINHASH.find(dpy, xe->xconfigure.window)) != NULL) { ///////////////////////////////////////////////////////////////////////// @@ -739,7 +732,6 @@ static void handleEvent(Display *dpy, XEvent *xe) STOPTRACE(); CLOSETRACE(); ///////////////////////////////////////////////////////////////////////// } - #endif } else if(xe && xe->type == KeyPress) { @@ -765,10 +757,8 @@ static void handleEvent(Display *dpy, XEvent *xe) { if((vw = WINHASH.find(dpy, cme->window)) != NULL) vw->wmDeleted(); - #ifdef EGLBACKEND if((eglxvw = EGLXWINHASH.find(dpy, cme->window)) != NULL) eglxvw->wmDeleted(); - #endif } } } @@ -847,12 +837,10 @@ int XConfigureWindow(Display *dpy, Window win, unsigned int value_mask, if((vw = WINHASH.find(dpy, win)) != NULL && values) vw->resize(value_mask & CWWidth ? values->width : 0, value_mask & CWHeight ? values->height : 0); - #ifdef EGLBACKEND faker::EGLXVirtualWin *eglxvw; if((eglxvw = EGLXWINHASH.find(dpy, win)) != NULL && values) eglxvw->resize(value_mask & CWWidth ? values->width : 0, value_mask & CWHeight ? values->height : 0); - #endif retval = _XConfigureWindow(dpy, win, value_mask, values); ///////////////////////////////////////////////////////////////////////////// @@ -894,11 +882,9 @@ int XMoveResizeWindow(Display *dpy, Window win, int x, int y, faker::VirtualWin *vw; if((vw = WINHASH.find(dpy, win)) != NULL) vw->resize(width, height); - #ifdef EGLBACKEND faker::EGLXVirtualWin *eglxvw; if((eglxvw = EGLXWINHASH.find(dpy, win)) != NULL) eglxvw->resize(width, height); - #endif retval = _XMoveResizeWindow(dpy, win, x, y, width, height); ///////////////////////////////////////////////////////////////////////////// @@ -940,11 +926,9 @@ int XResizeWindow(Display *dpy, Window win, unsigned int width, faker::VirtualWin *vw; if((vw = WINHASH.find(dpy, win)) != NULL) vw->resize(width, height); - #ifdef EGLBACKEND faker::EGLXVirtualWin *eglxvw; if((eglxvw = EGLXWINHASH.find(dpy, win)) != NULL) eglxvw->resize(width, height); - #endif retval = _XResizeWindow(dpy, win, width, height); ///////////////////////////////////////////////////////////////////////////// diff --git a/server/faker-xcb.cpp b/server/faker-xcb.cpp index de99e7c17..6d875604b 100644 --- a/server/faker-xcb.cpp +++ b/server/faker-xcb.cpp @@ -14,10 +14,8 @@ #include "WindowHash.h" #include "XCBConnHash.h" -#ifdef EGLBACKEND #include "EGLXDisplayHash.h" #include "EGLXWindowHash.h" -#endif #include "faker.h" #include "vglconfigLauncher.h" @@ -428,9 +426,7 @@ xcb_glx_query_version_reply_t * static void handleXCBEvent(xcb_connection_t *conn, xcb_generic_event_t *ev) { faker::VirtualWin *vw = NULL; - #ifdef EGLBACKEND faker::EGLXVirtualWin *eglxvw; - #endif if(!ev || faker::deadYet || !fconfig.fakeXCB || faker::getFakerLevel() > 0) return; @@ -457,7 +453,6 @@ static void handleXCBEvent(xcb_connection_t *conn, xcb_generic_event_t *ev) STOPTRACE(); CLOSETRACE(); /////////////////////////////////////////////////////////////////////// } - #ifdef EGLBACKEND if((eglxvw = EGLXWINHASH.find(dpy, cne->window)) != NULL) { /////////////////////////////////////////////////////////////////////// @@ -471,7 +466,6 @@ static void handleXCBEvent(xcb_connection_t *conn, xcb_generic_event_t *ev) STOPTRACE(); CLOSETRACE(); /////////////////////////////////////////////////////////////////////// } - #endif break; } case XCB_KEY_PRESS: @@ -518,10 +512,8 @@ static void handleXCBEvent(xcb_connection_t *conn, xcb_generic_event_t *ev) if((vw = WINHASH.find(dpy, cme->window)) != NULL) vw->wmDeleted(); - #ifdef EGLBACKEND if((eglxvw = EGLXWINHASH.find(dpy, cme->window)) != NULL) eglxvw->wmDeleted(); - #endif break; } diff --git a/server/faker.cpp b/server/faker.cpp index 5c9db824a..d4c5415e7 100644 --- a/server/faker.cpp +++ b/server/faker.cpp @@ -16,12 +16,10 @@ #include "Mutex.h" #include #include "ContextHash.h" -#ifdef EGLBACKEND #include "EGLXDisplayHash.h" #include "EGLXWindowHash.h" #include "ContextHashEGL.h" #include "PbufferHashEGL.h" -#endif #include "GLXDrawableHash.h" #include "GlobalCriticalSection.h" #include "PixmapHash.h" @@ -38,15 +36,11 @@ namespace faker { Display *dpy3D = NULL; bool deadYet = false; char *glExtensions = NULL; -#ifdef EGLBACKEND EGLint eglMajor = 0, eglMinor = 0; -#endif VGL_THREAD_LOCAL(TraceLevel, long, 0) VGL_THREAD_LOCAL(FakerLevel, long, 0) VGL_THREAD_LOCAL(GLXExcludeCurrent, bool, false) -#ifdef EGLBACKEND VGL_THREAD_LOCAL(EGLExcludeCurrent, bool, false) -#endif VGL_THREAD_LOCAL(OGLExcludeCurrent, bool, false) VGL_THREAD_LOCAL(AutotestColor, long, -1) VGL_THREAD_LOCAL(AutotestRColor, long, -1) @@ -54,10 +48,8 @@ VGL_THREAD_LOCAL(AutotestFrame, long, -1) VGL_THREAD_LOCAL(AutotestDisplay, Display *, NULL) VGL_THREAD_LOCAL(AutotestDrawable, long, 0) VGL_THREAD_LOCAL(EGLXContextCurrent, bool, false) -#ifdef EGLBACKEND VGL_THREAD_LOCAL(EGLError, long, EGL_SUCCESS) VGL_THREAD_LOCAL(CurrentEGLXDisplay, EGLXDisplay *, NULL) -#endif static void cleanup(void) @@ -67,13 +59,11 @@ static void cleanup(void) if(ContextHash::isAlloc()) CTXHASH.kill(); if(GLXDrawableHash::isAlloc()) GLXDHASH.kill(); if(WindowHash::isAlloc()) WINHASH.kill(); - #ifdef EGLBACKEND if(EGLXDisplayHash::isAlloc()) EGLXDPYHASH.kill(); if(EGLXWindowHash::isAlloc()) EGLXWINHASH.kill(); if(backend::ContextHashEGL::isAlloc()) CTXHASHEGL.kill(); if(backend::PbufferHashEGL::isAlloc()) PBHASHEGL.kill(); if(backend::RBOContext::isAlloc()) RBOCONTEXT.kill(); - #endif free(glExtensions); unloadSymbols(); } @@ -202,7 +192,6 @@ Display *init3D(void) GlobalCriticalSection::SafeLock l(globalMutex); if(!dpy3D) { - #ifdef EGLBACKEND if(fconfig.egl) { int numDevices = 0, i, validDevices = 0; @@ -276,7 +265,6 @@ Display *init3D(void) } } else // fconfig.egl - #endif { if(fconfig.verbose) vglout.println("[VGL] Opening connection to 3D X server %s", @@ -382,9 +370,7 @@ void _vgl_disableFaker(void) { faker::setFakerLevel(faker::getFakerLevel() + 1); faker::setGLXExcludeCurrent(true); -#ifdef EGLBACKEND faker::setEGLExcludeCurrent(true); -#endif faker::setOGLExcludeCurrent(true); } @@ -392,9 +378,7 @@ void _vgl_enableFaker(void) { faker::setFakerLevel(faker::getFakerLevel() - 1); faker::setGLXExcludeCurrent(false); -#ifdef EGLBACKEND faker::setEGLExcludeCurrent(false); -#endif faker::setOGLExcludeCurrent(false); } diff --git a/server/faker.h b/server/faker.h index e4ddfa8d9..ff085b0f9 100644 --- a/server/faker.h +++ b/server/faker.h @@ -27,7 +27,6 @@ namespace faker { - #ifdef EGLBACKEND // Unfortunately, we have to create our own EGLDisplay structure because // there is no way to get multiple unique EGLDisplay handles for the same DRI // device. VirtualGL assumes that EGLDisplay handles returned by the @@ -42,14 +41,11 @@ namespace faker int screen; bool isDefault, isInit; } EGLXDisplay; - #endif extern Display *dpy3D; extern bool deadYet; extern char *glExtensions; - #ifdef EGLBACKEND extern EGLint eglMajor, eglMinor; - #endif extern void init(void); extern Display *init3D(void); @@ -61,10 +57,8 @@ namespace faker extern void setFakerLevel(long level); extern bool getGLXExcludeCurrent(void); extern void setGLXExcludeCurrent(bool excludeCurrent); - #ifdef EGLBACKEND extern bool getEGLExcludeCurrent(void); extern void setEGLExcludeCurrent(bool eglExcludeCurrent); - #endif extern bool getOGLExcludeCurrent(void); extern void setOGLExcludeCurrent(bool excludeCurrent); extern long getAutotestColor(); @@ -79,12 +73,10 @@ namespace faker extern void setAutotestDrawable(long d); extern bool getEGLXContextCurrent(void); extern void setEGLXContextCurrent(bool isEGLXContextCurrent); - #ifdef EGLBACKEND extern long getEGLError(void); extern void setEGLError(long error); extern EGLXDisplay *getCurrentEGLXDisplay(void); extern void setCurrentEGLXDisplay(EGLXDisplay *display); - #endif void *loadSymbol(const char *name, bool optional = false); void unloadSymbols(void); diff --git a/server/fakerconfig.cpp b/server/fakerconfig.cpp index 0949abb35..29da37119 100644 --- a/server/fakerconfig.cpp +++ b/server/fakerconfig.cpp @@ -336,12 +336,10 @@ void fconfig_reloadenv(void) fconfig.egl = true; } FETCHENV_BOOL("VGL_DLSYM", dlsymloader); - #ifdef EGLBACKEND FETCHENV_STR("VGL_EGLLIB", egllib); // This is a hack to allow piglit tests to pass with the EGL/X11 front end, // which doesn't (yet) support Pixmap surfaces. FETCHENV_BOOL("VGL_EGLXIGNOREPIXMAPBIT", eglxIgnorePixmapBit); - #endif FETCHENV_STR("VGL_EXCLUDE", excludeddpys); FETCHENV_STR("VGL_EXITFUNCTION", exitfunction); #ifdef FAKEXCB @@ -627,10 +625,8 @@ void fconfig_print(FakerConfig &fc) PRCONF_STR(config); PRCONF_STR(defaultfbconfig); PRCONF_INT(dlsymloader); - #ifdef EGLBACKEND PRCONF_INT(egl); PRCONF_STR(egllib); - #endif PRCONF_STR(excludeddpys); PRCONF_DBL(fps); PRCONF_DBL(flushdelay); diff --git a/server/glxvisual.cpp b/server/glxvisual.cpp index d3f420cc2..00abdcbe4 100644 --- a/server/glxvisual.cpp +++ b/server/glxvisual.cpp @@ -20,9 +20,7 @@ #include "Mutex.h" #include "faker.h" #include "vglutil.h" -#ifdef EGLBACKEND #include "TempContextEGL.h" -#endif using namespace util; @@ -382,7 +380,6 @@ static VisualID matchVisual2D(Display *dpy, int screen, VGLFBConfig config) } int depth, c_class, bpc; - #ifdef EGLBACKEND if(fconfig.egl) { depth = config->depth; @@ -390,7 +387,6 @@ static VisualID matchVisual2D(Display *dpy, int screen, VGLFBConfig config) bpc = config->attr.redSize; } else - #endif { XVisualInfo *vis = _glXGetVisualFromFBConfig(DPY3D, config->glx); if(!vis) return 0; @@ -432,9 +428,7 @@ static void buildCfgAttribTable(Display *dpy, int screen) { int nConfigs = 0; GLXFBConfig *glxConfigs = NULL; - #ifdef EGLBACKEND EGLContext ctx = 0; - #endif struct _VGLFBConfig *ca = NULL; XEDataObject obj; XExtData *extData; @@ -453,7 +447,6 @@ static void buildCfgAttribTable(Display *dpy, int screen) minExtensionNumber + 3); if(extData && extData->private_data) return; - #ifdef EGLBACKEND if(fconfig.egl) { int i = 0; @@ -550,7 +543,6 @@ static void buildCfgAttribTable(Display *dpy, int screen) } } else // fconfig.egl - #endif { if(!(glxConfigs = _glXGetFBConfigs(DPY3D, DefaultScreen(DPY3D), &nConfigs))) @@ -606,9 +598,7 @@ static void buildCfgAttribTable(Display *dpy, int screen) catch(...) { if(glxConfigs) _XFree(glxConfigs); - #ifdef EGLBACKEND if(ctx) _eglDestroyContext(EDPY, ctx); - #endif free(ca); throw; } @@ -800,8 +790,6 @@ VGLFBConfig *getFBConfigs(Display *dpy, int screen, int &nElements) } -#ifdef EGLBACKEND - static int compareFBConfig(const void *arg1, const void *arg2) { VGLFBConfig *_c1 = (VGLFBConfig *)arg1, *_c2 = (VGLFBConfig *)arg2, @@ -850,8 +838,6 @@ static int compareFBConfigNoDepth(const void *arg1, const void *arg2) if(var != (int)GLX_DONT_CARE && (var < min || var > max)) goto bailout; \ break; -#endif - VGLFBConfig *chooseFBConfig(Display *dpy, int screen, const int attribs[], int &nElements) { @@ -860,7 +846,6 @@ VGLFBConfig *chooseFBConfig(Display *dpy, int screen, const int attribs[], if(!dpy || screen < 0) return NULL; - #ifdef EGLBACKEND if(fconfig.egl) { int fbConfigID = GLX_DONT_CARE, doubleBuffer = GLX_DONT_CARE, redSize = 0, @@ -981,7 +966,6 @@ VGLFBConfig *chooseFBConfig(Display *dpy, int screen, const int attribs[], depthSize == 0 ? compareFBConfigNoDepth : compareFBConfig); } else // fconfig.egl - #endif { glxConfigs = _glXChooseFBConfig(DPY3D, DefaultScreen(DPY3D), attribs, &nElements); diff --git a/server/glxvisual.h b/server/glxvisual.h index f3cc77a5a..bd12a98c1 100644 --- a/server/glxvisual.h +++ b/server/glxvisual.h @@ -16,9 +16,7 @@ #define __GLXVISUAL_H__ #include "faker-sym.h" -#ifdef EGLBACKEND #include "RBOContext.h" -#endif typedef struct diff --git a/server/libdeepbindtest.c b/server/libdeepbindtest.c index f1fe72979..c38d4056c 100644 --- a/server/libdeepbindtest.c +++ b/server/libdeepbindtest.c @@ -15,9 +15,7 @@ #include #include #include -#ifdef EGLBACKEND #include -#endif #ifdef FAKEOPENCL #include #endif @@ -44,7 +42,6 @@ #define _glXDestroyContext glXDestroyContext #define _glXMakeCurrent glXMakeCurrent #define _glXSwapBuffers glXSwapBuffers -#ifdef EGLBACKEND #define _eglChooseConfig eglChooseConfig #define _eglCreateContext eglCreateContext #define _eglCreateWindowSurface eglCreateWindowSurface @@ -56,7 +53,6 @@ #define _eglMakeCurrent eglMakeCurrent #define _eglSwapBuffers eglSwapBuffers #define _eglTerminate eglTerminate -#endif #ifdef FAKEOPENCL #define _clCreateContext clCreateContext #define _clGetContextInfo clGetContextInfo diff --git a/server/servertest.in b/server/servertest.in index 648990d0e..2ccb03f69 100644 --- a/server/servertest.in +++ b/server/servertest.in @@ -27,7 +27,6 @@ onexit() BIN=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@ LIB=@CMAKE_LIBRARY_OUTPUT_DIRECTORY@ FAKEOPENCL=@VGL_FAKEOPENCL@ -EGLBACKEND=@VGL_EGLBACKEND@ NODL= FAKERUTARGS= @@ -113,7 +112,7 @@ if [ "$GLVND" = "1" ]; then DISPLAY=:42 $BIN/vglrun $BIN/dlfakerut $EGLXARG --glvnd DISPLAY=:42 $BIN/vglrun $BIN/dlfakerut $EGLXARG --prefix test --glvnd fi -if [ "$FAKEOPENCL" = "1" -a ! "$EGLBACKEND" = "1" ]; then +if [ "$FAKEOPENCL" = "1" ]; then DISPLAY=:42 $BIN/vglrun +ocl $BIN/dlfakerut $EGLXARG DISPLAY=:42 $BIN/vglrun +ocl $BIN/dlfakerut $EGLXARG --prefix test fi