internal/graphicsdriver/directx: add comments

Updates #2142
This commit is contained in:
Hajime Hoshi 2022-06-17 12:19:32 +09:00
parent 2f84e77e74
commit b43312fe80

View File

@ -33,6 +33,8 @@ import (
const frameCount = 2
// NewGraphics creates an implementation of graphicsdriver.Graphcis for DirectX.
// The returned graphics value is nil iff the error is not nil.
func NewGraphics() (graphicsdriver.Graphics, error) {
const is64bit = uint64(^uintptr(0)) == ^uint64(0)
@ -160,6 +162,9 @@ func (g *Graphics) initialize() (ferr error) {
}
}
// Initialize not only a device but also other members like fences.
// Even if initializing a device succeeds, initializing a fence might fail (#2142).
if microsoftgdk.IsXbox() {
if err := g.initializeXbox(useWARP, useDebugLayer); err != nil {
return err