DonnEssime / Custom-Salem

client for Salem MMO
Other
7 stars 9 forks source link

GL would throw GL.GL_INVALID_ENUM when running over RDP session #40

Closed TopStreamsNet closed 8 years ago

TopStreamsNet commented 8 years ago

java.lang.RuntimeException: haven.GOut$GLInvalidEnumException: GL Error: 1280 (invalid enumerant) at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58) at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103) at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206) at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172) at javax.media.opengl.Threading.invoke(Threading.java:191) at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:528) at haven.HavenPanel.uglyjoglhack(HavenPanel.java:420) at haven.HavenPanel.run(HavenPanel.java:455) at java.lang.Thread.run(Unknown Source) Caused by: haven.GOut$GLInvalidEnumException: GL Error: 1280 (invalid enumerant) at haven.GOut.glexcfor(GOut.java:96) at haven.GOut.checkerr(GOut.java:107) at haven.GLState$Applier.apply(GLState.java:530) at haven.GOut.apply(GOut.java:203) at haven.PView.draw(PView.java:242) at haven.MapView.draw(MapView.java:1119) at haven.GameUI.drawFiltered(GameUI.java:659) at haven.GameUI.draw(GameUI.java:667) at haven.Widget.draw(Widget.java:514) at haven.Widget.draw(Widget.java:519) at haven.RootWidget.draw(RootWidget.java:183) at haven.UI.draw(UI.java:165) at haven.HavenPanel.redraw(HavenPanel.java:298) at haven.HavenPanel$2.display(HavenPanel.java:94) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:649) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:633) at javax.media.opengl.awt.GLCanvas$9.run(GLCanvas.java:1271) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1103) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:978) at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1282) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

Initial root cause points to Light.Model.apply() and particularly: gl.glLightModeli(GL2.GL_LIGHT_MODEL_COLOR_CONTROL, cc);

adding a checkerr after that call escalates the issue

DonnEssime commented 8 years ago

i'm not completely familiar with RDP (only ever use X forwarding, and that is limited), but I would assume it is because the RDP graphics are software-rendered rather than hardware ? That way, your software wouldn't provide support for the GL capabilities that are required by the client.

TopStreamsNet commented 8 years ago

Thing is - it runs perfectly fine under RDP if in GOut.glexcfor I remove check for invalid enumeration. You are obviously right about SW render causing problem with GL, it's just that it seems to be not critical and I guess can be fixed in a cleaner way than just ignoring the issue. Currently the hack to make it work under RDP is: public static void checkerr(GL gl) { int err = gl.glGetError(); if(err != 0 && err !=GL.GL_INVALID_ENUM) // FIXME: INVALID ENUM under RDP throw(glexcfor(err)); }

DonnEssime commented 8 years ago

I will not be changing this in the client source code: the same error is given in some other cases when other things are wrong, and the "gaming over RDP" is so much of a niche that I shouldn't and wouldn't cater to it.

Thanks for reporting and following up.