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,

An command for uploading an individual glyph.


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.


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 buffer_copy_view<'b>(&self, buffer: &'b Buffer) -> BufferCopyView<'b>[src]

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

pub fn texture_copy_view(&self) -> TextureCopyView<'_>[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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Downcast<T> for T

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

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> Upcast<T> for T