This is wrong. adapters in sysparams.c are GDI adapters, they are not the same adapter in D3DKMT terms. Adapters in D3DKMT terms mean GPUs. So you need to add a list of GPUs to the cache and then do enumeration from that.
Ah, okay, I see. I was unaware of GDI having a different concept of adapters than D3D(KMT), my bad there :sweat_smile:
You should do the initialization from the SetupAPI registry data. For example, basically with the following code. However, since you're in win32u. You can't use SetupAPI directly and you need to convert these to NT registry calls instead. See prepare_devices() for some example code for how to do it.
Thanks, I'll see if I can figure this out.
Then `NumOfSources` is the number of GDI adapters with the same GPU LUID.
Okay. From what I've observed, on Windows (checking 2 separate machines), it seems to be constant 4 for adapters that represent physical GPUs and 0 for adapter that seems to represent Microsoft's Basic Render thingy.
As for bPrecisePresentRegionsPreferred, I guess you can just return TRUE.
For what it's worth, I haven't seen any adapter to report `TRUE` here on Windows. So it might be safer to default to `FALSE` instead.
The GPU list construction can be done in update_display_cache_from_registry().
Got it, thanks.