From 431c4dc7dae68c28018ec19dd1c2b3e6b058c019 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 10 Aug 2018 18:10:12 +0200 Subject: vcl opengl windows: fix error handling in tryShaders() Both of my GPUs failed to start with GL enabled in an enable-symbols build, but they were fine in a dbgutil build. It seems the problem was that in case CHECK_GL_ERROR() expands to an error reporting code, then we already correctly checked the error of the last GL call at the end of tryShaders() -- but in case it expanded to nothing, then previous (unrelated) errors signaled that shader compilation went wrong, even if it did not. Given that we have error handling right before glDeleteProgram(), clear the GL error queue before calling glDeleteProgram(). Change-Id: If58188d06a0b7009a71af82c476b5aa77823d9b0 Reviewed-on: https://gerrit.libreoffice.org/58852 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- vcl/opengl/win/gdiimpl.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vcl/opengl') diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx index 5d4158c3b3d7..70e20367f27f 100644 --- a/vcl/opengl/win/gdiimpl.cxx +++ b/vcl/opengl/win/gdiimpl.cxx @@ -424,6 +424,10 @@ bool tryShaders(const OUString& rVertexShader, const OUString& rFragmentShader, } if (!nId) return false; + + // We're intersted in the error returned by glDeleteProgram(). + glGetError(); + glDeleteProgram(nId); return glGetError() == GL_NO_ERROR; } -- cgit