Bug 93772 - switching context does not un-bind framebuffers correctly ...
Summary: switching context does not un-bind framebuffers correctly ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.1.0 target:5.0.2
Keywords:
Depends on:
Blocks: VCL-OpenGL
  Show dependency treegraph
 
Reported: 2015-08-29 21:04 UTC by Michael Meeks
Modified: 2016-10-25 19:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2015-08-29 21:04:13 UTC
This leaves the code with the impression that a framebuffer is bound to the previous context - and stops us binding it again - which looks problematic:

151523 glDebugMessageInsert(source = GL_DEBUG_SOURCE_APPLICATION, type = GL_DEBUG_TYPE_OTHER, id = 1, severity = GL_DEBUG_SEVERITY_LOW, length = 55, buf = "PaintHelper::DoPaint on class SvxColorValueSet '' start")
...

151563 glBindFramebuffer(target = GL_FRAMEBUFFER, framebuffer = 6)
151564 glDebugMessageInsert(source = GL_DEBUG_SOURCE_APPLICATION, type = GL_DEBUG_TYPE_OTHER, id = 1, severity = GL_DEBUG_SEVERITY_LOW, length = 21, buf = "Binding framebuffer 6")
151567 glFramebufferTexture2D(target = GL_FRAMEBUFFER, attachment = GL_COLOR_ATTACHMENT0, textarget = GL_TEXTURE_2D, texture = 0, level = 0)
151569 glDeleteTextures(n = 1, textures = &152)
151570 glDebugMessageInsert(source = GL_DEBUG_SOURCE_APPLICATION, type = GL_DEBUG_TYPE_OTHER, id = 1, severity = GL_DEBUG_SEVERITY_LOW, length = 10, buf = "::drawRect")

151574 wglMakeCurrent(hdc = 0x69011402, hglrc = 0x10003) = TRUE
151576 glGenTextures(n = 1, textures = &152)
151577 glBindTexture(target = GL_TEXTURE_2D, texture = 152)
151578 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_WRAP_S, param = GL_CLAMP_TO_EDGE)
151579 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_WRAP_T, param = GL_CLAMP_TO_EDGE)
151580 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_MIN_FILTER, param = GL_NEAREST)
151581 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_MAG_FILTER, param = GL_NEAREST)
151582 glTexImage2D(target = GL_TEXTURE_2D, level = 0, internalformat = GL_RGBA, width = 222, height = 16, border = 0, format = GL_RGBA, type = GL_UNSIGNED_BYTE, pixels = NULL)
151583 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
151585 glDebugMessageInsert(source = GL_DEBUG_SOURCE_APPLICATION, type = GL_DEBUG_TYPE_OTHER, id = 1, severity = GL_DEBUG_SEVERITY_LOW, length = 38, buf = "Attaching texture 152 to framebuffer 6")
151586 glFramebufferTexture2D(target = GL_FRAMEBUFFER, attachment = GL_COLOR_ATTACHMENT0, textarget = GL_TEXTURE_2D, texture = 152, level = 0)
151587 glGetError() = GL_INVALID_OPERATION

Unless I'm mistaken doing a wglMakeCurrent switches context, and we should re-bind the framebuffer to the next context before trying to bind a texture there.
Comment 1 Michael Meeks 2015-08-29 21:04:56 UTC
working ... have a patch - just polishing the test.
Comment 2 Michael Meeks 2015-08-29 22:13:27 UTC
master: https://gerrit.libreoffice.org/18132
-5-0: https://gerrit.libreoffice.org/18135

Seems to make life rather better (for me at least) - I get working toolbar pop-downs on windows.

Review appreciated etc.
Comment 3 Commit Notification 2015-08-31 19:49:40 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b27b9084c5b55f6cf6732fb9bdc253658ea612ea

tdf#93772 - handle framebuffer unbinding on GL context switch.

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2015-09-01 14:00:54 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=77d7cab8b90b967c6788546a77150f78d74549ea&h=libreoffice-5-0

tdf#93772 - handle framebuffer unbinding on GL context switch.

It will be available in 5.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.