From 8638a86d4870a5f418ab1a3020c25a34024a6b87 Mon Sep 17 00:00:00 2001 From: Layl <2385329-layl@users.noreply.gitlab.com> Date: Sat, 28 Dec 2019 18:14:45 +0100 Subject: [PATCH] [rs] Mark CommandEncoder as !Send !Sync --- wgpu/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index c4a7341b15..93bcc75d78 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -236,6 +236,9 @@ pub struct CommandBuffer { #[derive(Debug)] pub struct CommandEncoder { id: wgc::id::CommandEncoderId, + /// This type should be !Send !Sync, because it represents an allocation on this thread's + /// command buffer. + _p: std::marker::PhantomData<*const u8>, } /// An in-progress recording of a render pass. @@ -599,6 +602,7 @@ impl Device { pub fn create_command_encoder(&self, desc: &CommandEncoderDescriptor) -> CommandEncoder { CommandEncoder { id: wgn::wgpu_device_create_command_encoder(self.id, Some(desc)), + _p: Default::default(), } }