Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make egui_wgpu::RenderPass Send and Sync #1883

Merged
merged 4 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion egui-wgpu/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ All notable changes to the `egui-wgpu` integration will be noted in this file.


## Unreleased
Enables deferred render + surface state initialization for Android ([#1634](https://github.com/emilk/egui/pull/1634))
* Enables deferred render + surface state initialization for Android ([#1634](https://github.com/emilk/egui/pull/1634)).
leudz marked this conversation as resolved.
Show resolved Hide resolved
* Make `RenderPass` `Send` and `Sync` ([#1883](https://github.com/emilk/egui/pull/1883)).

## 0.18.0 - 2022-05-15
First published version since moving the code into the `egui` repository from <https://github.com/LU15W1R7H/eww>.
10 changes: 8 additions & 2 deletions egui-wgpu/src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::{borrow::Cow, collections::HashMap, num::NonZeroU32};

use egui::{epaint::Primitive, NumExt, PaintCallbackInfo};
use type_map::TypeMap;
use type_map::concurrent::TypeMap;
use wgpu;
use wgpu::util::DeviceExt as _;

Expand Down Expand Up @@ -132,7 +132,7 @@ pub struct RenderPass {
next_user_texture_id: u64,
/// Storage for use by [`egui::PaintCallback`]'s that need to store resources such as render
/// pipelines that must have the lifetime of the renderpass.
pub paint_callback_resources: type_map::TypeMap,
pub paint_callback_resources: TypeMap,
}

impl RenderPass {
Expand Down Expand Up @@ -806,3 +806,9 @@ impl ScissorRect {
}
}
}

#[test]
fn render_pass_impl_send_sync() {
fn assert_send_sync<T: Send + Sync>() {}
assert_send_sync::<RenderPass>();
}