Learn Wgpu
Home
  • Dependencies and the window
  • The Surface
  • The Pipeline
  • Buffers and Indices
  • Textures and bind groups
  • Uniform buffers and a 3d camera
  • Instancing
  • The Depth Buffer
  • Model Loading
  • Working with Lights
  • Normal Mapping
  • A Better Camera
  • High Dynamic Range Rendering
  • Intro to Compute Pipelines
  • Sorting on the GPU
  • Foreword
  • Mipmapping
  • Stencil Buffers
  • Drawing Text
  • Wgpu without a window
  • Creating gifs
  • Pong
  • Memory Layout in WGSL
  • Update to 31.0
  • Update to wgpu 30.0
  • Update to Wgpu 29.0
  • Update to Vuepress v2
  • Version 28.0 and stencil showcase
  • Update to 27.0!
  • Update to wgpu 26.0.1 and started compute pipeline guide
  • Update to Winit 0.30!
  • Version 25.0!
  • Version 24.0
  • First Major Version! (22.0)
  • Update to 0.18 and HDR tutorial
  • Update to 0.17
  • Update to 0.16
  • Update to 0.15!
  • Update to 0.14!
  • Update to 0.13!
  • Update to 0.12!
  • News (Pre 0.12)
Home
  • Dependencies and the window
  • The Surface
  • The Pipeline
  • Buffers and Indices
  • Textures and bind groups
  • Uniform buffers and a 3d camera
  • Instancing
  • The Depth Buffer
  • Model Loading
  • Working with Lights
  • Normal Mapping
  • A Better Camera
  • High Dynamic Range Rendering
  • Intro to Compute Pipelines
  • Sorting on the GPU
  • Foreword
  • Mipmapping
  • Stencil Buffers
  • Drawing Text
  • Wgpu without a window
  • Creating gifs
  • Pong
  • Memory Layout in WGSL
  • Update to 31.0
  • Update to wgpu 30.0
  • Update to Wgpu 29.0
  • Update to Vuepress v2
  • Version 28.0 and stencil showcase
  • Update to 27.0!
  • Update to wgpu 26.0.1 and started compute pipeline guide
  • Update to Winit 0.30!
  • Version 25.0!
  • Version 24.0
  • First Major Version! (22.0)
  • Update to 0.18 and HDR tutorial
  • Update to 0.17
  • Update to 0.16
  • Update to 0.15!
  • Update to 0.14!
  • Update to 0.13!
  • Update to 0.12!
  • News (Pre 0.12)
  • Update to 31.0

Update to 31.0

It's a pretty small update for the tutorial, so let's get into it!

Texture descriptors can now specify view dimensions

If the ARBITRARY_BINDING_VIEW_DIMENSIONS feature is not set when requesting an adapter, Wgpu needs to know what dimensions a view can use.

Note

Any adapter that is wgpu compliant should have ARBITRARY_BINDING_VIEW_DIMENSIONS set, but you can use DownlevelCapabilities::is_webgpu_compliant to check.

wgpu::TextureDescriptor now has a new texture_binding_view_dimension field that you can specify this. For our purposes we'll just use None to have Wgpu infer the list from the textures description.

let desc = wgpu::TextureDescriptor {
    // ...

    // NEW
    texture_binding_view_dimension: None,
};

New has_srgb_suffix

TextureFormat::is_srgb() has be renamed to has_srgb_suffix()

let surface_format = surface_caps
    .formats
    .iter()
    .copied()
    .find(|f| f.has_srgb_suffix())
    .unwrap_or(surface_caps.formats[0]);

QueueDescriptor required when requesting device

As of writing QueueDescriptor just has a label as it's only field. I'd imagine this is a place holder for future work and also allows you to debug what queue gets selected using a program like RenderDoc.

let (device, queue) = adapter
    .request_device(&wgpu::DeviceDescriptor {
        // ...

        // NEW
        default_queue: wgpu::QueueDescriptor::default(),
    })

Supporters

Special thanks to these Patreons on patreon!

  • David Laban
  • Ian Gowen
  • Aron Granberg
  • 折登 樹
  • Julius Liu
  • Jani Turkia
  • Filip
  • Lions Heart
  • IC
  • Kosuke Ohira
  • Eliot Bolduc
  • yutani
  • Ben Anderson
  • Ken
  • Danny McGee
  • Craft Links
  • Thunk
  • 大典 加藤
  • Paul E Hansen
  • Tema
  • Davide Prati
  • Gunstein Vatnar
  • Felix
  • dadofboi
  • charlesk
  • Andrea Postal
  • Youngsuk Kim
  • Alexander Kabirov
  • Dude
  • Zeh Fernando
  • Ryan
  • Nico Arbogast
  • Lennart
  • Bernard Llanos
Last Updated: 12/5/26, 10:28 PM
Contributors: ZayadNimrod