Search code examples
c++winapidesktopdxgi

How to query true display bit depth under Windows 10?


I'm struggling to find any win32 api call that can correctly identify the bit depth of a connected monitor in terms of bits per channel. The attached screenshot shows the setting visible.

With DXGI it is possible to enumerate all modes on an output and identify their bit depth easily, however there is no call to get the current mode.

All current win32 calls which return bitsPerPel always indicate 32bpp.

Does anybody know which call can get this data? I can detect this with NvAPI and ADL however have no solution for intel based machines.

I would additionally be interested in the active signal resolution vs desktop resolution field and how to retrieve these.

1


Solution

  • DXGI_OUTPUT_DESC1 structure gets you that:

    BitsPerColor

    Type: UINT

    The number of bits per color channel for the active wire format of the display attached to this output.

    The DXGI_OUTPUT_DESC1 structure is initialized by the IDXGIOutput6::GetDesc1 method.

    Just an example of what sort of data you get there:

    --

    Adapter: Radeon RX 570 Series

    Output: \.\DISPLAY4
    • Desktop Coordinates: (0, 0) - (3840, 2160); 3840 x 2160
    • Attached To Desktop: 1
    • Rotation: DXGI_MODE_ROTATION_IDENTITY
    • Monitor: 0x000100AF
    • Physical Monitors: LG ULTRA HD(DisplayPort) (0x00000000)
    • Bits Per Color: 10 <<----------------------------------
    • Color Space: DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
    • Primaries, White Point: R { 0.652, 0.335 }, G { 0.305, 0.637 }, B { 0.148, 0.062 }; { 0.313, 0.329 }
    • Luminance: Min 0.500, Max 270.000, Max Full Frame 270.000
    • Hardware Composition Support: DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_FULLSCREEN | DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_CURSOR_STRETCHED

    enter image description here