-
Notifications
You must be signed in to change notification settings - Fork 26
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
glEnd called twice by renderPrimitive (on Windows) #87
Comments
I suspect that you have a problem with picking the right OpenGL context. This depends quite a bit on your platform/driver. There are a few things to consider here:
initialContextFlags $= [ DebugContext ]
debugMessageCallback $=
Just (\(DebugMessage _source _typ _ident _severity message) -> putStrLn message)
debugOutputSynchronous $= Enabled
flip mapM_ [ ("VENDOR", vendor),
("VERSION", glVersion),
("RENDERER", renderer) ] $ \(name, var) -> do
val <- get var
putStrLn (name ++ ": " ++ val)
I've tried your program (without the incorrect |
After some research and epic debugging sessions, it seems that on Windows we are a victim of the problem described in https://cgit.freedesktop.org/mesa/mesa/commit/?id=c7f0755caa1c39d5433e37c53242ef251aa4fc3a:
😱 Just like in the test mentioned in the commit above, a
The good thing: This explains why this is a Windows-only problem. The bad thing: Without totally changing the way Thanks for a great bug report, it's a miracle why this was not reported earlier. |
You're awesome Sven!!! Thanks for following up. For my part, I can work
around it in my program. I love Haskell and I love the OpenGL package you
guys maintain and love how simple and clear the tutorial is.
You rock!
- Tim
…On Mon, Sep 4, 2017 at 12:20 PM, Sven Panne ***@***.***> wrote:
After some research and epic debugging sessions, it seems that on Windows
we are a victim of the problem described in https://cgit.freedesktop.org/
mesa/mesa/commit/?id=c7f0755caa1c39d5433e37c53242ef251aa4fc3a:
... The basic problem is Microsoft's opengl32.dll calls glFlush from
wglGetProcAddress() ...
😱 Just like in the test mentioned in the commit above, a glFlush is
implicty happening while a glBegin/glEnd pair is open, which is an OpenGL
error. Using OpenGL's debug API introduced in 4.3 one gets the following
information:
source: SOURCE_API
type: TYPE_ERROR
id: 1282
severity: SEVERITY_HIGH
message (length 136): GL_INVALID_OPERATION error generated. Calling glFlush from the current immediate mode state is invalid. Check glBegin() / glEnd() pairs.
The good thing: This explains why this is a Windows-only problem. The bad
thing: Without totally changing the way OpenGLRaw accesses OpenGL entry
points, I see no way around that problem. I need to think about this and
look at other dynamic OpenGL loaders. One sledgehammer would be: Load all
entry points at once (but still lazily, so we have the right context),
which might be a big performance hit during startup.
Thanks for a great bug report, it's a miracle why this was not reported
earlier.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABskgAqvDsW0FH0VxWwqP6mj9Rob8Fktks5sfE17gaJpZM4PCJzm>
.
|
The following minimal program calls
glEnd
twice withinrenderPrimitive
. This is on Windows 32b package version OpenGL 3.0.0.2.I've reproduced with GHC 8.0.1 and GHC 8.0.2. This pollutes the error state for programs.
OpenGL 2.9.0.2 on a Mac with GHC 7.8.3 does not exhibit the problem.
The text was updated successfully, but these errors were encountered: