mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-11-03 10:31:10 +08:00
internal/graphicsdriver/opengl: Give up restorign on browsers
Using restorable images is expensive as this sometimes requires to load pixels from GPU. On browsers, just reloading the application should be fine when the context lost happens. Closes #1603
This commit is contained in:
@@ -23,7 +23,6 @@ import (
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/opengl/gles"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/jsutil"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/shaderir"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/web"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -85,7 +84,6 @@ const (
|
||||
|
||||
var (
|
||||
isWebGL2Available = !forceWebGL1 && (js.Global().Get("WebGL2RenderingContext").Truthy() || js.Global().Get("go2cpp").Truthy())
|
||||
needsRestoring = !web.IsMobileBrowser() && !js.Global().Get("go2cpp").Truthy()
|
||||
)
|
||||
|
||||
type contextImpl struct {
|
||||
@@ -526,7 +524,8 @@ func (c *context) flush() {
|
||||
}
|
||||
|
||||
func (c *context) needsRestoring() bool {
|
||||
return needsRestoring
|
||||
// Though it is possible to have a logic to restore the graphics data for GPU, do not use it for performance (#1603).
|
||||
return false
|
||||
}
|
||||
|
||||
func (c *context) canUsePBO() bool {
|
||||
|
||||
Reference in New Issue
Block a user