Crate wgpu_hal

Source
Expand description

This library describes the internal unsafe graphics abstraction API. It follows WebGPU for the most part, re-using wgpu-types, with the following deviations:

  • Fully unsafe: zero overhead, zero validation.
  • Compile-time backend selection via traits.
  • Objects are passed by references and returned by value. No IDs.
  • Mapping is persistent, with explicit synchronization.
  • Resource transitions are explicit.
  • All layouts are explicit. Binding model has compatibility.

General design direction is to follow the majority by the following weights:

  • wgpu-core: 1.5
  • primary backends (Vulkan/Metal/DX12): 1.0 each
  • secondary backends (DX11/GLES): 0.5 each

Modules§

api
auxil
empty
A dummy API implementation.
gles
GLES API internals.
vulkan
Vulkan API internals.

Structs§

AcquiredSurfaceTexture
Alignments
Attachment
AttachmentOps
BindGroupDescriptor
BindGroup descriptor.
BindGroupEntry
BindGroupLayoutDescriptor
BindGroupLayout descriptor.
BindGroupLayoutFlags
Pipeline layout creation flags.
BufferBarrier
BufferBinding
BufferCopy
BufferDescriptor
BufferMapping
BufferTextureCopy
BufferUses
Similar to wgt::BufferUsages but for internal use.
Capabilities
ColorAttachment
CommandEncoderDescriptor
ComputePassDescriptor
ComputePipelineDescriptor
Describes a compute pipeline.
CopyExtent
DepthStencilAttachment
ExposedAdapter
FormatAspects
Texture format capability flags.
InstanceDescriptor
InstanceError
InstanceFlags
Instance initialization flags.
MemoryFlags
NagaShader
Naga shader module.
OpenDevice
PipelineLayoutDescriptor
PipelineLayoutFlags
Pipeline layout creation flags.
ProgrammableStage
Describes a programmable pipeline stage.
Rect
RenderPassDescriptor
RenderPipelineDescriptor
Describes a render (graphics) pipeline.
SamplerDescriptor
ShaderModuleDescriptor
SurfaceCapabilities
Describes information about what a Surface’s presentation capabilities are. Fetch this with Adapter::surface_capabilities.
SurfaceConfiguration
TextureBarrier
TextureBinding
TextureCopy
TextureCopyBase
TextureDescriptor
TextureFormatCapabilities
Texture format capability flags.
TextureUses
Similar to wgt::TextureUsages but for internal use.
TextureViewDescriptor
TextureView descriptor.
ValidationCanary
Flag for internal testing.
VertexBufferLayout
Describes how the vertex buffer is interpreted.

Enums§

DeviceError
PipelineError
ShaderError
ShaderInput
Shader input.
SurfaceError

Constants§

MAX_ANISOTROPY
MAX_BIND_GROUPS
MAX_COLOR_ATTACHMENTS
MAX_MIP_LEVELS
MAX_VERTEX_BUFFERS
QUERY_SIZE
Size of a single occlusion/timestamp query, when copied into a buffer, in bytes.

Statics§

VALIDATION_CANARY
Stores if any API validation error has occurred in this process since it was last reset.

Traits§

Adapter
Api
CommandEncoder
Encoder for commands in command buffers. Serves as a parent for all the encoded command buffers. Works in bursts of action: one or more command buffers are recorded, then submitted to a queue, and then it needs to be reset_all().
Device
Instance
Queue
Surface

Type Aliases§

DropGuard
Drop guard to signal wgpu-hal is no longer using an externally created object.
FenceValue
Label
MemoryRange