AdamRaichu / suppress-OpenGL-1280

A simple Minecraft Fabric mixin which disables the error spam of OpenGL debug message to the log.
https://modrinth.com/mod/suppressopengl1280
GNU General Public License v3.0
2 stars 1 forks source link

"GL ERROR 65539: Invalid key -1" Suppression #4

Open berkkrkc09 opened 2 months ago

berkkrkc09 commented 2 months ago

I get this error:

[14:15:07] [Render thread/ERROR]: ########## GL ERROR ##########
[14:15:07] [Render thread/ERROR]: @ Render
[14:15:07] [Render thread/ERROR]: 65539: Invalid key -1

latest.log

Is it possible for you to suppress this too? I couldn't find much info to fix the error myself but the game runs fine until the log gets too long/big and then it starts stuttering.

If no, you could point me in the right direction to suppress it. Then I would be happy to try and do it myself.

AdamRaichu commented 2 months ago

Could you run this again, but with stack trace enabled? I want to figure out which part of the game's code this is coming from.

Also, could you give me your options.txt?

berkkrkc09 commented 2 months ago

Here they are: options.txt latest.log with "No Error Context" option disabled. I forgot I had it checked. I hope That enabled the stack trace, if not I have no idea how to enable it.

AdamRaichu commented 2 months ago

Kind of a weird question, but how many buttons does your mouse have? Your keybindings say you have toggle perspective to mouse.4 and spyglass-improvements.use to mouse.5.

If you only have the normal three buttons (left, right, and middle), change those settings by manually editing options.txt and then starting MC.

https://gist.github.com/berkkrkc09/512f54757267c0ecab32fc370fb3c172#file-options-txt-for-gl-error-L108

https://gist.github.com/berkkrkc09/512f54757267c0ecab32fc370fb3c172#file-options-txt-for-gl-error-L191

berkkrkc09 commented 2 months ago

My mouse has 8 buttons. 3 standard, 2 additional on top side, 3 on the left side. I did bind them, in Minecraft, myself. Are they causing issues?

AdamRaichu commented 2 months ago

My mouse has 8 buttons. 3 standard, 2 additional on top side, 3 on the left side. I did bind them, in Minecraft, myself. Are they causing issues?

Probably not since those buttons actually exist, but funnily enough, the GLFW error with the same id has to do with nonexistent keys apparently. (Searching minecraft 65539 on Google shows this as the top result, so I just wanted to make sure that wasn't the problem lol.)

I will take a peek in the source code to see if I can find where this error is coming from, because stack trace didn't end up being helpful.

berkkrkc09 commented 2 months ago

Actually, I did see that while looking for a fix for the error. There is usually more information about gl errors. I'm very surprised that there is nothing about this particular one.

berkkrkc09 commented 2 months ago

Hey, I noticed that the error appears in the log just as I click "a key"/"any key" on my keyboard. It doesn't happen with the mouse though. I left the console open just to see when it was logged, and the error happens while doing anything(moving, in inventory, etc.) Each line of those errors in the log corresponds to a single key click. I don't know what to make out of this but I hope it helps.

AdamRaichu commented 2 months ago

I found the method that the errors are being logged from. This is from net.minecraft.client.util.Window (fabric 1.20.4 build).

    public void logGlError(int error, long description) {
        RenderSystem.assertOnRenderThread();
        String string = MemoryUtil.memUTF8(description);
        LOGGER.error("########## GL ERROR ##########");
        LOGGER.error("@ {}", (Object)this.phase);
        LOGGER.error("{}: {}", (Object)error, (Object)string);
    }

This should be relatively easy to mute.

berkkrkc09 commented 2 months ago

Oh, this is great news. Thank you for dedicating your time to this. I don't know if you want this issue closed now or later so you can close it if you want. \^o^/