#[derive(Debug, Clone)]
pub struct Gpu {
adapter: wgpu::Adapter,
instance: wgpu::Instance,
queue: wgpu::Queue,
device: wgpu::Device,
limits: wgpu::Limits,
}
impl Gpu {
pub fn new(adapter: wgpu::Adapter, instance: wgpu::Instance, device: wgpu::Device, queue: wgpu::Queue) -> Self {
let limits = adapter.limits();
Self {
adapter,
instance,
queue,
device,
limits,
}
}
pub fn adapter(&self) -> &wgpu::Adapter {
&self.adapter
}
pub fn instance(&self) -> &wgpu::Instance {
&self.instance
}
pub fn device(&self) -> &wgpu::Device {
&self.device
}
pub fn queue(&self) -> &wgpu::Queue {
&self.queue
}
pub fn limits(&self) -> &wgpu::Limits {
&self.limits
}
}