Coherent UI  2.5.3
A modern user interface library for games
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Using Multiple GPUs
Note
this is a Windows-only feature

If you want to use more than one GPU for rendering the UI, you should create different Coherent::UI::ViewContext for each different GPU you wish to use. For example, let us have 3 GPUs on the system. Their ordinal numbers would be 0, 1 and 2; with 0 being the primary display adapter. In this case, if you want to do the UI rendering using GPUs with ordinal numbers 1 and 2, you should pass to the DisplayAdapterID memeber of Coherent::UI::ContextSettings, the ordinal number of the GPU. Here's the sample code:

ctxSettings[0].DisplayAdapterId = 1;
//Initialize other settings of the first context
//...
context[0] = g_Factory->CreateViewContext(
ctxSettings[0],
&g_EventListener,
nullptr);
ctxSettings[1].DisplayAdapterId = 2;
//Initialize other settings of the second context
//...
context[1] = g_Factory->CreateViewContext(
ctxSettings[1],
&g_EventListener,
nullptr);

By default, view contexts use the primary display adapter (which has an ordinal number 0). So if you want to use the primary display adapter for a particular Coherent::UI::ViewContext you can by-pass filling-in the DisplayAdapterID member.

Note
if you pass to DisplayAdapterID an ordinal number exceeding the number of GPUs in the system you will get an error in the log about this, and no rendering will take place for this context.