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

“WARNING: Illegal reflective access by processing.opengl.PSurfaceJOGL” on getContextCapabilities() #50

Closed
benfry opened this issue Jan 19, 2020 · 12 comments · Fixed by #76
Assignees

Comments

@benfry
Copy link
Owner

benfry commented Jan 19, 2020

This is not the same as #22, which is another WARNING: Illegal reflective access message.

Due to the workaround for processing/processing#4104, we've got a reflection hack that spews a big warning.

The hack involves getting the name of the hardware so that we can add a workaround for Intel HD Graphics 3000 devices.

Not sure if we're free to nix the hack for 4.x (though it only recently went into 3.x), or perhaps there's another way to get hardware information.

@neilcsmith-net
Copy link

If all you want to do is nix the warning, then passing some --add-opens should do it.

@sampottinger
Copy link
Collaborator

Hey! Started poking around to see what we can do without ‘sun.java2d’. It looks hard generally speaking without JNA to migrate out. However, the JavaCL folks might have it sorted. Seems a bit excessive to include JavaCL for that but maybe could help point us in the right direction even if we don’t use the full lib. I’ll play with it a bit. All that said, not sure if knowing the graphics card is helpful anywhere else...

@benfry
Copy link
Owner Author

benfry commented Jan 26, 2020

Yeah, this is a messy one because it’s old hardware (meaning that it gets less relevant as that equipment is replaced) but it was used on a lot of apple machines, so there’s a large (or at least very vocal) installed base.

Is there a JNA approach? I’d be more inclined to move that into core than OpenCL, since it’d be useful elsewhere (hidpi detection, display resolutions, menubar hacks, etc...)

@sampottinger
Copy link
Collaborator

@sampottinger sampottinger self-assigned this Jan 27, 2020
@neilcsmith-net
Copy link

@sampottinger doesn't JOGL already have an API that gives you this information?! As does LWJGL.

Still think you'll have fun trying to remove all warnings right now - and most of those are probably as safe to use for now as they ever were - ie. not! 😄

@sampottinger
Copy link
Collaborator

Thanks @neilcsmith-net! I looked into JOGL (GLProfile) and it wasn't clear to me that this information was accessible. Do you have the API reference for JOGL or LWJGL that you had in mind? Thanks!

@neilcsmith-net
Copy link

@sampottinger well, isn't the same information available in PGraphicsOpenGL at https://github.com/processing/processing4/blob/master/core/src/processing/opengl/PGraphicsOpenGL.java#L6884 This is set using the OpenGL API (JOGL or LWJGL). It's a little later checking, but early enough I think? It's where the Pi workarounds are.

@sampottinger
Copy link
Collaborator

Sorry I dropped the thread on this one... Anyway, thank you @neilcsmith-net!

Yeah I can find what I'm looking for pretty easily if I have the GL context already active. For the folks following along at home, consider this sketch:

import com.jogamp.opengl.*;

void setup() {
  size(100, 100, P3D);
  GL gl = GLContext.getCurrentGL(); 
  println(gl.glGetString(GL.GL_VENDOR));
  println(gl.glGetString(GL.GL_RENDERER));
}

void draw() {}

That said, inside Processing, this is happening up at initDisplay inside PSurfaceJOGL which I think was intended to happen before initGL. Now that I am taking a closer look though, I'm not sure if there is a reason fboAllowed has to be part of initDisplay. I'll move it and we should (?) be good to go.

@sampottinger
Copy link
Collaborator

Blocked on #73.

sampottinger added a commit that referenced this issue Mar 14, 2020
Move checking for frame buffer object support from PSurfaceJOGL to PGL, closing a TODO in PGL and removing dependency on reflexive access. Note that this does require subclasses of PGL to use or override getIsFboAllowed instead of direct access to fboAllowed. This will require checking in with @benfry.

Resolves #50.
@sampottinger
Copy link
Collaborator

Posted possible solution at #76! :D

@benfry
Copy link
Owner Author

benfry commented Apr 27, 2020

Should be fixed in cc39c94

@benfry benfry closed this as completed Apr 27, 2020
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants