app: recover from transient Present errors

Some GPU APIs such as Direct3D can return an error after drawing
a frame indicating a transient device error. Recreate device and
retry if it happens.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-26 22:50:05 +01:00
parent 29d36e11ee
commit 6213daa3e9
2 changed files with 40 additions and 29 deletions
+5
View File
@@ -40,6 +40,11 @@ type Context interface {
Unlock()
}
// ErrDeviceLost is returned from Context.Present when
// the underlying GPU device is gone and should be
// recreated.
var ErrDeviceLost = errors.New("GPU device lost")
// Driver is the interface for the platform implementation
// of a window.
type Driver interface {