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.
The width of the texture.
The height of the texture.
pub fn create_buffer(&self, device: &Device) -> Buffer[src]
Creates a buffer on the GPU loaded with the updated pixel data.
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
copy_buffer_to_texture command, I was advised to just create a new buffer
each time instead for now.
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.
The extent required for the copy command.
pub fn load_buffer_and_encode(&self, device: &Device, e: &mut CommandEncoder)[src]
encode in succession.
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>
type Error = Infallible
The type returned in the event of a conversion error.