Transform convert_* functions in gpuconvert.rs to From/TryFrom implementations (#33302)

Signed-off-by: Taym <haddadi.taym@gmail.com>
This commit is contained in:
Taym Haddadi 2024-09-04 18:03:59 +02:00 committed by GitHub
parent c0ced7a524
commit 00389cf007
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 493 additions and 483 deletions

View file

@ -19,7 +19,7 @@ use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::bindings::str::USVString;
use crate::dom::globalscope::GlobalScope;
use crate::dom::gpuconvert::{convert_label, convert_texture_view_dimension};
use crate::dom::gpuconvert::convert_label;
use crate::dom::gpudevice::GPUDevice;
use crate::dom::gputextureview::GPUTextureView;
@ -155,7 +155,7 @@ impl GPUTextureMethods for GPUTexture {
.format
.map(|f| self.device.validate_texture_format_required_features(&f))
.transpose()?,
dimension: descriptor.dimension.map(convert_texture_view_dimension),
dimension: descriptor.dimension.map(|dimension| dimension.into()),
range: wgt::ImageSubresourceRange {
aspect: match descriptor.aspect {
GPUTextureAspect::All => wgt::TextureAspect::All,