Graphics: a GPU preference API on GraphicsAdapter, and full screen on a hybrid laptop

Aperta
#3,428 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

Inizia con GraphicsAdapterFactory e le implementazioni di GraphicsAdapter, poi segui GameGraphicsParameters, GraphicsDeviceManager e FindBestDevices; esamina #3388 per la correzione esistente per i laptop ibridi. Il lavoro è completo quando vengono riportati i dati degli adapter e i ranghi dei backend, la preferenza della GPU viene trasmessa durante la creazione del dispositivo senza stato globale mutabile e il comportamento a schermo intero sui laptop ibridi è definito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area-Graphics enhancement
Summary

Follow-up to #3388, from @xen2's review there. Stride has no way to choose which GPU a game runs on beyond GraphicsDeviceManager.RequiredAdapterUid. #3388 first proposed a GraphicsAdapterFactory.GpuPreference static (an enum plus Reset()), which was withdrawn from that PR: a mutable static that changes what GraphicsAdapterFactory.Adapters returns, and a Reset() that disposes adapters a live GraphicsDevice may still use, is not the right shape.

Proposed direction (xen2)

GraphicsAdapterFactory reports what the system has, untouched, with facts on each GraphicsAdapter:

public enum GraphicsAdapterType { Unknown, Integrated, Discrete, Virtual, Software }

public GraphicsAdapterType Type { get; }   // set by each backend
public int AdapterOrder { get; }           // system enumeration order; 0 is the system default
public bool IsDefaultAdapter => AdapterOrder == 0;
public int PerformanceRank { get; }        // platform's fastest-first order; 0 is the fastest
public int PowerEfficiencyRank { get; }    // platform's most-efficient-first order; 0 is the most efficient
  • Direct3D fills the ranks from DXGI EnumAdapterByGpuPreference (HighPerformance and MinimumPower orders).
  • Vulkan fills them from VkPhysicalDeviceType: Discrete > Integrated > Virtual > Cpu for performance, Integrated first for efficiency.
  • The preference itself lives with the other creation settings, in GameGraphicsParameters then GraphicsDeviceManager (e.g. PreferredGpu), and FindBestDevices sorts by the matching rank. Device creation stops depending on a mutable static.
Also to settle
  • Full screen on a hybrid laptop: an adapter with no output produces no full-screen candidate in FindBestDevices, so a game that starts full screen lands on the integrated GPU while the same game windowed lands on the discrete one. Exclusive full screen on an output-less adapter is not possible in DXGI, so the expected behaviour is probably borderless full screen on the chosen adapter rather than an output lookup.
Related
  • #3388 keeps only the bug fix: the discrete GPU of a hybrid laptop is no longer skipped, and Vulkan enumerates the discrete GPU first as Direct3D already did.
Lingua principale
C#
Stelle
8k
Fork
1.2k
Merge medio
2g 7h
PR unite (30g)
316

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di stride3d/stride

Tutte le issue di stride3d/stride

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.