diff options
| author | Ptolemy <ptolemy@lindenlab.com> | 2020-04-27 15:30:54 -0700 | 
|---|---|---|
| committer | Ptolemy <ptolemy@lindenlab.com> | 2020-04-27 15:30:54 -0700 | 
| commit | 88eca95208b7510196bcbc8a9fdcf11653aa3506 (patch) | |
| tree | 0435fffa08ee977bb3ea195d83e036b601e9f61c | |
| parent | 1062efd059874ddce380bfa9d2305bcd85127a16 (diff) | |
SL-12971: Add logging of Display Devices -- useful on dual GPU machines
| -rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 31 | 
1 files changed, 31 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 3c69aa98c4..4a13c73c8c 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -676,6 +676,37 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,  	//		TrackMouseEvent( &track_mouse_event );   	//	} +    // SL-12971 dual GPU display +    DISPLAY_DEVICEA display_device; +    int             display_index = -1; +    DWORD           display_flags = 0; // EDD_GET_DEVICE_INTERFACE_NAME ? +    const size_t    display_bytes = sizeof(display_device); + +    do +    { +        if (display_index >= 0) +        { +            // CHAR DeviceName  [ 32] Adapter name +            // CHAR DeviceString[128] +            CHAR text[256]; + +            size_t name_len = strlen(display_device.DeviceName  ); +            size_t desc_len = strlen(display_device.DeviceString); + +            CHAR *name = name_len ? display_device.DeviceName   : "???"; +            CHAR *desc = desc_len ? display_device.DeviceString : "???"; + +            sprintf(text, "Display Device %d: %s, %s", display_index, name, desc); +            LL_INFOS("Window") << text << LL_ENDL; +        } + +        ::ZeroMemory(&display_device,display_bytes); +        display_device.cb = display_bytes; + +        display_index++; +    }  while( EnumDisplayDevicesA(NULL, display_index, &display_device, display_flags )); + +    LL_INFOS("Window") << "Total Display Devices: " << display_index << LL_ENDL;  	//-----------------------------------------------------------------------  	// Create GL drawing context  | 
