-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fixes #1272 - Improve GLDebugDesktop by reducing manual overrides #1276
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
Conversation
|
I forgot to add the changes to LWJGL3, will force-push shortly. Edit: I think we could do even better and only have GLDebug which can then be invoked for Desktop OR ES (in case of ES, the only thing different is that we have to add |
5485e1f to
9a50669
Compare
|
Before we can integrate this, we need to upgrade the NDK version. |
|
Do you talk about the build failure stemming from #1281 ? |
|
I was assuming the build failure was something more serious. Go ahead and rebase then, and we'll see. |
… to the openGL API to reduce Code Duplication and increase Maintainability, while also fixing the regression caused by GLDebugDesktop extending from GLDebugES and thus making the Renderer think it is on mobile.
9a50669 to
12481c0
Compare
|
Sorry it's taken me so long to look at this and thanks for being patient. It mostly looks good. A concern I have is that code that used to create on gl object and then cast it to different fields is now creating three separate proxies. I don't really know how/where these fields are used and haven't had time to look, but any code expecting them to be the same object (or expecting to be able to case glfbo to GL4 or whatever) is going to fail where it would have succeeded before. Perhaps we are correct to enforce this and I guess it would only break if they turn debugging on... and then they could see their error and correct it. Otherwise, the changes look good to me. |
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { | ||
| Object result = method.invoke(obj, args); | ||
|
|
||
| if (method.getName().equals("glGetError")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pspeed42 Actually I just stumbled over this:
Do you think it would be more wise to lookup the Method object and use equals there instead of comparing the string all the time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure it would be slightly faster, I guess, if the method is looked up at proxy creation time. I wasn't overly concerned about it since this is a debugging class.
I'm ok if that's a follow-on improvement, too.
|
What is the status for this? |
|
I need to change the if to be Method based and think about the separate proxies first, so this is mostly a "draft" |
…se the performance
|
I looked through the concern of having multiple proxies and: That means, I'm fine with breaking code that relied on glfbo = gl = glext only on debug. |
…force a crash when glGetError is not present.
|
@pspeed42 Any objections based on the fact that I throw an unchecked exception when glGetError cannot be found? |
|
IllegalStateException isn't really the right exception here. If you want to avoid a naked RuntimeException (and that's probably a good idea), IllegalArgumentException is probably better. ie: the caller passed a GL context that is incompatible with this debugger. |
|
Fixed in v3.3 branch at 4c2c3fa. |
Use a reflection-based approach to call checkError() after every call to the openGL API to reduce Code Duplication and increase Maintainability, while also fixing the regression caused by GLDebugDesktop extending from GLDebugES and thus making the Renderer think it is on mobile.
As discussed, if I should make this version more dynamic to support GLFbo and GLExt as separate GLDebugDesktop instances, I can do that, but having the if statement probably isn't that bad, but I can see that it is better and more flexible and especially gets rid of the exception in line 73