pub struct WgpuAtlas(/* private fields */);Expand description
wgpu 纹理图集实现,用于缓存和渲染纹理
Implementations§
Source§impl WgpuAtlas
impl WgpuAtlas
Sourcepub fn new(
device: Arc<Device>,
queue: Arc<Queue>,
color_texture_format: TextureFormat,
) -> Self
pub fn new( device: Arc<Device>, queue: Arc<Queue>, color_texture_format: TextureFormat, ) -> Self
创建新的纹理图集
Sourcepub fn from_context(context: &WgpuContext) -> Self
pub fn from_context(context: &WgpuContext) -> Self
从 WgpuContext 创建纹理图集
Sourcepub fn before_frame(&self)
pub fn before_frame(&self)
在每帧渲染前刷新待上传的纹理数据
Sourcepub fn get_texture_info(&self, id: AtlasTextureId) -> WgpuTextureInfo
pub fn get_texture_info(&self, id: AtlasTextureId) -> WgpuTextureInfo
获取指定纹理 ID 的纹理信息
Sourcepub fn handle_device_lost(&self, context: &WgpuContext)
pub fn handle_device_lost(&self, context: &WgpuContext)
处理设备丢失,清除所有纹理和缓存的图块。 图集将在后续帧中按需惰性重新创建纹理。
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WgpuAtlas
impl !RefUnwindSafe for WgpuAtlas
impl Send for WgpuAtlas
impl Sync for WgpuAtlas
impl Unpin for WgpuAtlas
impl UnsafeUnpin for WgpuAtlas
impl !UnwindSafe for WgpuAtlas
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more