Use GLAD2 a multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator.
Comments by: @nwtour, @Langbart, @bb
Based on patch by: @echotangoecho
Tested on Windows 7 & 10, Ubuntu and macos.
Differential Revision: https://code.wildfiregames.com/D721
Use GLAD2 a multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator.
Description
Details
Event TimelineComment Actions test_ParamNode.cpp In file included from ../../../source/simulation2/tests/test_ParamNode.cpp:8: ../../../source/lib/external_libraries/libsdl.h:59:39: warning: "CONFIG2_GLES" is not defined, evaluates to 0 [-Wundef] 59 | #if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | ^~~~~~~~~~~~ test_SerializeTemplates.cpp In file included from ../../../source/simulation2/tests/test_SerializeTemplates.cpp:9: ../../../source/lib/external_libraries/libsdl.h:59:39: warning: "CONFIG2_GLES" is not defined, evaluates to 0 [-Wundef] 59 | #if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | ^~~~~~~~~~~~ test_Serializer.cpp In file included from ../../../source/simulation2/tests/test_Serializer.cpp:10: ../../../source/lib/external_libraries/libsdl.h:59:39: warning: "CONFIG2_GLES" is not defined, evaluates to 0 [-Wundef] 59 | #if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | ^~~~~~~~~~~~ test_Simulation2.cpp In file included from ../../../source/simulation2/tests/test_Simulation2.cpp:9: ../../../source/lib/external_libraries/libsdl.h:59:39: warning: "CONFIG2_GLES" is not defined, evaluates to 0 [-Wundef] 59 | #if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | ^~~~~~~~~~~~ test_root.cpp In file included from ../../../source/test_root.cpp:8: ../../../source/lib/external_libraries/libsdl.h:59:39: warning: "CONFIG2_GLES" is not defined, evaluates to 0 [-Wundef] 59 | #if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | ^~~~~~~~~~~~ test_setup.cpp test_pkcs5_pbkdf5.cpp In file included from ../../../source/third_party/encryption/tests/test_pkcs5_pbkdf5.cpp:8: ../../../source/lib/external_libraries/libsdl.h:59:39: warning: "CONFIG2_GLES" is not defined, evaluates to 0 [-Wundef] 59 | #if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | ^~~~~~~~~~~~ test_Preprocessor.cpp In file included from ../../../source/third_party/ogre3d_preprocessor/tests/test_Preprocessor.cpp:9: ../../../source/lib/external_libraries/libsdl.h:59:39: warning: "CONFIG2_GLES" is not defined, evaluates to 0 [-Wundef] 59 | #if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | ^~~~~~~~~~~~ test_AtlasObjectXML.cpp In file included from ../../../source/tools/atlas/AtlasObject/tests/test_AtlasObjectXML.cpp:9: ../../../source/lib/external_libraries/libsdl.h:59:39: warning: "CONFIG2_GLES" is not defined, evaluates to 0 [-Wundef] 59 | #if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | ^~~~~~~~~~~~ And some more. (Compiled without PCH.) Comment Actions Executes the code for glsl with the option disabled (this did not happen before the commit) ~/.config/0ad/config/user.cfg forceglmajorversion = "1" forceglminorversion = "4" forceglprofile = "compatibility" forceglversion = "true" preferglsl = "false" Thread 1 "main" received signal SIGSEGV, Segmentation fault. #1 0x083b5d79 in CShaderProgramGLSL::Compile (shader=1, file=..., code=..., this=0x96b76e0) at ../../../source/graphics/ShaderProgram.cpp:309 #2 0x083b78cc in CShaderProgramGLSL::Reload (this=0x96b76e0) at ../../../source/graphics/ShaderProgram.cpp:490 #3 0x083aaff5 in CShaderManager::NewProgram (this=0x8e97018, name=<optimized out>, baseDefines=..., program=std::shared_ptr<CShaderProgram> (use count 1, weak count 0) = {...}) at ../../../source/graphics/ShaderManager.cpp:268 #4 0x083aca40 in CShaderManager::LoadProgram (this=0x8e97018, name=0xbfffecb4 "glsl/canvas2d", defines=...) at ../../../source/graphics/ShaderManager.cpp:74 #5 0x083ae267 in CShaderManager::NewEffect (this=0x8e97018, name=<optimized out>, baseDefines=..., tech=std::shared_ptr<CShaderTechnique> (use count 1, weak count 0) = {...}) at /usr/include/c++/8/bits/basic_string.h:2290 #6 0x083aeb89 in CShaderManager::LoadEffect (this=0x8e97018, name=..., defines=...) at ../../../source/graphics/ShaderManager.cpp:363 #7 0x0836ef27 in CCanvas2D::Impl::BindTechIfNeeded (this=<optimized out>) at ../../../source/ps/Singleton.h:49 #8 CCanvas2D::DrawTexture (this=0xbffff0ec, texture=std::shared_ptr<CTexture> (use count 3, weak count 8) = {...}, destination=..., source=..., multiply=..., add=..., grayscaleFactor=0) at ../../../source/graphics/Canvas2D.cpp:185 #9 0x08559f70 in GUIRenderer::Draw (Calls=..., canvas=...) at /usr/include/c++/8/ext/atomicity.h:96 #10 0x08554a8a in CGUISpriteInstance::Draw (this=0x9025650, pGUI=..., canvas=..., Size=..., Sprites=std::map with 102 elements = {...}) at ../../../source/gui/CGUISprite.cpp:36 Comment Actions Technically preferGLSL doesn't enable shaders, it switches them from ARB to GLSL shaders. You might want to use rendererbackend = "glarb", see default.cfg. Comment Actions Thanks With rendererbackend = "gl" or "glarb" and MESA_GL_VERSION_OVERRIDE=2.1 Thread 1 "main" received signal SIGSEGV, Segmentation fault. #1 0x0842aef8 in Renderer::Backend::GL::CDevice::Report (this=0x8b5d930, rq=..., settings=...) at ../../../source/renderer/backend/gl/Device.cpp:341 #2 0x082c610f in RunHardwareDetection () at ../../../libraries/source/spidermonkey/include-unix-release/js/RootingAPI.h:1260
Comment Actions Yes. Comment Actions Segfault (last two lines): $ rm -f ~/.config/0ad/config/user.cfg $ ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault $ echo -ne 'forceglmajorversion = "1"\nforceglminorversion = "4"\nforceglversion = "true"\nforceglprofile = "compatibility"\n' > ~/.config/0ad/config/user.cfg $ ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault $ echo -ne 'rendererbackend = "glarb"\nforceglmajorversion = "1"\nforceglminorversion = "4"\nforceglversion = "true"\nforceglprofile = "compatibility"\n' > ~/.config/0ad/config/user.cfg $ ./binaries/system/pyrogenesis > /dev/null && echo "Success" Success $ echo -ne 'rendererbackend = "gl"\nforceglmajorversion = "1"\nforceglminorversion = "4"\nforceglversion = "true"\nforceglprofile = "compatibility"\n' > ~/.config/0ad/config/user.cfg $ ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault $ echo -ne 'rendererbackend = "gl"\nforceglmajorversion = "2"\nforceglminorversion = "1"\nforceglversion = "true"\nforceglprofile = "compatibility"\n' > ~/.config/0ad/config/user.cfg $ ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault $ echo -ne 'rendererbackend = "glarb"\nforceglmajorversion = "2"\nforceglminorversion = "1"\nforceglversion = "true"\nforceglprofile = "compatibility"\n' > ~/.config/0ad/config/user.cfg $ ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault $ MESA_GL_VERSION_OVERRIDE=2.1 ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault $ echo -ne 'rendererbackend = "gl"\nforceglmajorversion = "2"\nforceglminorversion = "1"\nforceglversion = "true"\nforceglprofile = "compatibility"\n' > ~/.config/0ad/config/user.cfg $ MESA_GL_VERSION_OVERRIDE=2.1 ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault $ echo -ne 'forceglmajorversion = "1"\nforceglminorversion = "4"\nforceglversion = "true"\nforceglprofile = "compatibility"\n' > ~/.config/0ad/config/user.cfg $ MESA_GL_VERSION_OVERRIDE=2.1 ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault $ echo -ne 'forceglmajorversion = "2"\nforceglminorversion = "1"\nforceglversion = "true"\nforceglprofile = "compatibility"\n' > ~/.config/0ad/config/user.cfg $ MESA_GL_VERSION_OVERRIDE=2.1 ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault $ echo -ne 'rendererbackend = "gl"\n' > ~/.config/0ad/config/user.cfg $ MESA_GL_VERSION_OVERRIDE=2.1 ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault $ echo -ne 'rendererbackend = "glarb"\n' > ~/.config/0ad/config/user.cfg $ MESA_GL_VERSION_OVERRIDE=2.1 ./binaries/system/pyrogenesis > /dev/null && echo "Success" Segmentation fault
Comment Actions Can you upload your hwdetect_userreporter.txt files? Check if they are different depending on the mesa and forcegl flags.. It seems to crash on GL_ARB_occlusion_query which means maybe your GPU is pretending to support something it does not. Comment Actions Launched with software rendering - the game started. So these are just local problems with the driver - then don't pay attention |