Skip to content

Commit

Permalink
render: Flush draws before updating bitmap texture
Browse files Browse the repository at this point in the history
This fixes an issue where new draws were drawn over an old GPU buffer.
For instance, consider the following scenario:

    1. draw (GPU)
    2. full fill (CPU)
    3. draw (GPU)

When full fill is executed, the GPU buffer is discarded without a sync,
but we have to make sure we wait for any queued draws in order to
truly discard 1.

Co-authored-by: Nathan Adams <[email protected]>
  • Loading branch information
2 people authored and torokati44 committed Dec 26, 2024
1 parent c9afa5b commit 21bdfdd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions render/wgpu/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ impl<T: RenderTarget + 'static> RenderBackend for WgpuRenderBackend<T> {
depth_or_array_layers: 1,
};

self.active_frame.submit_direct(&self.descriptors);
self.descriptors.queue.write_texture(
wgpu::ImageCopyTexture {
texture: &texture.texture,
Expand Down

0 comments on commit 21bdfdd

Please sign in to comment.