Fix validation errors with WebGL2 backend (#335)
* Fix validation errors with WebGL2 backend - view_formats are optional and should be empty unless a specific view format is needed. - See: https://www.w3.org/TR/webgpu/#dom-gputexturedescriptor-viewformats
This commit is contained in:
parent
c3f63a540d
commit
eede10ba42
|
@ -229,10 +229,7 @@ fn create_texture_view(
|
|||
dimension: wgpu::TextureDimension::D2,
|
||||
format: pixels.render_texture_format(),
|
||||
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::RENDER_ATTACHMENT,
|
||||
view_formats: &[
|
||||
pixels.render_texture_format().add_srgb_suffix(),
|
||||
pixels.render_texture_format().remove_srgb_suffix(),
|
||||
],
|
||||
view_formats: &[],
|
||||
};
|
||||
|
||||
Ok(device
|
||||
|
|
|
@ -464,10 +464,7 @@ pub(crate) fn create_backing_texture(
|
|||
dimension: wgpu::TextureDimension::D2,
|
||||
format: backing_texture_format,
|
||||
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
|
||||
view_formats: &[
|
||||
backing_texture_format.add_srgb_suffix(),
|
||||
backing_texture_format.remove_srgb_suffix(),
|
||||
],
|
||||
view_formats: &[],
|
||||
});
|
||||
let texture_view = texture.create_view(&wgpu::TextureViewDescriptor::default());
|
||||
|
||||
|
|
|
@ -512,10 +512,7 @@ impl Pixels {
|
|||
height: self.surface_size.height,
|
||||
present_mode: self.present_mode,
|
||||
alpha_mode: self.alpha_mode,
|
||||
view_formats: vec![
|
||||
self.surface_texture_format.add_srgb_suffix(),
|
||||
self.surface_texture_format.remove_srgb_suffix(),
|
||||
],
|
||||
view_formats: vec![],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue