mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 00:16:15 +00:00
gpu/internal/opengl: save and restore GL state only for shared contexts
Most Gio programs have exlusive access to their OpenGL contexts, where saving and restoring of the GL state is not required. This change applies to all OpenGL platforms, but matters most for WASM where syscalls are slow. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -50,6 +50,9 @@ type OpenGL struct {
|
||||
// empty for all other platforms; an OpenGL context is assumed current when
|
||||
// calling NewDevice.
|
||||
Context gl.Context
|
||||
// Shared instructs users of the context to restore the GL state after
|
||||
// use.
|
||||
Shared bool
|
||||
}
|
||||
|
||||
type Direct3D11 struct {
|
||||
|
||||
Reference in New Issue
Block a user