diff --git a/wgpu-rs/src/lib.rs b/wgpu-rs/src/lib.rs index ed3af09f4e..995354e49d 100644 --- a/wgpu-rs/src/lib.rs +++ b/wgpu-rs/src/lib.rs @@ -8,7 +8,7 @@ use std::ffi::CString; pub use wgn::{ AdapterDescriptor, Color, CommandBufferDescriptor, DeviceDescriptor, Extensions, Extent3d, Origin3d, PowerPreference, ShaderModuleDescriptor, ShaderStage, - BindGroupLayoutBinding, BindingType, TextureFormat, + BindGroupLayoutBinding, BindingType, TextureDimension, TextureDescriptor, TextureFormat, TextureUsageFlags, PrimitiveTopology, BlendStateDescriptor, ColorWriteFlags, DepthStencilStateDescriptor, RenderPassDescriptor, RenderPassColorAttachmentDescriptor, RenderPassDepthStencilAttachmentDescriptor, LoadOp, StoreOp, @@ -28,6 +28,10 @@ pub struct Device { id: wgn::DeviceId, } +pub struct Texture { + id: wgn::TextureId, +} + pub struct TextureView { id: wgn::TextureViewId, } @@ -238,6 +242,12 @@ impl Device { }), } } + + pub fn create_texture(&self, desc: TextureDescriptor) -> Texture { + Texture { + id: wgn::wgpu_device_create_texture(self.id, &desc), + } + } } impl CommandBuffer {