Vixen
02b45cc4
csharp
public interface IWebGpuBinding

How WebGPU is reached.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

WebGPU is one API with two entirely unrelated ways in. Silk.NET.WebGPU binds webgpu.h, which Dawn and wgpu-native implement and which a browser does not expose at all; a browser reaches WebGPU through navigator.gpu and JavaScript. So docs/plan/05 asks for two surface implementations behind one backend, and this is the seam between them.

Called a binding rather than a surface only because SurfaceHandle already means "a window to present to" everywhere else in this engine, and a type named IWebGpuSurface that was not about windows would be read wrongly by everyone.

Everything above this line is shared. Translation, validation, handle lifetime, deferred destruction, the recorded command stream and its replay are all written against this interface, which is what makes the browser surface a few hundred lines of interop rather than a second backend — and what makes the whole translation layer testable against a fake, on a machine with no GPU. The implementations own marshalling and nothing else: not one of these methods decides anything.

The methods are fine-grained because replay is shared. In a browser each call crosses the interop boundary, which is not free; the recorded stream is a flat array of blittable structs precisely so a future bulk path can hand the whole thing over at once without disturbing anything above.

Fields and properties (4)

  • WebGpuAdapterInfo AdapterInfo

    What the implementation says about the adapter.

  • WebGpuLimits Limits

    What the device reports it can do.

  • bool HasSurface

    Whether there is a surface to present to.

  • WgpuTextureFormat PreferredSurfaceFormat

    The format the surface prefers, or Undefined when there is no surface.

Methods (54)

Used by (5)

  • FakeWebGpuBindingVixen.Graphics.WebGPU.Tests
  • NativeWebGpuBindingVixen.Graphics.WebGPU
  • PushConstantRingVixen.Graphics.WebGPU
  • WebGpuDeviceVixen.Graphics.WebGPU
  • WebGpuSwapChainVixen.Graphics.WebGPU