From 6f11dbd8f5ab96b9267006728881699698111322 Mon Sep 17 00:00:00 2001 From: tomaka Date: Sun, 1 Nov 2015 11:27:36 +0100 Subject: [PATCH] Update DESIGN.md --- DESIGN.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DESIGN.md b/DESIGN.md index 99936876..0aaa6884 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -106,6 +106,8 @@ pub fn submit_command_buffer<'a>(cmd: &'a CommandsBuffer) -> FenceGuard<'a> { The `FenceGuard` ensures that the command buffer is alive. Destroying a `FenceGuard` blocks until the vulkan fence is fulfilled. +*Leak-safety: `CommandsBuffer` should contain a flag indicating whether or not it is currently locked. Destroying the `FenceGuard` clears the flag. Destroying a locked command buffer panicks. This avoids problems if the user `mem::forget`s the guard.*. + ### Mutability *Only relevant for buffers and images.* @@ -136,6 +138,11 @@ impl GpuAccess { pub fn lock(&self) -> &mut T { ... } pub fn try_lock(&self) -> Option<&mut T> { ... } } + +unsafe impl SomeTrait for GpuAccess { + unsafe fn force_access(&self) -> &mut T { ... } + fn block_until(&self, fence: Fence) { ... } +} ``` The command buffer writes the fence in the `GpuAccess` through a trait.