hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
11.1k stars 665 forks source link

internal/graphicsdriver/opengl: precompile Kage to GLSL for bulitin shaders #3035

Open hajimehoshi opened 4 months ago

hajimehoshi commented 4 months ago

Operating System

What feature would you like to be added?

Compiling Kage to GLSL shader takes a little cost.

image

So, what about precompiling bulitin Kage shaders to GLSL? Unfortunately we cannot precompile GLSL to a binary form, so if we do, we prepare a GLSL source.

This is similar to #2984.

Why is this needed?

No response

hajimehoshi commented 2 months ago

From #3078, getProgramParameter takes much longer than compiling shaders. Precompiling Kage shader is a little risky as fixing the shader parser might not be reflected to the precompiled shaders accidentally.

Let's revisit this later.