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,
|
dimension: wgpu::TextureDimension::D2,
|
||||||
format: pixels.render_texture_format(),
|
format: pixels.render_texture_format(),
|
||||||
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::RENDER_ATTACHMENT,
|
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::RENDER_ATTACHMENT,
|
||||||
view_formats: &[
|
view_formats: &[],
|
||||||
pixels.render_texture_format().add_srgb_suffix(),
|
|
||||||
pixels.render_texture_format().remove_srgb_suffix(),
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(device
|
Ok(device
|
||||||
|
|
|
@ -464,10 +464,7 @@ pub(crate) fn create_backing_texture(
|
||||||
dimension: wgpu::TextureDimension::D2,
|
dimension: wgpu::TextureDimension::D2,
|
||||||
format: backing_texture_format,
|
format: backing_texture_format,
|
||||||
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
|
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
|
||||||
view_formats: &[
|
view_formats: &[],
|
||||||
backing_texture_format.add_srgb_suffix(),
|
|
||||||
backing_texture_format.remove_srgb_suffix(),
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
let texture_view = texture.create_view(&wgpu::TextureViewDescriptor::default());
|
let texture_view = texture.create_view(&wgpu::TextureViewDescriptor::default());
|
||||||
|
|
||||||
|
|
|
@ -512,10 +512,7 @@ impl Pixels {
|
||||||
height: self.surface_size.height,
|
height: self.surface_size.height,
|
||||||
present_mode: self.present_mode,
|
present_mode: self.present_mode,
|
||||||
alpha_mode: self.alpha_mode,
|
alpha_mode: self.alpha_mode,
|
||||||
view_formats: vec![
|
view_formats: vec![],
|
||||||
self.surface_texture_format.add_srgb_suffix(),
|
|
||||||
self.surface_texture_format.remove_srgb_suffix(),
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue