mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/graphicsdriver/directx: refactoring: remove redundant adapter check
This commit is contained in:
parent
72c9ede592
commit
4779bbc04d
@ -133,8 +133,10 @@ func (g *graphicsInfra) release() {
|
||||
|
||||
// appendAdapters appends found adapters to the given adapters.
|
||||
// Releasing them is the caller's responsibility.
|
||||
func (g *graphicsInfra) appendAdapters(adapters []*_IDXGIAdapter1, warp bool) ([]*_IDXGIAdapter1, error) {
|
||||
if warp {
|
||||
//
|
||||
// warpForDX12 is valid only for DirectX 12.
|
||||
func (g *graphicsInfra) appendAdapters(adapters []*_IDXGIAdapter1, warpForDX12 bool) ([]*_IDXGIAdapter1, error) {
|
||||
if warpForDX12 {
|
||||
a, err := g.factory.EnumWarpAdapter()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -152,14 +154,6 @@ func (g *graphicsInfra) appendAdapters(adapters []*_IDXGIAdapter1, warp bool) ([
|
||||
return nil, err
|
||||
}
|
||||
|
||||
desc, err := a.GetDesc1()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if desc.Flags&_DXGI_ADAPTER_FLAG_SOFTWARE != 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
adapters = append(adapters, a)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user