pixels - only copy new frame if not empty
This commit is contained in:
parent
3551b07211
commit
45ad484655
1 changed files with 5 additions and 3 deletions
|
@ -43,9 +43,11 @@ impl RendererBackend {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_frame(&mut self, buffer: &[[u8; 4]]) {
|
pub fn new_frame(&mut self, buffer: &[[u8; 4]]) {
|
||||||
self.pixels
|
if !buffer.is_empty() {
|
||||||
.frame_mut()
|
self.pixels
|
||||||
.copy_from_slice(bytemuck::cast_slice(buffer));
|
.frame_mut()
|
||||||
|
.copy_from_slice(bytemuck::cast_slice(buffer));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn render(&mut self, _: ResolutionData, _: &RendererBackendManager) {
|
pub fn render(&mut self, _: ResolutionData, _: &RendererBackendManager) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue