Struct webgpu::swapchain::ContextData
source · pub struct ContextData {
image_key: ImageKey,
image_desc: WebGPUImageDescriptor,
image_data: ImageData,
buffer_ids: ArrayVec<(BufferId, PresentationBufferState), PRESENTATION_BUFFER_COUNT>,
swap_chain: Option<SwapChain>,
next_presentation_id: PresentationId,
current_presentation_id: PresentationId,
}
Fields§
§image_key: ImageKey
§image_desc: WebGPUImageDescriptor
§image_data: ImageData
§buffer_ids: ArrayVec<(BufferId, PresentationBufferState), PRESENTATION_BUFFER_COUNT>
§swap_chain: Option<SwapChain>
If there is no associated swapchain the context is dummy (transparent black)
next_presentation_id: PresentationId
Next presentation id to be returned
current_presentation_id: PresentationId
Current id that is presented/configured
This value only grows
Implementations§
source§impl ContextData
impl ContextData
sourcefn new(
context_id: WebGPUContextId,
image_key: ImageKey,
size: DeviceIntSize,
buffer_ids: ArrayVec<BufferId, PRESENTATION_BUFFER_COUNT>,
) -> Self
fn new( context_id: WebGPUContextId, image_key: ImageKey, size: DeviceIntSize, buffer_ids: ArrayVec<BufferId, PRESENTATION_BUFFER_COUNT>, ) -> Self
Init ContextData as dummy (transparent black)
fn dummy_data(&self) -> Vec<u8> ⓘ
sourcefn get_available_buffer(&mut self, global: &Arc<Global>) -> Option<BufferId>
fn get_available_buffer(&mut self, global: &Arc<Global>) -> Option<BufferId>
Returns id of available buffer and sets state to PresentationBufferState::Mapping
fn get_buffer_state( &mut self, buffer_id: BufferId, ) -> &mut PresentationBufferState
fn unmap_old_buffer(&mut self, presentation_buffer: GPUPresentationBuffer)
fn destroy_swapchain(&mut self, global: &Arc<Global>)
fn destroy( self, global: &Arc<Global>, script_sender: &IpcSender<WebGPUMsg>, webrender_api: &Arc<Mutex<RenderApi>>, webrender_document: DocumentId, )
sourcefn check_and_update_presentation_id(
&mut self,
presentation_id: PresentationId,
) -> bool
fn check_and_update_presentation_id( &mut self, presentation_id: PresentationId, ) -> bool
Returns true if presentation id was updated (was newer)
sourcefn next_presentation_id(&mut self) -> PresentationId
fn next_presentation_id(&mut self) -> PresentationId
Returns new presentation id
Auto Trait Implementations§
impl Freeze for ContextData
impl !RefUnwindSafe for ContextData
impl Send for ContextData
impl Sync for ContextData
impl Unpin for ContextData
impl !UnwindSafe for ContextData
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> 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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert