mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Expose create_texture in Rust
This commit is contained in:
parent
de4f2b70eb
commit
ef4ee9c29d
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user