mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
internal/graphicsdriver/directx: refactoring: reduce indentations
This commit is contained in:
parent
fe5c3354fc
commit
549e6120b5
@ -173,11 +173,20 @@ func (g *graphics12) initializeDesktop(useWARP bool, useDebugLayer bool, feature
|
||||
}()
|
||||
|
||||
var adapter *_IDXGIAdapter1
|
||||
if len(adapters) > 0 {
|
||||
if useWARP {
|
||||
if len(adapters) > 0 {
|
||||
adapter = adapters[0]
|
||||
}
|
||||
} else {
|
||||
for _, a := range adapters {
|
||||
desc, err := a.GetDesc1()
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if desc.Flags&_DXGI_ADAPTER_FLAG_SOFTWARE != 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
// Test D3D12CreateDevice without creating an actual device.
|
||||
if _, err := _D3D12CreateDevice(unsafe.Pointer(a), featureLevel, &_IID_ID3D12Device, false); err != nil {
|
||||
continue
|
||||
@ -186,7 +195,6 @@ func (g *graphics12) initializeDesktop(useWARP bool, useDebugLayer bool, feature
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if adapter == nil {
|
||||
return errors.New("directx: DirectX 12 is not supported")
|
||||
|
Loading…
Reference in New Issue
Block a user