pub trait DeviceExt {
// Required methods
fn create_buffer_init(&self, desc: &BufferInitDescriptor<'_>) -> Buffer;
fn create_texture_with_data(
&self,
queue: &Queue,
desc: &TextureDescriptor<Option<&str>, &[TextureFormat]>,
order: TextureDataOrder,
data: &[u8]
) -> Texture;
}
Expand description
Utility methods not meant to be in the main API.
Required Methods§
fn create_buffer_init(&self, desc: &BufferInitDescriptor<'_>) -> Buffer
fn create_buffer_init(&self, desc: &BufferInitDescriptor<'_>) -> Buffer
Creates a Buffer with data to initialize it.
fn create_texture_with_data(
&self,
queue: &Queue,
desc: &TextureDescriptor<Option<&str>, &[TextureFormat]>,
order: TextureDataOrder,
data: &[u8]
) -> Texture
fn create_texture_with_data( &self, queue: &Queue, desc: &TextureDescriptor<Option<&str>, &[TextureFormat]>, order: TextureDataOrder, data: &[u8] ) -> Texture
Upload an entire texture and its mipmaps from a source buffer.
Expects all mipmaps to be tightly packed in the data buffer.
See TextureDataOrder
for the order in which the data is laid out in memory.
Implicitly adds the COPY_DST
usage if it is not present in the descriptor,
as it is required to be able to upload the data to the gpu.