Open hajimehoshi opened 1 week ago
Probably commenting is better since any library can prepare this without waiting for Ebitengine 2.9.
//ebitengine:shader
const superUltraShader = "package main
func Fragment(..."
Add a new field to provide compilation results like GLSL
, HLSL
, and MSL
.
See also: https://github.com/hajimehoshi/ebiten/commit/48f79af884f947c83ccfa5baceafeb53e27dcdb7
Operating System
What feature would you like to be added?
In order to introduce shader precompilation, we need to know what shader sources are used. We have to list them before the compilation. Listing them by users would not be a good solution since unknown dependencies might use shaders internally, and users couldn't know them.
In order to resolve this issue, what about this?
ebiten.RegisterShader(src []byte)
(orstring
?). This function is just a marker and does nothing.RegisterShader
, and output them as JSON or something.Libralies using shaders would have to call
RegisterShader
to precompile the shader source, but it should be much better than having to export shader sources as a public API.Why is this needed?
No response