-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area: validationIssues related to validation, diagnostics, and error handlingIssues related to validation, diagnostics, and error handlingkind: diagnosticsError message should be betterError message should be bettertype: enhancementNew feature or requestNew feature or request
Description
Description
I would like to create a texture view that is RGB8UnormSrgb from an RGB8Unorm texture. But I get the following error:
wgpu error: Validation Error
Caused by:
In Texture::create_view, label = 'in_texture'
Unable to view texture Rgba8Unorm as Rgba8UnormSrgb
Repro steps
let texture = device.create_texture(&wgpu::TextureDescriptor {
label,
size,
mip_level_count: 1,
sample_count: 1,
dimension: wgpu::TextureDimension::D2,
format,
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST | wgpu::TextureUsages::STORAGE_BINDING,
view_formats: &[],
});
let srgb_view = texture.create_view(&wgpu::TextureViewDescriptor{
label,
format: Some(wgpu::TextureFormat::Rgba8UnormSrgb),
dimension: Some(wgpu::TextureViewDimension::D2),
usage: Some(wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST),
..Default::default()
});
Note: I did not add the right view formats in the texture.
Expected vs observed behavior
I would've expected that the error would point me to the view_formats.
Platform
Using wgpu 27.0.0, running on ubuntu 24.04 on a cheap laptop.
Metadata
Metadata
Assignees
Labels
area: validationIssues related to validation, diagnostics, and error handlingIssues related to validation, diagnostics, and error handlingkind: diagnosticsError message should be betterError message should be bettertype: enhancementNew feature or requestNew feature or request
Type
Projects
Status
Todo