Vixen
02b45cc4
csharp
public static class GraphicsHost

Choosing a graphics device, and saying which one was chosen and why.

Read the guide page for this →

Remarks

PlatformHost's counterpart: it walks Backends in order, asks each candidate to open, and returns the first that does. A head that wants a device it already owns hands one to WithGraphics and never reaches this; a head that wants an API this package does not reference implements IGraphicsBackend itself.

⚠ Every rejection is reported, not just the last. A chain that fell all the way through used to leave one sentence about whichever candidate happened to be final, which is the least useful of the answers available — "no Vulkan" says nothing about why WebGPU was not used either. Create joins them, so one log line explains the whole decision.

The fallback to a device that draws nothing is opt-in, and is not a failure. Doc 17 makes Vixen.Graphics.Null a shipping backend rather than only a test one: it is what the dedicated server runs on, and running the whole frame against it is what keeps a server and a client one program rather than two code paths that drift. It happens when Null is in the list — which Default puts there — and not otherwise, because an operator who asked for Vulkan alone is owed the answer rather than a silent downgrade.

Fields and properties (2)

  • public static IReadOnlyList<GraphicsBackend> Default

    What is tried when an application named no preference.

  • public static IGraphicsBackend Instance

    This class as an IGraphicsBackend, which is what a builder takes.

Methods (4)

Used by (3)

  • AppBackendTestsVixen.App.Tests
  • BackendVixen.App
  • VixenAppVixen.App