use bevy_reflect::Uuid; use std::sync::Arc; #[derive(Copy, Clone, Hash, Eq, PartialEq, Debug)] pub struct BindGroupId(Uuid); #[derive(Clone, Debug)] pub struct BindGroup { id: BindGroupId, value: Arc, } impl BindGroup { #[inline] pub fn id(&self) -> BindGroupId { self.id } #[inline] pub fn value(&self) -> &wgpu::BindGroup { &self.value } } impl From for BindGroup { fn from(value: wgpu::BindGroup) -> Self { BindGroup { id: BindGroupId(Uuid::new_v4()), value: Arc::new(value), } } }