diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-10 18:10:12 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-13 09:09:51 +0200 |
commit | 431c4dc7dae68c28018ec19dd1c2b3e6b058c019 (patch) | |
tree | 99cbbc7f006e515468621ce059969cd2a6239d79 /vcl | |
parent | 67649406d7b72f8d6ea4bbe76e775e0052ddefc3 (diff) |
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 <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/win/gdiimpl.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
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; } |