Skip to main content

readback_rgba8

Function readback_rgba8 

Source
pub fn readback_rgba8(
    device: &Device,
    queue: &Queue,
    texture: &Texture,
    w: u32,
    h: u32,
) -> Result<Vec<u8>, RenderError>
Expand description

Read an Rgba8Unorm-sized (4 bytes per texel) w x h texture back as tightly packed RGBA8 (row 0 = top). Submits its own copy and waits for it, so the frame’s command buffers must have been submitted. Always an error on the web ([SYNC_READBACK]).