Documentation
¶
Overview ¶
Package shadercache keeps what the GPU drivers compile for Glutter between runs: the binaries of the OpenGL ES programs and the pipeline cache of Vulkan (SPEC §9.7). It is a directory of files; a file is named by the hash of its key, and is written whole or not at all. A cache that cannot be read or written is reported once and ignored: the drivers compile again, as they did before the cache.
Flutter: no counterpart
Index ¶
Constants ¶
const EnvVar = "GLUTTER_SHADER_CACHE"
EnvVar is the environment variable that turns the cache off when it is "0".
Flutter: no counterpart
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
Dir is the directory of the cache on Linux and the other Unix systems: $XDG_CACHE_HOME/glutter/shaders, or ~/.cache/glutter/shaders; empty when the cache is turned off (EnvVar is "0") or the environment names no home (the web). Windows keeps the cache under %LOCALAPPDATA% (DirUnder); the engine chooses (SPEC §9.7).
Flutter: no counterpart
func DirUnder ¶
DirUnder is the directory of the cache under the user's cache directory of the operating system: base/glutter/shaders. Windows uses it with %LOCALAPPDATA%, which is what os.UserCacheDir returns there (SPEC §9.7). It is empty when the cache is turned off (EnvVar is "0") or base is empty (the environment names no such directory).
Flutter: no counterpart
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a directory of cached binaries. It is used from the UI thread, as the renderers are.
Flutter: no counterpart
func New ¶
New makes a cache in the directory. The directory is made when the first file is stored. report receives the first error of the cache (a file that cannot be read or written) and none after it; it may be nil.
Flutter: no counterpart