Make egui_wgpu::RenderPass Send and Sync (#1883)

* Make RenderPass Send and Sync

* Add change to CHANGELOG

* Make CHANGELOG formatting match egui

* Add test
This commit is contained in:
Dylan Ancel 2022-08-03 09:26:16 +02:00 committed by GitHub
parent cb0d5a58ab
commit 1af446b9e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -3,7 +3,8 @@ All notable changes to the `egui-wgpu` integration will be noted in this file.
## Unreleased ## 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)).
* Make `RenderPass` `Send` and `Sync` ([#1883](https://github.com/emilk/egui/pull/1883)).
## 0.18.0 - 2022-05-15 ## 0.18.0 - 2022-05-15
First published version since moving the code into the `egui` repository from <https://github.com/LU15W1R7H/eww>. First published version since moving the code into the `egui` repository from <https://github.com/LU15W1R7H/eww>.

View file

@ -3,7 +3,7 @@
use std::{borrow::Cow, collections::HashMap, num::NonZeroU32}; use std::{borrow::Cow, collections::HashMap, num::NonZeroU32};
use egui::{epaint::Primitive, NumExt, PaintCallbackInfo}; use egui::{epaint::Primitive, NumExt, PaintCallbackInfo};
use type_map::TypeMap; use type_map::concurrent::TypeMap;
use wgpu; use wgpu;
use wgpu::util::DeviceExt as _; use wgpu::util::DeviceExt as _;
@ -133,7 +133,7 @@ pub struct RenderPass {
next_user_texture_id: u64, next_user_texture_id: u64,
/// Storage for use by [`egui::PaintCallback`]'s that need to store resources such as render /// Storage for use by [`egui::PaintCallback`]'s that need to store resources such as render
/// pipelines that must have the lifetime of the renderpass. /// pipelines that must have the lifetime of the renderpass.
pub paint_callback_resources: type_map::TypeMap, pub paint_callback_resources: TypeMap,
} }
impl RenderPass { impl RenderPass {
@ -807,3 +807,9 @@ impl ScissorRect {
} }
} }
} }
#[test]
fn render_pass_impl_send_sync() {
fn assert_send_sync<T: Send + Sync>() {}
assert_send_sync::<RenderPass>();
}