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
  • Wgpu without a window
  • Creating gifs
  • Pong
  • Memory Layout in WGSL
  • 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
  • Wgpu without a window
  • Creating gifs
  • Pong
  • Memory Layout in WGSL
  • 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 0.15!

Update to 0.15!

This is a pretty minor update for this tutorial, but there are a few things to consider.

  1. A view_formats field was added to TextureDescriptor and SurfaceDescriptor. This allows you to specify different TextureFormats that can be used when creating TextureViews. At time of writing this pretty much only allows you to switch between using SRGB and linear formats. For example:
TextureDescriptor {
    // other fields...
    format: wgpu::TextureFormat::Rgba8UnormSrgb,
    view_formats: &[wgpu::TextureFormat::Rgba8Unorm],
}

The format used to create the Texture will always be supported, so you don't have to specify it.

  1. The method of acquiring texture formats supported by the Surface has changed. Previously there was a get_supported_formats() that would return a Vec<TextureFormat>. Now Surface has a get_capabilities() method. This will return a SurfaceCapabilities object that will have the supported formats as well as some other fields that you can checkout here. I'm using it in the tutorial like this:
let surface_caps = surface.get_capabilities(&adapter);
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
    .copied()
    .filter(|f| f.is_srgb())
    .next()
    .unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
    usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
    format: surface_format,
    width: size.width,
    height: size.height,
    present_mode: surface_caps.present_modes[0],
    alpha_mode: surface_caps.alpha_modes[0],
    view_formats: vec![],
};

As always let me know if I missed anything. You can check out the full changelog for 0.15 here

Last Updated: 5/17/26, 3:25 AM
Contributors: Benjamin Hansen