mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add comments
This commit is contained in:
parent
8488c7b25e
commit
ca2ef3e813
@ -175,7 +175,10 @@ impl TakeScreenshot {
|
||||
let image = match self.tex_format {
|
||||
wgpu::TextureFormat::Bgra8UnormSrgb => {
|
||||
let (pixels, rest) = pixel_bytes.as_chunks_mut();
|
||||
// Always valid because each pixel should use four bytes.
|
||||
assert!(rest.is_empty());
|
||||
|
||||
// Swap blue and red components to get a RGBA texture.
|
||||
for [b, _g, r, _a] in pixels {
|
||||
std::mem::swap(b, r);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user