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

Remove gl2x backed legacy methods from PGL #3674

Closed
JakubValtar opened this Issue Aug 20, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@JakubValtar
Contributor

JakubValtar commented Aug 20, 2015

When requesting GL2ES1 interface we used to get GL2/GL3bc/GL4bc implementation on desktop, which could be cast to GL2. After transition to GL2ES2 we are getting only GLES2 on mobile and core implementations (GL3/GL4) on desktop, which means that we can't get GL2 anymore (diagram). GL2 gl2x should be removed from PJOGL and some sensible error messages should be printed from affected methods. Examples should be revised as well.

Related: #3620 #3621 #3671

@JakubValtar JakubValtar added the opengl label Aug 20, 2015

@gohai

This comment has been minimized.

Show comment
Hide comment
@gohai

gohai Aug 20, 2015

Contributor

I am not an expert on OpenGL interfaces or JOGL, but I believe I am getting a GL2 from the open source vc4 Mesa driver (on the Raspberry Pi), when I request a GL2ES2 (or GL2ES1).

Not sure if this plays any role in your considerations above, but just thought I mention it.

Contributor

gohai commented Aug 20, 2015

I am not an expert on OpenGL interfaces or JOGL, but I believe I am getting a GL2 from the open source vc4 Mesa driver (on the Raspberry Pi), when I request a GL2ES2 (or GL2ES1).

Not sure if this plays any role in your considerations above, but just thought I mention it.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Aug 20, 2015

Contributor

@gohai Try to run something with
vertexAttribPointer(int index, int size, int type, boolean normalized, int stride, Buffer data)
on it. If it's working you are indeed getting GL2. However, on desktop I'm getting GL4 core profiles which don't support GL2 and if I force cast it to GL2 I get

Exception in thread "Thread-3"
  com.jogamp.opengl.GLException: CPU data sourcing n/a w/ WindowsWGLContext
    [Version 4.5 (Core profile, arb, compat[ES2, ES3, ES31], FBO, hardware) - 4.5.0 NVIDIA 353.62
    [GL 4.5.0, vendor 353.62.0 (NVIDIA 353.62)], ...

So on desktop we are getting GL4 core profiles which don't support GL2 anymore. JOGL interface hierarchy:
diagram

Anyway, we are using GL2ES2 so we don't have to worry about this kind of stuff. I think it's time to get rid of the legacy stuff. Thoughts @codeanticode?

Contributor

JakubValtar commented Aug 20, 2015

@gohai Try to run something with
vertexAttribPointer(int index, int size, int type, boolean normalized, int stride, Buffer data)
on it. If it's working you are indeed getting GL2. However, on desktop I'm getting GL4 core profiles which don't support GL2 and if I force cast it to GL2 I get

Exception in thread "Thread-3"
  com.jogamp.opengl.GLException: CPU data sourcing n/a w/ WindowsWGLContext
    [Version 4.5 (Core profile, arb, compat[ES2, ES3, ES31], FBO, hardware) - 4.5.0 NVIDIA 353.62
    [GL 4.5.0, vendor 353.62.0 (NVIDIA 353.62)], ...

So on desktop we are getting GL4 core profiles which don't support GL2 anymore. JOGL interface hierarchy:
diagram

Anyway, we are using GL2ES2 so we don't have to worry about this kind of stuff. I think it's time to get rid of the legacy stuff. Thoughts @codeanticode?

@gohai

This comment has been minimized.

Show comment
Hide comment
@gohai

gohai Aug 20, 2015

Contributor

Yes, those calls were working on the Mesa driver with vc4 - it was only the (GLES2 only) binary driver that doesn't do those. Mesa implements the entire desktop GL stack for this hardware, but I think GL2 is as far as this (tiling) chip will ever go.. just saying that there might be some hardware that does GL2 but not GL3, as far as I understand.

This is the JOGL debug output for this configuration:

X11GraphicsDevice[type .x11, connection :0.0]:
        Natives
                GL4bc   false
                GL4     false
                GLES3   false
                GL3bc   false
                GL3     false
                GL2     true [2.1 (Compat profile, arb, compat[ES2], FBO, hardware)]
                GLES2   false
                GLES1   false
                Count   1 / 8
        Common
                GL4ES3  false
                GL2GL3  true
                GL2ES2  true
                GL2ES1  true
        Mappings
                GL2ES2  GLProfile[GL2ES2/GL2.hw]
                GL2ES1  GLProfile[GL2ES1/GL2.hw]
                GL2     GLProfile[GL2/GL2.hw]
                GL2GL3  GLProfile[GL2GL3/GL2.hw]
                default GLProfile[GL2/GL2.hw]
                Count   4 / 12
Contributor

gohai commented Aug 20, 2015

Yes, those calls were working on the Mesa driver with vc4 - it was only the (GLES2 only) binary driver that doesn't do those. Mesa implements the entire desktop GL stack for this hardware, but I think GL2 is as far as this (tiling) chip will ever go.. just saying that there might be some hardware that does GL2 but not GL3, as far as I understand.

This is the JOGL debug output for this configuration:

X11GraphicsDevice[type .x11, connection :0.0]:
        Natives
                GL4bc   false
                GL4     false
                GLES3   false
                GL3bc   false
                GL3     false
                GL2     true [2.1 (Compat profile, arb, compat[ES2], FBO, hardware)]
                GLES2   false
                GLES1   false
                Count   1 / 8
        Common
                GL4ES3  false
                GL2GL3  true
                GL2ES2  true
                GL2ES1  true
        Mappings
                GL2ES2  GLProfile[GL2ES2/GL2.hw]
                GL2ES1  GLProfile[GL2ES1/GL2.hw]
                GL2     GLProfile[GL2/GL2.hw]
                GL2GL3  GLProfile[GL2GL3/GL2.hw]
                default GLProfile[GL2/GL2.hw]
                Count   4 / 12

@JakubValtar JakubValtar changed the title from Remove gl2x from PJOGL and throw warnings from affected methods to Remove gl2x backed legacy methods from PJOGL Aug 21, 2015

@JakubValtar JakubValtar changed the title from Remove gl2x backed legacy methods from PJOGL to Remove gl2x backed legacy methods from PGL Aug 21, 2015

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Aug 21, 2015

Contributor

We decided to keep GL2 and cascade through it for functions like PJOGL#renderbufferStorageMultisample to support Raspberry Pi, but we are going to remove legacy functions backed solely by GL2, such as:

alphaFunc(int func, float ref);
drawElements(int mode, int count, int type, Buffer indices);
vertexAttribPointer(int index, int size, int type, boolean normalized, int stride, Buffer data);

You will still be able to get GL2 through PGL and call them if you so desire, but it does not make sense to keep them in PGL API, because nearly none of our users on desktop are going to be able to use them anyway.

Contributor

JakubValtar commented Aug 21, 2015

We decided to keep GL2 and cascade through it for functions like PJOGL#renderbufferStorageMultisample to support Raspberry Pi, but we are going to remove legacy functions backed solely by GL2, such as:

alphaFunc(int func, float ref);
drawElements(int mode, int count, int type, Buffer indices);
vertexAttribPointer(int index, int size, int type, boolean normalized, int stride, Buffer data);

You will still be able to get GL2 through PGL and call them if you so desire, but it does not make sense to keep them in PGL API, because nearly none of our users on desktop are going to be able to use them anyway.

@gohai

This comment has been minimized.

Show comment
Hide comment
@gohai

gohai Aug 21, 2015

Contributor

Hi Jakub. Sounds good - thanks for the consideration! I'll continue testing the GL2 Mesa as well as the GLES2 driver and will report any fallout..

Contributor

gohai commented Aug 21, 2015

Hi Jakub. Sounds good - thanks for the consideration! I'll continue testing the GL2 Mesa as well as the GLES2 driver and will report any fallout..

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Aug 22, 2015

Contributor

Thanks @gohai for your support, it's greatly appreciated!

Contributor

JakubValtar commented Aug 22, 2015

Thanks @gohai for your support, it's greatly appreciated!

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