MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetDeviceRemovedReasonString

Function GetDeviceRemovedReasonString

trinity/TriDevice12.cpp:23–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21{
22
23std::string GetDeviceRemovedReasonString( HRESULT hr )
24{
25 std::stringstream reason;
26 switch( hr )
27 {
28 case DXGI_ERROR_DEVICE_HUNG:
29 reason << "DXGI_ERROR_DEVICE_HUNG: ";
30 break;
31 case DXGI_ERROR_DEVICE_REMOVED:
32 reason << "DXGI_ERROR_DEVICE_REMOVED: ";
33 break;
34 case DXGI_ERROR_DEVICE_RESET:
35 reason << "DXGI_ERROR_DEVICE_RESET: ";
36 break;
37 case DXGI_ERROR_DRIVER_INTERNAL_ERROR:
38 reason << "DXGI_ERROR_DRIVER_INTERNAL_ERROR: ";
39 break;
40 case DXGI_ERROR_INVALID_CALL:
41 reason << "DXGI_ERROR_INVALID_CALL: ";
42 break;
43 default:
44 reason << "HRESULT: ";
45 break;
46 }
47 reason << "0x" << std::setfill( '0' ) << std::setw( 8 ) << std::hex << (uint32_t)hr;
48 return reason.str();
49}
50
51void NotifyDeviceRemoved( HRESULT hr, BlueScriptCallback& onDeviceRemoved )
52{

Callers 1

NotifyDeviceRemovedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected