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
Creates a buffer on the GPU loaded with the updated pixel data.
Created with BufferUsages::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
Create the copy view ready for copying the pixel data to the texture.
Create the texture copy view ready for receiving the pixel data from the buffer.
Encode the command for copying the buffer’s pixel data to the glyph cache texture.
Short-hand for create_buffer
and encode
in succession.