Struct conrod_wgpu::GlyphCacheCommand[][src]

pub struct GlyphCacheCommand<'a> {
    pub glyph_cache_pixel_buffer: &'a [u8],
    pub glyph_cache_texture: &'a Texture,
    pub width: u32,
    pub height: u32,
}
Expand description

An command for uploading an individual glyph.

Fields

glyph_cache_pixel_buffer: &'a [u8]

The CPU buffer containing the pixel data.

glyph_cache_texture: &'a Texture

The GPU image to which the glyphs are cached.

width: u32

The width of the texture.

height: u32

The height of the texture.

Implementations

impl<'a> GlyphCacheCommand<'a>[src]

pub fn create_buffer(&self, device: &Device) -> Buffer[src]

Creates a buffer on the GPU loaded with the updated pixel data.

Created with BufferUsage::COPY_SRC, ready to be copied to the texture.

TODO: In the future, we should consider re-using the same buffer and writing to it via Buffer::map_write_async. When asking about how to ensure that the write completes before the following copy_buffer_to_texture command, I was advised to just create a new buffer each time instead for now. EDIT:

if you try to map an existing buffer, it will give it to you only after all the gpu use of the buffer is over. So you can’t do it every frame reasonably

pub fn image_copy_buffer<'b>(&self, buffer: &'b Buffer) -> ImageCopyBuffer<'b>[src]

Create the copy view ready for copying the pixel data to the texture.

pub fn image_copy_texture(&self) -> ImageCopyTexture<'_>[src]

Create the texture copy view ready for receiving the pixel data from the buffer.

pub fn encode(&self, buffer: &Buffer, encoder: &mut CommandEncoder)[src]

Encode the command for copying the buffer’s pixel data to the glyph cache texture.

pub fn extent(&self) -> Extent3d[src]

The extent required for the copy command.

pub fn load_buffer_and_encode(&self, device: &Device, e: &mut CommandEncoder)[src]

Short-hand for create_buffer and encode in succession.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for GlyphCacheCommand<'a>

impl<'a> Send for GlyphCacheCommand<'a>

impl<'a> Sync for GlyphCacheCommand<'a>

impl<'a> Unpin for GlyphCacheCommand<'a>

impl<'a> !UnwindSafe for GlyphCacheCommand<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> Downcast<T> for T

pub fn downcast(&self) -> &T

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> Upcast<T> for T

pub fn upcast(&self) -> Option<&T>