internal/graphicsdriver/directx: bug fix: check the error at CreateGraphicsPipelineState at initialization

CreateGraphicsPipelineState someitmes causes an error
DXGI_ERROR_DEVICE_HUNG, but we failed to know why.

Instead of fixing this, check the error earlier and use the fallback
grpahics library OpenGL in this case.

Updates #2198
This commit is contained in:
Hajime Hoshi 2022-07-29 16:20:07 +09:00
parent 3eeb401d22
commit c183555cc8

View File

@ -294,6 +294,11 @@ func (g *Graphics) initializeDesktop(useWARP bool, useDebugLayer bool) (ferr err
} }
i.Dispose() i.Dispose()
// Check whether an unexpected error happens or not: DXGI_ERROR_DEVICE_HUNG (#2198).
if _, err := g.pipelineStates.builtinGraphicsPipelineState(g.device, builtinPipelineStatesKey{}); err != nil {
return err
}
return nil return nil
} }