File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ SamplerDescriptor {
7272...
7373}
7474```
75+ ### Changes
76+
77+ #### General
78+
79+ - Texture now has ` from_custom ` . By @R-Cramer4 in [ #8315 ] ( https://github.com/gfx-rs/wgpu/pull/8315 ) .
7580
7681### Bug Fixes
7782
Original file line number Diff line number Diff line change @@ -69,6 +69,22 @@ impl Texture {
6969 self . inner . as_custom ( )
7070 }
7171
72+ #[ cfg( custom) ]
73+ /// Creates a texture from already created custom implementation with the given description
74+ pub fn from_custom < T : custom:: TextureInterface > (
75+ texture : T ,
76+ desc : & TextureDescriptor < ' _ > ,
77+ ) -> Self {
78+ Self {
79+ inner : dispatch:: DispatchTexture :: custom ( texture) ,
80+ descriptor : TextureDescriptor {
81+ label : None ,
82+ view_formats : & [ ] ,
83+ ..desc. clone ( )
84+ } ,
85+ }
86+ }
87+
7288 /// Creates a view of this texture, specifying an interpretation of its texels and
7389 /// possibly a subset of its layers and mip levels.
7490 ///
You can’t perform that action at this time.
0 commit comments