1#[derive(Debug)]
4pub struct Gpu {
5 adapter: wgpu::Adapter,
9 instance: wgpu::Instance,
10 queue: wgpu::Queue,
11 device: wgpu::Device,
12 limits: wgpu::Limits,
13}
14
15impl Gpu {
16 pub fn new(adapter: wgpu::Adapter, instance: wgpu::Instance, device: wgpu::Device, queue: wgpu::Queue) -> Self {
17 let limits = adapter.limits();
18 Self {
19 adapter,
20 instance,
21 queue,
22 device,
23 limits,
24 }
25 }
26
27 pub fn adapter(&self) -> &wgpu::Adapter {
28 &self.adapter
29 }
30
31 pub fn instance(&self) -> &wgpu::Instance {
32 &self.instance
33 }
34
35 pub fn device(&self) -> &wgpu::Device {
36 &self.device
37 }
38
39 pub fn queue(&self) -> &wgpu::Queue {
40 &self.queue
41 }
42
43 pub fn limits(&self) -> &wgpu::Limits {
44 &self.limits
45 }
46}