Update DESIGN.md

This commit is contained in:
tomaka 2015-11-01 11:27:36 +01:00
parent 5c6c8e8b72
commit 6f11dbd8f5

View File

@ -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. 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 ### Mutability
*Only relevant for buffers and images.* *Only relevant for buffers and images.*
@ -136,6 +138,11 @@ impl GpuAccess<T> {
pub fn lock(&self) -> &mut T { ... } pub fn lock(&self) -> &mut T { ... }
pub fn try_lock(&self) -> Option<&mut T> { ... } pub fn try_lock(&self) -> Option<&mut T> { ... }
} }
unsafe impl<T> SomeTrait<T> for GpuAccess<T> {
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. The command buffer writes the fence in the `GpuAccess` through a trait.