Skip to content
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

Support glLogicOp and the GL_COLOR_LOGIC_OP constant #1416

Closed
michaeljbishop opened this issue Jul 19, 2013 · 4 comments
Closed

Support glLogicOp and the GL_COLOR_LOGIC_OP constant #1416

michaeljbishop opened this issue Jul 19, 2013 · 4 comments

Comments

@michaeljbishop
Copy link
Contributor

Emscripten applications throw an "missing function" error if they call glLogicOp .

Sample code below.

    glEnable(GL_COLOR_LOGIC_OP);
    glLogicOp(GL_XOR);          
@juj juj added the GL label Jul 27, 2014
@juj juj self-assigned this Jul 28, 2014
@juj
Copy link
Collaborator

juj commented Aug 15, 2014

I noticed this as well. Unfortunately glLogicOp is something that only GLES1.0 has. Neither GLES2, GLES3 and WebGL have this functionality. Since GLES3 doesn't have it, WebGL 2.0 won't have it either.

Emulating the functionality presented by glLogicOp with GLES2 is one of the most expensive ones imaginable, and would involve generating a hidden render target behind the scenes, dynamically patching all shaders which render with glLogicOp enabled, and perform a ping-pong source read+write operation on the framebuffer at each draw step, and then blitting the results to the final framebuffer. The performance hit would be immense. I took a look at the regal emulation library to see how they emulate it, but I could not find anything related. It looks like they just stub out that function without actually having it perform anything. I wrote down https://github.com/p3/regal/issues/137 to ask about the details.

I think we might have to close this down as a case that we cannot support.

@lunixbochs
Copy link

On desktop OpenGL, is glLogicOp applied to shader output or just the fixed function pipeline?

Are there any example applications in the wild using glLogicOp for anything important I can take a look at?

@juj
Copy link
Collaborator

juj commented Aug 25, 2014

On desktop OpenGL, glLogicOp applies to both shaders and FFP. Desktop OpenGL still has glLogicOp available in GL 3.0 and newer, which removed FFP altogether. I am not aware of samples on the web that would use this, although I haven't searched.

@juj
Copy link
Collaborator

juj commented Aug 20, 2016

I'm thinking that this is not possible to emulate at all - Regal was not able to do it in https://github.com/p3/regal/issues/137, so doubt there is much we could do either. Closing this as unsupportable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants