aboutsummaryrefslogtreecommitdiff
path: root/stockton-skeleton/src/draw_passes/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'stockton-skeleton/src/draw_passes/mod.rs')
-rw-r--r--stockton-skeleton/src/draw_passes/mod.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/stockton-skeleton/src/draw_passes/mod.rs b/stockton-skeleton/src/draw_passes/mod.rs
index cdc983f..5b138c2 100644
--- a/stockton-skeleton/src/draw_passes/mod.rs
+++ b/stockton-skeleton/src/draw_passes/mod.rs
@@ -27,11 +27,15 @@ pub trait DrawPass<P: PassPosition> {
) -> Result<()>;
/// Called just after the surface changes (probably a resize).
+ /// This takes ownership and returns itself to ensure that the `DrawPass` is not called again if it fails.
+ /// This means you should deactivate as much as possible in case of an error.
fn handle_surface_change(
- &mut self,
+ self,
session: &Session,
context: &mut RenderingContext,
- ) -> Result<()>;
+ ) -> Result<Self>
+ where
+ Self: Sized;
/// Deactivate any vulkan parts that need to be deactivated
fn deactivate(self, context: &mut RenderingContext) -> Result<()>;