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]
impl<'a> GlyphCacheCommand<'a>
[src]pub fn create_buffer(&self, device: &Device) -> Buffer
[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]
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]
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]
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 load_buffer_and_encode(&self, device: &Device, e: &mut CommandEncoder)
[src]
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more