mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/graphicsdriver/directx: bug fix: a software adaptor was unexpectedly chosen
Closes #2459
This commit is contained in:
parent
4c389c1752
commit
c7c9500ba6
@ -247,9 +247,8 @@ func (g *Graphics) initializeDesktop(useWARP bool, useDebugLayer bool) (ferr err
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer a.Release()
|
defer a.Release()
|
||||||
adapter = a
|
|
||||||
|
|
||||||
desc, err := adapter.GetDesc1()
|
desc, err := a.GetDesc1()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -259,9 +258,11 @@ func (g *Graphics) initializeDesktop(useWARP bool, useDebugLayer bool) (ferr err
|
|||||||
// Test D3D12CreateDevice without creating an actual device.
|
// Test D3D12CreateDevice without creating an actual device.
|
||||||
// Ebitengine itself doesn't require the features level 12 and 11 should be enough,
|
// Ebitengine itself doesn't require the features level 12 and 11 should be enough,
|
||||||
// but some old cards don't work well (#2447). Specify the level 12 here.
|
// but some old cards don't work well (#2447). Specify the level 12 here.
|
||||||
if _, err := _D3D12CreateDevice(unsafe.Pointer(adapter), _D3D_FEATURE_LEVEL_12_0, &_IID_ID3D12Device, false); err != nil {
|
if _, err := _D3D12CreateDevice(unsafe.Pointer(a), _D3D_FEATURE_LEVEL_12_0, &_IID_ID3D12Device, false); err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
adapter = a
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user