pub struct CacheEntry {
pub size: DeviceIntSize,
pub details: EntryDetails,
pub user_data: [f32; 4],
pub last_access: FrameStamp,
pub uv_rect_handle: GpuBufferHandle,
pub input_format: ImageFormat,
pub filter: TextureFilter,
pub swizzle: Swizzle,
pub texture_id: CacheTextureId,
pub eviction_notice: Option<EvictionNotice>,
pub uv_rect_kind: UvRectKind,
pub shader: TargetShader,
}Fields§
§size: DeviceIntSizeSize of the requested item, in device pixels. Does not include any padding for alignment that the allocator may have added to this entry’s allocation.
details: EntryDetailsDetails specific to standalone or shared items.
user_data: [f32; 4]Arbitrary user data associated with this item.
last_access: FrameStampThe last frame this item was requested for rendering.
uv_rect_handle: GpuBufferHandleAddress of the resource rect in the GPU cache.
The handle is stored in the cache entry to avoid duplicates when an item is used multiple times per frame, but greate care must be taken to not reuse a handle that was created in a previous frame. TODO: For now the validity of the handle can be checked by comparing last_access with the current FrameStamp, but this is error prone.
input_format: ImageFormatImage format of the data that the entry expects.
filter: TextureFilter§swizzle: Swizzle§texture_id: CacheTextureIdThe actual device texture ID this is part of.
eviction_notice: Option<EvictionNotice>Optional notice when the entry is evicted from the cache.
uv_rect_kind: UvRectKindThe type of UV rect this entry specifies.
shader: TargetShaderImplementations§
Source§impl CacheEntry
impl CacheEntry
fn new_standalone( texture_id: CacheTextureId, last_access: FrameStamp, params: &CacheAllocParams, swizzle: Swizzle, size_in_bytes: usize, ) -> Self
fn write_gpu_blocks( &mut self, gpu_buffer: &mut GpuBufferBuilderImpl<GpuBufferBlockF>, )
fn evict(&self)
fn alternative_input_format(&self) -> ImageFormat
Trait Implementations§
Source§impl Debug for CacheEntry
impl Debug for CacheEntry
Source§impl MallocSizeOf for CacheEntry
impl MallocSizeOf for CacheEntry
Source§fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl Freeze for CacheEntry
impl !RefUnwindSafe for CacheEntry
impl !Send for CacheEntry
impl !Sync for CacheEntry
impl Unpin for CacheEntry
impl UnsafeUnpin for CacheEntry
impl !UnwindSafe for CacheEntry
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
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>
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>
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