-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QtWebEngine: Error from previous GL command #199
Comments
Another slightly different example based on Qt's example https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-minimal-example.html: #include <QApplication>
#include <QUrl>
#include <QWebEngineView>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWebEngineView view;
view.setUrl(QUrl(QStringLiteral("https://www.qt.io")));
view.show();
return app.exec();
} With the above example, I get the error message "[.BrowserMainThread-0x1ac7310]GL ERROR :GL_INVALID_OPERATION : BackFramebuffer::Destroy: <- error from previous GL command" once in a while on shut-down. |
Further investigation shows that we can get the same error on launch (not shutdown) with the first example posted by @JHagemeister when using If there is anything else we can provide that would be helpful please let us know. Also, we will happily take suggestions for debugging/tracing tools we can use to investigate further. |
I followed the OpenGL debugging guidelines provided in https://www.khronos.org/opengl/wiki/Debug_Output
to VirtualGL. I then obtained the following information: GL CALLBACK: ** GL ERROR ** type = 0x824c, severity = 0x9146, message = GL_INVALID_OPERATION error generated. Framebuffer name must be generated before being bound. |
I am looking into it. |
Unfortunately the issue is so intermittent on my system that it is impossible to debug. I have only observed it once in over 100 invocations. Please find a more reliable way to reproduce it. |
Does the following help maybe? Also, I run into this stacktrace everytime I run the first example program posted above. #0 backend::MessageCallback (source=33350, type=33356, id=1282, severity=37190, length=92, |
This is how I added further OpenGL error logging:
|
@JHagemeister I need to be able to reliably reproduce the issue in order to diagnose it, but on my machine, the issue is so unreliable that I won't necessarily encounter it even if I run the test application in a loop for hundreds of iterations. That is impossible to work with. If you can more reliably reproduce the issue, then I would suggest adding a print statement to |
Thank you for your reply and I of course understand that you need a reliable way to reproduce in order to trouble shoot. Please let me briefly recap my oservations before I answer your questions: Initially, without any particular debugging enabled, I encountered (with some frequency)"[20380:20418:0421/161153.973944:ERROR:gles2_cmd_decoder.cc(2843)] [.RenderCompositor-0x7fd88000bd90]GL ERROR :GL_INVALID_OPERATION : BackFramebuffer::Destroy: <- error from previous GL command" I then enhanced OpenGL error logging in VirtualGL as posted in the diff above along the lines of I then obtained the following:
I always run into "GL_INVALID_OPERATION error generated. Framebuffer name must be generated before being bound." but only sometimes into Qt's log message " BackFramebuffer::Destroy: <- error from previous GL command". Hence, it seems to me that "GL_INVALID_OPERATION error generated. Framebuffer name must be generated before being bound." is much more reliable to reproduce. I unfortunately cannot conclude whether this is the cause for the Qt log. However, it seems to me that investigating "GL_INVALID_OPERATION error generated. Framebuffer name must be generated before being bound." is interesting in itself as this should not happen? It sounds like a bug in VirtualGL but I am not certain about that? To answer your questions: I agree with your assessment of the issue and I am having trouble to find out why the previously bound buffer cannot be rebound. I found out that the values of the draw and read buffers to be restored both are "2" when this happens. Also it seems to me that the issue is not related to the createBuffer code as I can reproduce the same issue with following code modification:
where I just try to bind to the default buffer and back again. I do not understand why this does not work, yet. Please let me know if you have further suggestions/ideas to this! I will continue digging in the meanwhile. |
OK, I can now reliably reproduce the low-level OpenGL error. (Not sure why it wasn't showing up yesterday. Probably an error on my part.) I am investigating. |
- When calling FakePbuffer::createBuffer() from backend::makeCurrent(), don't try to re-bind the old FBO if the new FBO will immediately be bound. This fixes a GL_INVALID_OPERATION error that could occur due to the following sequence of function calls: glXMakeCurrent(dpy, window, context); glXMakeCurrent(dpy, 0, 0); XDestroyWindow(dpy, window); glXMakeCurrent(dpy, other_drawable, context); XDestroyWindow() destroys the FakePbuffer instance associated with the window, which destroys the FBO and RBOs associated with the FakePbuffer instance. Since XDestroyWindow() is a context-less function, the FBO destruction occurs in the RBO context. However, the destroyed FBO is still the current FBO in the application's context. The FBO associated with other_drawable will be made current once the second glXMake*Current() call completes, so we simply need to avoid binding the destroyed FBO within the body of that function call. The easiest way to do that is to avoid restoring an FBO binding via the BufferState instance created in FakePbuffer::createBuffer() if that binding would immediately be overwritten. We do likewise within FakePbuffer:swap(), to fix a similar GL_INVALID_OPERATION error in glXSwapBuffers() that was observed sporadically in the fakerut multithreaded rendering test. The exact mechanism behind this error was not entirely clear. - In backend::makeCurrent(), call FakePbuffer::setDrawBuffer() rather than FakePbuffer::setDrawBuffers() if ContextHashEGL.getDrawBuffers() returns only one buffer. If ContextHashEGL.getDrawBuffers() returns only one buffer, then that buffer may be GL_FRONT or another enum that would trigger a GL_INVALID_ENUM error if passed to FakePbuffer::setDrawBuffers() (since FakePbuffer::setDrawBuffers() emulates the behavior of glDrawBuffers().) Fixes #199
Should be fixed now. Try the latest pre-release build. |
Awesome! I have not seen the error again in ~50 runs on my machine. |
I am running into the following issue when closing my Qt application (Qt version 5.15):
[20380:20418:0421/161153.973944:ERROR:gles2_cmd_decoder.cc(2843)] [.RenderCompositor-0x7fd88000bd90]GL ERROR :GL_INVALID_OPERATION : BackFramebuffer::Destroy: <- error from previous GL command
I can reproduce this issue with a very tiny example code snippet run wrapped with "vglrun -d egl".
The text was updated successfully, but these errors were encountered: