From 7a73c75e6aa5dcf3b998648863bbc66e1a2314bd Mon Sep 17 00:00:00 2001
From: sagudev <16504129+sagudev@users.noreply.github.com>
Date: Fri, 19 Jul 2024 15:43:21 +0200
Subject: [PATCH] Make RequestDeviceError (de)serializable
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
---
wgpu-core/src/instance.rs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/wgpu-core/src/instance.rs b/wgpu-core/src/instance.rs
index 8c580588f..ba58f6d2e 100644
--- a/wgpu-core/src/instance.rs
+++ b/wgpu-core/src/instance.rs
@@ -23,6 +23,7 @@ type HalInstance = ::Instance;
type HalSurface = ::Surface;
#[derive(Clone, Debug, Error)]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[error("Limit '{name}' value {requested} is better than allowed {allowed}")]
pub struct FailedLimit {
name: &'static str,
@@ -391,6 +392,8 @@ pub enum GetSurfaceSupportError {
}
#[derive(Clone, Debug, Error)]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
+#[cfg_attr(feature = "serde", serde(bound(deserialize = "'de: 'static")))]
/// Error when requesting a device from the adaptor
#[non_exhaustive]
pub enum RequestDeviceError {