summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-08-14 09:57:53 +0200
committerJan Holesovsky <kendy@collabora.com>2015-09-01 07:22:09 +0000
commit20c92dc6b772a6016501499bb1ecc53686dba1fb (patch)
treec2dcf4522330b7080a93d2ad81954c358c318007 /include
parent8cb5adc2c1ce42cda302b72ac145053bc906d7c6 (diff)
vcl opengl: fix setting up debug context on Windows
At least with my AMD card, in case of SAL_FORCEGL=1 the startup crashes quite early. DrMemory says: ~~Dr.M~~ Error #1: UNADDRESSABLE ACCESS: writing 0x00001414-0x00001415 1 byte(s) ~~Dr.M~~ # 0 atioglxx.dll!DrvPresentBuffers +0xd6ea6 (0x09a248f6 <atioglxx.dll+0x1248f6>) ~~Dr.M~~ # 1 atioglxx.dll!DrvPresentBuffers +0x3c069c (0x09d0e0ed <atioglxx.dll+0x40e0ed>) ~~Dr.M~~ # 2 vcllo.dll!OpenGLContext::InitGLEW [c:\lo\master\vcl\source\opengl\openglcontext.cxx:949] ~~Dr.M~~ # 3 vcllo.dll!OpenGLContext::ImplInit [c:\lo\master\vcl\source\opengl\openglcontext.cxx:866] ~~Dr.M~~ # 4 vcllo.dll!OpenGLContext::init [c:\lo\master\vcl\source\opengl\openglcontext.cxx:786] ~~Dr.M~~ # 5 vcllo.dll!WinOpenGLSalGraphicsImpl::CreateWinContext [c:\lo\master\vcl\opengl\win\gdiimpl.cxx:36] Turns out that in order to enable the GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB extension, the GL context must be created with WGL_CONTEXT_DEBUG_BIT_ARB set. It seems that other drivers did not enforce this so far, but in this case the driver just crashes without this. Fix the problem by splitting out the debug setup part of InitGLEW() into a new InitGLEWDebugging(), and at least on Windows call it only after wglCreateContextAttribsARB() and wglMakeCurrent(). Additionally make sure that in the debug case the necessary flag is passed to wglCreateContextAttribsARB(). Conflicts: vcl/source/opengl/OpenGLContext.cxx Change-Id: I6b77e0c06fd85fdae0386a0801f1de1838524586 Reviewed-on: https://gerrit.libreoffice.org/17750 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/18219 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/opengl/OpenGLContext.hxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index 2d2ce8f823d5..73434a0b9319 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -238,6 +238,7 @@ public:
private:
SAL_DLLPRIVATE bool InitGLEW();
+ SAL_DLLPRIVATE void InitGLEWDebugging();
SAL_DLLPRIVATE bool initWindow();
SAL_DLLPRIVATE bool ImplInit();
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)