public sealed class NativeWebGpuBindingWebGPU through Dawn or wgpu-native.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
One of the two surface implementations docs/plan/05 asks for — the desktop one, and therefore the one the tests, the golden-image suite and a developer's machine can reach. The other is Vixen.Graphics.WebGPU.Browser.
This class decides nothing. It marshals what it is given and returns what the implementation returned; every choice about what to create was made above IWebGpuBinding, in code the browser surface runs unchanged.
The callbacks are [UnmanagedCallersOnly] static functions writing through a userdata pointer to a stack local, rather than delegates. Two reasons, and the second is the load-bearing one: it keeps the AOT analyser quiet (R11), and a delegate would have needed something to hold it alive for exactly as long as the implementation might call it, which for uncapturedError is the life of the device.
Fields and properties (5)
public WebGpuAdapterInfo AdapterInfoWhat the implementation says about the adapter.
public WebGpuLimits LimitsWhat the device reports it can do.
public bool HasSurfaceWhether there is a surface to present to.
public WgpuTextureFormat PreferredSurfaceFormatThe format the surface prefers, or Undefined when there is no surface.
public static string? LibraryPathWhere the implementation was loaded from, for the boot log.
Methods (56)
public bool HasFeature(WgpuFeatureName feature)Whether the device was created with an optional feature enabled.
public static bool TryCreate(NativeWebGpuOptions options, out NativeWebGpuBinding? binding, out string? reason)Creates a binding, reporting failure rather than throwing.
public WebGpuObject CreateBuffer(in WgpuBufferDescriptor descriptor)Creates a buffer.
public WebGpuObject CreateTexture(in WgpuTextureDescriptor descriptor)Creates a texture.
public WebGpuObject CreateTextureView(WebGpuObject texture, in WgpuTextureViewDescriptor descriptor)Creates a view of a texture.
public WebGpuObject CreateSampler(in WgpuSamplerDescriptor descriptor)Creates a sampler.
public WebGpuObject CreateShaderModule(in WgpuShaderModuleDescriptor descriptor)Creates a shader module.
public WebGpuObject CreateBindGroupLayout(in WgpuBindGroupLayoutDescriptor descriptor)Creates a bind group layout.
public WebGpuObject CreatePipelineLayout(in WgpuPipelineLayoutDescriptor descriptor)Creates a pipeline layout.
public WebGpuObject CreateBindGroup(in WgpuBindGroupDescriptor descriptor)Creates a bind group.
public void Release(WebGpuObjectKind kind, WebGpuObject handle)Releases an object this binding created.
public void WriteBuffer(WebGpuObject buffer, long offset, ReadOnlySpan<byte> data)Writes into a buffer through the queue.
public bool ReadBuffer(WebGpuObject buffer, long offset, Span<byte> destination)Maps a buffer, copies out of it and unmaps it.
public void Submit(ReadOnlySpan<WebGpuObject> commands)Submits finished command buffers, in order.
public bool WaitIdle()Blocks until everything submitted has finished.
public void Tick()Lets the implementation run its callbacks.
public void ConfigureSurface(in WgpuSurfaceConfiguration configuration)Configures the surface for presentation.
public WgpuSurfaceStatus AcquireSurfaceTexture(out WebGpuObject texture)Takes the surface's next texture.
public void PresentSurface()Presents the acquired texture.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public WebGpuObject CreateRenderPipeline(in WgpuRenderPipelineDescriptor descriptor)Compiles a render pipeline.
public WebGpuObject CreateComputePipeline(in WgpuComputePipelineDescriptor descriptor)Compiles a compute pipeline.
public WebGpuObject CreateCommandEncoder(string label)Takes a command encoder.
public WebGpuObject FinishCommandEncoder(WebGpuObject encoder, string label)Finishes an encoder into a command buffer.
public void CopyBufferToBuffer(WebGpuObject encoder, WebGpuObject source, long sourceOffset, WebGpuObject destination, long destinationOffset, long size)Copies between buffers.
public void CopyBufferToTexture(WebGpuObject encoder, in WgpuImageCopyBuffer source, in WgpuImageCopyTexture destination, int width, int height, int depthOrLayers)Copies from a buffer into a texture.
public void CopyTextureToBuffer(WebGpuObject encoder, in WgpuImageCopyTexture source, in WgpuImageCopyBuffer destination, int width, int height, int depthOrLayers)Copies from a texture into a buffer.
public void CopyTextureToTexture(WebGpuObject encoder, in WgpuImageCopyTexture source, in WgpuImageCopyTexture destination, int width, int height, int depthOrLayers)Copies between textures.
public void EncoderPushDebugGroup(WebGpuObject encoder, string name)Opens a named group on an encoder.
public void EncoderPopDebugGroup(WebGpuObject encoder)Closes the innermost group on an encoder.
public void EncoderInsertDebugMarker(WebGpuObject encoder, string name)Marks a point on an encoder.
public WebGpuObject BeginRenderPass(WebGpuObject encoder, in WgpuRenderPassDescriptor descriptor)Begins a render pass.
public void EndRenderPass(WebGpuObject pass)Ends a render pass and releases its encoder.
public void RenderPassSetPipeline(WebGpuObject pass, WebGpuObject pipeline)Binds a pipeline in a render pass.
public void RenderPassSetBindGroup(WebGpuObject pass, uint group, WebGpuObject bindGroup, ReadOnlySpan<uint> dynamicOffsets)Binds a bind group in a render pass.
public void RenderPassSetVertexBuffer(WebGpuObject pass, uint slot, WebGpuObject buffer, long offset, long size)Binds a vertex buffer in a render pass.
public void RenderPassSetIndexBuffer(WebGpuObject pass, WebGpuObject buffer, WgpuIndexFormat format, long offset, long size)Binds the index buffer in a render pass.
public void RenderPassSetViewport(WebGpuObject pass, float x, float y, float width, float height, float minDepth, float maxDepth)Sets the viewport.
public void RenderPassSetScissorRect(WebGpuObject pass, uint x, uint y, uint width, uint height)Sets the scissor rectangle.
public void RenderPassSetBlendConstant(WebGpuObject pass, double r, double g, double b, double a)Sets the blend constant.
public void RenderPassSetStencilReference(WebGpuObject pass, uint reference)Sets the stencil reference value.
public void RenderPassDraw(WebGpuObject pass, uint vertexCount, uint instanceCount, uint firstVertex, uint firstInstance)Draws without indices.
public void RenderPassDrawIndexed(WebGpuObject pass, uint indexCount, uint instanceCount, uint firstIndex, int baseVertex, uint firstInstance)Draws with indices.
public void RenderPassDrawIndexedIndirect(WebGpuObject pass, WebGpuObject arguments, long offset)Draws with arguments the GPU wrote.
public void RenderPassPushDebugGroup(WebGpuObject pass, string name)Opens a named group in a render pass.
public void RenderPassPopDebugGroup(WebGpuObject pass)Closes the innermost group in a render pass.
public void RenderPassInsertDebugMarker(WebGpuObject pass, string name)Marks a point in a render pass.
public WebGpuObject BeginComputePass(WebGpuObject encoder, string label)Begins a compute pass.
public void EndComputePass(WebGpuObject pass)Ends a compute pass and releases its encoder.
public void ComputePassSetPipeline(WebGpuObject pass, WebGpuObject pipeline)Binds a pipeline in a compute pass.
public void ComputePassSetBindGroup(WebGpuObject pass, uint group, WebGpuObject bindGroup, ReadOnlySpan<uint> dynamicOffsets)Binds a bind group in a compute pass.
public void ComputePassDispatch(WebGpuObject pass, uint groupsX, uint groupsY, uint groupsZ)Runs a compute shader.
public void ComputePassDispatchIndirect(WebGpuObject pass, WebGpuObject arguments, long offset)Runs a compute shader with a group count the GPU wrote.
public void ComputePassPushDebugGroup(WebGpuObject pass, string name)Opens a named group in a compute pass.
public void ComputePassPopDebugGroup(WebGpuObject pass)Closes the innermost group in a compute pass.
public void ComputePassInsertDebugMarker(WebGpuObject pass, string name)Marks a point in a compute pass.
Used by (3)
- NativeWebGpuTestsVixen.Graphics.WebGPU.Tests
- WebGpuDeviceVixen.Graphics.WebGPU
- WebGpuRequirementVixen.Graphics.WebGPU.Tests