Solving Minecraft SEUS Shader `OpenGL error: 1282 (Invalid operation)` on Linux (Steam Deck, MESA Driver)
2023-01-20
Being strict is not always good.
I opened Minecraft and tried to add a shader on my Steam Deck, but it rendered a weird not-textured scene.
Optifine reported an error in the console OpenGL error: 1282 (Invalid operation)
.
So according to the blog, remove the const
keyword from gbuffers_textured.fsh
(~line 240):
- const float K_R = 0.186 * rayleighAmount;
- const float K_M = 0.035 * mieAmount;
+ float K_R = 0.186 * rayleighAmount;
+ float K_M = 0.035 * mieAmount;
Similarly, in Common.inc
(~line 220):
- const float K_R = 0.186 * rayleighAmount;
- const float K_M = 0.035 * mieAmount;
+ float K_R = 0.186 * rayleighAmount;
+ float K_M = 0.035 * mieAmount;
Ref: SEUS Renewed1.0.0のInvalid programエラー解決法 | サイバー×サイバー
I also have another error saying:
error: no function with name 'texture2DLod'
After doing some googling, I add these at the beginning of Common.inc
:
+ #extension GL_ARB_shader_texture_lod : require
No errors anymore.
Ref: https://github.com/trzy/Supermodel/issues/4
It seems like the MESA driver implies the OpenGL standard more strictly than others, so these miss-coding codes can run perfectly on Windows but not on Linux.