pub fn create(self, cx: &Context) -> Texture {
        let texture = cx.device.create_texture(&wgpu::TextureDescriptor {
            label: None,
            size: wgpu::Extent3d {
                width: self.width,
                height: self.height,
                depth_or_array_layers: 1,
            },
            mip_level_count: 1,
            sample_count: self.samples,
            dimension: wgpu::TextureDimension::D2,
            format: self.format,
            usage: if self.binding {
                wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING
            } else {
                wgpu::TextureUsages::RENDER_ATTACHMENT
            },
        });

        let view = texture.create_view(&wgpu::TextureViewDescriptor::default());

        Texture::new(Arc::new(texture), Arc::new(view))
    }
/// Creates a new [Texture] for rendering use from the stored options.
Creates a new [Texture] for rendering use from the stored options.
Creates a new [ Texture ] for rendering use from the stored options .
pub fn create(self, cx: &Context) -> Texture {
        let texture = cx.device.create_texture(&wgpu::TextureDescriptor {
            label: None,
            size: wgpu::Extent3d {
                width: self.width,
                height: self.height,
                depth_or_array_layers: 1,
            },
            mip_level_count: 1,
            sample_count: self.samples,
            dimension: wgpu::TextureDimension::D2,
            format: self.format,
            usage: if self.binding {
                wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING
            } else {
                wgpu::TextureUsages::RENDER_ATTACHMENT
            },
        });
        let view = texture.create_view(&wgpu::TextureViewDescriptor::default());
        Texture::new(Arc::new(texture), Arc::new(view))
    }
pub fn create ( self , cx : & Context ) -> Texture { let texture = cx . device . create_texture ( & wgpu :: TextureDescriptor { label : None , size : wgpu :: Extent3d { width : self . width , height : self . height , depth_or_array_layers : 1 , } , mip_level_count : 1 , sample_count : self . samples , dimension : wgpu :: TextureDimension :: D2 , format : self . format , usage : if self . binding { wgpu :: TextureUsages :: RENDER_ATTACHMENT | wgpu :: TextureUsages :: TEXTURE_BINDING } else { wgpu :: TextureUsages :: RENDER_ATTACHMENT } , } ) ; let view = texture . create_view ( & wgpu :: TextureViewDescriptor :: default ( ) ) ; Texture :: new ( Arc :: new ( texture ) , Arc :: new ( view ) ) }
Creates a new [Texture] for rendering use from the stored options.
Creates a new [ Texture ] for rendering use from the stored options .
self
cx
&Context
self
cx
&Context