Skip to content
aidan-interpurposeful edited this page Nov 29, 2024 · 8 revisions

External resources

Important concepts

Device & Queue

  • wgpu::Device
    • All resource creation
    • All functions are &self (no mut!)
  • wgpu::Queue
    • All gpu work submission

Typically created once on startup, one each. Created with set of Features & Limits, enforced independently of actual capabilities (E.g. texture size/formats, number of bound resources, native extensions, …)

Relationship of RenderPipelines & Resources Binding

A slightly simplified overview of what you need to set up before rendering a frame.

RenderPipeline & Resource Binding diagram

Round boxes: Temporary desc structs
Cornered boxes: Resources created from a wgpu::Device
Bold: What you deal with on a per-frame basis

BindGroupLayoutEntry have (mostly) corresponding types to BindingResources.
Compute Pipelines follow a similar pattern.

Drawing a "Frame"

A simplified overview of what you need to do to draw a frame.

life of a frame diagram

Full lines: Needed for creation
Dashed lines: Providing provided as "information"

Finish consumes a CommandEncoder
Submit consumes a CommandBuffer
The TextureView on RenderPassColorAttachment could be from a Surface, a special target for the final output!