File tree Expand file tree Collapse file tree 1 file changed +4
-23
lines changed
crates/bevy_render/src/texture Expand file tree Collapse file tree 1 file changed +4
-23
lines changed Original file line number Diff line number Diff line change @@ -467,34 +467,15 @@ impl Volume for Extent3d {
467467 }
468468}
469469
470- /// Information about the pixel size in bytes and the number of different components.
471- pub struct PixelInfo {
472- /// The size of a component of a pixel in bytes.
473- pub type_size : usize ,
474- /// The amount of different components (color channels).
475- pub num_components : usize ,
476- }
477-
478470/// Extends the wgpu [`TextureFormat`] with information about the pixel.
479471pub trait TextureFormatPixelInfo {
480- /// Returns the pixel information of the format.
481- fn pixel_info ( & self ) -> PixelInfo ;
482- /// Returns the size of a pixel of the format.
483- fn pixel_size ( & self ) -> usize {
484- let info = self . pixel_info ( ) ;
485- info. type_size * info. num_components
486- }
472+ /// Returns the size in bytes of a pixel of the format.
473+ fn pixel_size ( & self ) -> usize ;
487474}
488475
489476impl TextureFormatPixelInfo for TextureFormat {
490- #[ allow( clippy:: match_same_arms) ]
491- fn pixel_info ( & self ) -> PixelInfo {
492- let info = self . describe ( ) ;
493-
494- PixelInfo {
495- type_size : info. block_size . into ( ) ,
496- num_components : info. components . into ( ) ,
497- }
477+ fn pixel_size ( & self ) -> usize {
478+ self . describe ( ) . block_size . into ( )
498479 }
499480}
500481
You can’t perform that action at this time.
0 commit comments