From e772d0cfd48c973242751fa808f8c2d22d707209 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Sun, 21 Aug 2016 14:53:34 +0200 Subject: [PATCH] Extract the state-extraction functions to their own trait --- vulkano/src/command_buffer/std/dispatch.rs | 49 +++++---- vulkano/src/command_buffer/std/draw.rs | 50 +++++---- vulkano/src/command_buffer/std/empty.rs | 31 +++--- vulkano/src/command_buffer/std/mod.rs | 61 +++++------ vulkano/src/command_buffer/std/render_pass.rs | 101 ++++++++++-------- .../src/command_buffer/std/update_buffer.rs | 63 ++++++----- .../descriptor/descriptor_set/collection.rs | 56 +++------- vulkano/src/descriptor/descriptor_set/mod.rs | 16 +-- 8 files changed, 219 insertions(+), 208 deletions(-) diff --git a/vulkano/src/command_buffer/std/dispatch.rs b/vulkano/src/command_buffer/std/dispatch.rs index 2fdd1169..cd518e7a 100644 --- a/vulkano/src/command_buffer/std/dispatch.rs +++ b/vulkano/src/command_buffer/std/dispatch.rs @@ -14,6 +14,7 @@ use smallvec::SmallVec; use buffer::traits::TrackedBuffer; use command_buffer::std::OutsideRenderPass; +use command_buffer::std::ResourcesStates; use command_buffer::std::StdCommandsList; use command_buffer::submit::CommandBuffer; use command_buffer::submit::SubmitInfo; @@ -62,7 +63,7 @@ impl<'a, L, Pl, S, Pc> DispatchCommand<'a, L, Pl, S, Pc> push_constants: &'a Pc) -> DispatchCommand<'a, L, Pl, S, Pc> { let (sets_state, barrier_loc, barrier) = unsafe { - sets.extract_from_commands_list_and_transition(&mut previous) + sets.extract_states_and_transition(&mut previous) }; DispatchCommand { @@ -97,27 +98,6 @@ unsafe impl<'a, L, Pl, S, Pc> StdCommandsList for DispatchCommand<'a, L, Pl, S, self.previous.check_queue_validity(queue) } - unsafe fn extract_current_buffer_state(&mut self, buffer: &Ob) - -> Option - where Ob: TrackedBuffer - { - if let Some(s) = self.sets_state.extract_buffer_state(buffer) { - return Some(s); - } - - self.previous.extract_current_buffer_state(buffer) - } - - unsafe fn extract_current_image_state(&mut self, image: &I) -> Option - where I: TrackedImage - { - if let Some(s) = self.sets_state.extract_image_state(image) { - return Some(s); - } - - self.previous.extract_current_image_state(image) - } - #[inline] fn is_compute_pipeline_bound(&self, pipeline: &Arc>) -> bool { pipeline.internal_object() == self.pipeline.internal_object() @@ -197,6 +177,31 @@ unsafe impl<'a, L, Pl, S, Pc> StdCommandsList for DispatchCommand<'a, L, Pl, S, } } +unsafe impl<'a, L, Pl, S, Pc> ResourcesStates for DispatchCommand<'a, L, Pl, S, Pc> + where L: StdCommandsList, Pl: PipelineLayout, S: TrackedDescriptorSetsCollection, Pc: 'a +{ + unsafe fn extract_buffer_state(&mut self, buffer: &Ob) + -> Option + where Ob: TrackedBuffer + { + if let Some(s) = self.sets_state.extract_buffer_state(buffer) { + return Some(s); + } + + self.previous.extract_buffer_state(buffer) + } + + unsafe fn extract_image_state(&mut self, image: &I) -> Option + where I: TrackedImage + { + if let Some(s) = self.sets_state.extract_image_state(image) { + return Some(s); + } + + self.previous.extract_image_state(image) + } +} + unsafe impl<'a, L, Pl, S, Pc> OutsideRenderPass for DispatchCommand<'a, L, Pl, S, Pc> where L: StdCommandsList, Pl: PipelineLayout, S: TrackedDescriptorSetsCollection, Pc: 'a { diff --git a/vulkano/src/command_buffer/std/draw.rs b/vulkano/src/command_buffer/std/draw.rs index 422414b4..4d5deca1 100644 --- a/vulkano/src/command_buffer/std/draw.rs +++ b/vulkano/src/command_buffer/std/draw.rs @@ -16,6 +16,7 @@ use buffer::traits::Buffer; use buffer::traits::TrackedBuffer; use command_buffer::DynamicState; use command_buffer::std::InsideRenderPass; +use command_buffer::std::ResourcesStates; use command_buffer::std::StdCommandsList; use command_buffer::submit::CommandBuffer; use command_buffer::submit::SubmitInfo; @@ -88,7 +89,7 @@ impl<'a, L, Pv, Pl, Prp, S, Pc> DrawCommand<'a, L, Pv, Pl, Prp, S, Pc> where Pv: Source { let (sets_state, barrier_loc, barrier) = unsafe { - sets.extract_from_commands_list_and_transition(&mut previous) + sets.extract_states_and_transition(&mut previous) }; // FIXME: lot of stuff missing here @@ -134,27 +135,6 @@ unsafe impl<'a, L, Pv, Pl, Prp, S, Pc> StdCommandsList for DrawCommand<'a, L, Pv self.previous.check_queue_validity(queue) } - unsafe fn extract_current_buffer_state(&mut self, buffer: &Ob) - -> Option - where Ob: TrackedBuffer - { - if let Some(s) = self.sets_state.extract_buffer_state(buffer) { - return Some(s); - } - - self.previous.extract_current_buffer_state(buffer) - } - - unsafe fn extract_current_image_state(&mut self, image: &I) -> Option - where I: TrackedImage - { - if let Some(s) = self.sets_state.extract_image_state(image) { - return Some(s); - } - - self.previous.extract_current_image_state(image) - } - #[inline] fn is_compute_pipeline_bound(&self, pipeline: &Arc>) -> bool { @@ -253,6 +233,32 @@ unsafe impl<'a, L, Pv, Pl, Prp, S, Pc> StdCommandsList for DrawCommand<'a, L, Pv } } +unsafe impl<'a, L, Pv, Pl, Prp, S, Pc> ResourcesStates for DrawCommand<'a, L, Pv, Pl, Prp, S, Pc> + where L: StdCommandsList, Pl: PipelineLayout, + S: TrackedDescriptorSetsCollection, Pc: 'a +{ + unsafe fn extract_buffer_state(&mut self, buffer: &Ob) + -> Option + where Ob: TrackedBuffer + { + if let Some(s) = self.sets_state.extract_buffer_state(buffer) { + return Some(s); + } + + self.previous.extract_buffer_state(buffer) + } + + unsafe fn extract_image_state(&mut self, image: &I) -> Option + where I: TrackedImage + { + if let Some(s) = self.sets_state.extract_image_state(image) { + return Some(s); + } + + self.previous.extract_image_state(image) + } +} + unsafe impl<'a, L, Pv, Pl, Prp, S, Pc> InsideRenderPass for DrawCommand<'a, L, Pv, Pl, Prp, S, Pc> where L: StdCommandsList + InsideRenderPass, Pl: PipelineLayout, S: TrackedDescriptorSetsCollection, Pc: 'a diff --git a/vulkano/src/command_buffer/std/empty.rs b/vulkano/src/command_buffer/std/empty.rs index 00b269e6..03def835 100644 --- a/vulkano/src/command_buffer/std/empty.rs +++ b/vulkano/src/command_buffer/std/empty.rs @@ -15,6 +15,7 @@ use buffer::traits::TrackedBuffer; use command_buffer::pool::CommandPool; use command_buffer::pool::StandardCommandPool; use command_buffer::std::OutsideRenderPass; +use command_buffer::std::ResourcesStates; use command_buffer::std::StdCommandsList; use command_buffer::submit::CommandBuffer; use command_buffer::submit::SubmitInfo; @@ -73,20 +74,6 @@ unsafe impl

StdCommandsList for PrimaryCbBuilder

where P: CommandPool { Ok(()) } - #[inline] - unsafe fn extract_current_buffer_state(&mut self, buffer: &B) -> Option - where B: TrackedBuffer - { - None - } - - #[inline] - unsafe fn extract_current_image_state(&mut self, image: &I) -> Option - where I: TrackedImage - { - None - } - #[inline] fn is_compute_pipeline_bound(&self, pipeline: &Arc>) -> bool { @@ -132,6 +119,22 @@ unsafe impl

StdCommandsList for PrimaryCbBuilder

where P: CommandPool { } } +unsafe impl

ResourcesStates for PrimaryCbBuilder

where P: CommandPool { + #[inline] + unsafe fn extract_buffer_state(&mut self, buffer: &B) -> Option + where B: TrackedBuffer + { + None + } + + #[inline] + unsafe fn extract_image_state(&mut self, image: &I) -> Option + where I: TrackedImage + { + None + } +} + unsafe impl

OutsideRenderPass for PrimaryCbBuilder

where P: CommandPool {} pub struct PrimaryCb

> where P: CommandPool { diff --git a/vulkano/src/command_buffer/std/mod.rs b/vulkano/src/command_buffer/std/mod.rs index 9c041478..92f64f12 100644 --- a/vulkano/src/command_buffer/std/mod.rs +++ b/vulkano/src/command_buffer/std/mod.rs @@ -37,7 +37,7 @@ pub mod render_pass; pub mod update_buffer; /// A list of commands that can be turned into a command buffer. -pub unsafe trait StdCommandsList { +pub unsafe trait StdCommandsList: ResourcesStates { /// The type of the pool that will be used to create the command buffer. type Pool: CommandPool; /// The type of the command buffer that will be generated. @@ -142,35 +142,6 @@ pub unsafe trait StdCommandsList { // TODO: error type? fn check_queue_validity(&self, queue: QueueFamily) -> Result<(), ()>; - /// Returns the current status of a buffer, or `None` if the buffer hasn't been used yet. - /// - /// Whether the buffer passed as parameter is the same as the one in the commands list must be - /// determined with the `is_same` method of `TrackedBuffer`. - /// - /// Calling this function tells the commands list that you are going to manage the - /// synchronization that buffer yourself. Hence why the function is unsafe. - /// - /// This function is not meant to be called, except when writing a wrapper around a - /// commands list. - /// - /// # Panic - /// - /// - Panics if the state of that buffer has already been previously extracted. - /// - unsafe fn extract_current_buffer_state(&mut self, buffer: &B) -> Option - where B: TrackedBuffer; - - /// Returns the current status of an image, or `None` if the image hasn't been used yet. - /// - /// See the description of `extract_current_buffer_state`. - /// - /// # Panic - /// - /// - Panics if the state of that image has already been previously extracted. - /// - unsafe fn extract_current_image_state(&mut self, image: &I) -> Option - where I: TrackedImage; - /// Returns true if the given compute pipeline is currently binded in the commands list. fn is_compute_pipeline_bound(&self, pipeline: &Arc>) -> bool; @@ -220,3 +191,33 @@ pub unsafe trait InsideRenderPass: StdCommandsList { fn framebuffer(&self) -> &Self::Framebuffer; } + +/// Trait for objects that hold states of buffers and images. +pub unsafe trait ResourcesStates { + /// Returns the state of a buffer, or `None` if the buffer hasn't been used yet. + /// + /// Whether the buffer passed as parameter is the same as the one in the commands list must be + /// determined with the `is_same` method of `TrackedBuffer`. + /// + /// Calling this function extracts the state from the list, meaning that the state will be + /// managed by the code that called this function instead of being managed by the object + /// itself. Hence why the function is unsafe. + /// + /// # Panic + /// + /// - Panics if the state of that buffer has already been previously extracted. + /// + unsafe fn extract_buffer_state(&mut self, buffer: &B) -> Option + where B: TrackedBuffer; + + /// Returns the state of an image, or `None` if the image hasn't been used yet. + /// + /// See the description of `extract_buffer_state`. + /// + /// # Panic + /// + /// - Panics if the state of that image has already been previously extracted. + /// + unsafe fn extract_image_state(&mut self, image: &I) -> Option + where I: TrackedImage; +} diff --git a/vulkano/src/command_buffer/std/render_pass.rs b/vulkano/src/command_buffer/std/render_pass.rs index c9bd4f3c..c5723b8d 100644 --- a/vulkano/src/command_buffer/std/render_pass.rs +++ b/vulkano/src/command_buffer/std/render_pass.rs @@ -15,6 +15,7 @@ use smallvec::SmallVec; use buffer::traits::TrackedBuffer; use command_buffer::std::InsideRenderPass; use command_buffer::std::OutsideRenderPass; +use command_buffer::std::ResourcesStates; use command_buffer::std::StdCommandsList; use command_buffer::submit::CommandBuffer; use command_buffer::submit::SubmitInfo; @@ -97,21 +98,6 @@ unsafe impl StdCommandsList for BeginRenderPassCommand false } - unsafe fn extract_current_buffer_state(&mut self, buffer: &Ob) - -> Option - where Ob: TrackedBuffer - { - // FIXME: state of images in the framebuffer - self.previous.extract_current_buffer_state(buffer) - } - - unsafe fn extract_current_image_state(&mut self, image: &I) -> Option - where I: TrackedImage - { - // FIXME: state of images in the framebuffer - self.previous.extract_current_image_state(image) - } - #[inline] fn is_compute_pipeline_bound(&self, pipeline: &Arc>) -> bool { @@ -153,6 +139,25 @@ unsafe impl StdCommandsList for BeginRenderPassCommand } } +unsafe impl ResourcesStates for BeginRenderPassCommand + where L: StdCommandsList, Rp: RenderPass, Rpf: RenderPass +{ + unsafe fn extract_buffer_state(&mut self, buffer: &Ob) + -> Option + where Ob: TrackedBuffer + { + // FIXME: state of images in the framebuffer + self.previous.extract_buffer_state(buffer) + } + + unsafe fn extract_image_state(&mut self, image: &I) -> Option + where I: TrackedImage + { + // FIXME: state of images in the framebuffer + self.previous.extract_image_state(image) + } +} + unsafe impl InsideRenderPass for BeginRenderPassCommand where L: StdCommandsList, Rp: RenderPass, Rpf: RenderPass { @@ -259,21 +264,6 @@ unsafe impl StdCommandsList for NextSubpassCommand false } - #[inline] - unsafe fn extract_current_buffer_state(&mut self, buffer: &Ob) - -> Option - where Ob: TrackedBuffer - { - self.previous.extract_current_buffer_state(buffer) - } - - #[inline] - unsafe fn extract_current_image_state(&mut self, image: &I) -> Option - where I: TrackedImage - { - self.previous.extract_current_image_state(image) - } - #[inline] fn is_compute_pipeline_bound(&self, pipeline: &Arc>) -> bool { @@ -305,6 +295,25 @@ unsafe impl StdCommandsList for NextSubpassCommand } } +unsafe impl ResourcesStates for NextSubpassCommand + where L: StdCommandsList + InsideRenderPass +{ + #[inline] + unsafe fn extract_buffer_state(&mut self, buffer: &Ob) + -> Option + where Ob: TrackedBuffer + { + self.previous.extract_buffer_state(buffer) + } + + #[inline] + unsafe fn extract_image_state(&mut self, image: &I) -> Option + where I: TrackedImage + { + self.previous.extract_image_state(image) + } +} + unsafe impl InsideRenderPass for NextSubpassCommand where L: StdCommandsList + InsideRenderPass { @@ -399,21 +408,6 @@ unsafe impl StdCommandsList for EndRenderPassCommand where L: StdCommandsL true } - #[inline] - unsafe fn extract_current_buffer_state(&mut self, buffer: &Ob) - -> Option - where Ob: TrackedBuffer - { - self.previous.extract_current_buffer_state(buffer) - } - - #[inline] - unsafe fn extract_current_image_state(&mut self, image: &I) -> Option - where I: TrackedImage - { - self.previous.extract_current_image_state(image) - } - #[inline] fn is_compute_pipeline_bound(&self, pipeline: &Arc>) -> bool { @@ -453,6 +447,23 @@ unsafe impl StdCommandsList for EndRenderPassCommand where L: StdCommandsL } } +unsafe impl ResourcesStates for EndRenderPassCommand where L: StdCommandsList { + #[inline] + unsafe fn extract_buffer_state(&mut self, buffer: &Ob) + -> Option + where Ob: TrackedBuffer + { + self.previous.extract_buffer_state(buffer) + } + + #[inline] + unsafe fn extract_image_state(&mut self, image: &I) -> Option + where I: TrackedImage + { + self.previous.extract_image_state(image) + } +} + unsafe impl OutsideRenderPass for EndRenderPassCommand where L: StdCommandsList { } diff --git a/vulkano/src/command_buffer/std/update_buffer.rs b/vulkano/src/command_buffer/std/update_buffer.rs index fbcb4d0f..b3263ea9 100644 --- a/vulkano/src/command_buffer/std/update_buffer.rs +++ b/vulkano/src/command_buffer/std/update_buffer.rs @@ -18,6 +18,7 @@ use buffer::traits::CommandListState; use buffer::traits::PipelineBarrierRequest; use buffer::traits::TrackedBuffer; use command_buffer::std::OutsideRenderPass; +use command_buffer::std::ResourcesStates; use command_buffer::std::StdCommandsList; use command_buffer::submit::CommandBuffer; use command_buffer::submit::SubmitInfo; @@ -63,7 +64,7 @@ impl<'a, L, B, D: ?Sized> UpdateCommand<'a, L, B, D> let stage = PipelineStages { transfer: true, .. PipelineStages::none() }; let access = AccessFlagBits { transfer_write: true, .. AccessFlagBits::none() }; - previous.extract_current_buffer_state(&buffer) + previous.extract_buffer_state(&buffer) .unwrap_or(buffer.initial_state()) .transition(previous.num_commands() + 1, buffer.inner(), 0, buffer.size(), true, stage, access) @@ -108,33 +109,6 @@ unsafe impl<'a, L, B, D: ?Sized> StdCommandsList for UpdateCommand<'a, L, B, D> true } - unsafe fn extract_current_buffer_state(&mut self, buffer: &Ob) - -> Option - where Ob: TrackedBuffer - { - if self.buffer.is_same_buffer(buffer) { - let s: &mut Option = (&mut self.buffer_state as &mut Any) - .downcast_mut().unwrap(); - Some(s.take().unwrap()) - - } else { - self.previous.extract_current_buffer_state(buffer) - } - } - - unsafe fn extract_current_image_state(&mut self, image: &I) -> Option - where I: TrackedImage - { - if self.buffer.is_same_image(image) { - let s: &mut Option = (&mut self.buffer_state as &mut Any) - .downcast_mut().unwrap(); - Some(s.take().unwrap()) - - } else { - self.previous.extract_current_image_state(image) - } - } - #[inline] fn is_compute_pipeline_bound(&self, pipeline: &Arc>) -> bool { @@ -209,6 +183,39 @@ unsafe impl<'a, L, B, D: ?Sized> StdCommandsList for UpdateCommand<'a, L, B, D> } } +unsafe impl<'a, L, B, D: ?Sized> ResourcesStates for UpdateCommand<'a, L, B, D> + where B: TrackedBuffer, + L: StdCommandsList, + D: Copy + 'static, +{ + unsafe fn extract_buffer_state(&mut self, buffer: &Ob) + -> Option + where Ob: TrackedBuffer + { + if self.buffer.is_same_buffer(buffer) { + let s: &mut Option = (&mut self.buffer_state as &mut Any) + .downcast_mut().unwrap(); + Some(s.take().unwrap()) + + } else { + self.previous.extract_buffer_state(buffer) + } + } + + unsafe fn extract_image_state(&mut self, image: &I) -> Option + where I: TrackedImage + { + if self.buffer.is_same_image(image) { + let s: &mut Option = (&mut self.buffer_state as &mut Any) + .downcast_mut().unwrap(); + Some(s.take().unwrap()) + + } else { + self.previous.extract_image_state(image) + } + } +} + unsafe impl<'a, L, B, D: ?Sized> OutsideRenderPass for UpdateCommand<'a, L, B, D> where B: TrackedBuffer, L: StdCommandsList, diff --git a/vulkano/src/descriptor/descriptor_set/collection.rs b/vulkano/src/descriptor/descriptor_set/collection.rs index 2c60f374..3a9d7fdd 100644 --- a/vulkano/src/descriptor/descriptor_set/collection.rs +++ b/vulkano/src/descriptor/descriptor_set/collection.rs @@ -14,7 +14,7 @@ use std::sync::Arc; use std::vec::IntoIter as VecIntoIter; use buffer::traits::TrackedBuffer; -use command_buffer::std::StdCommandsList; +use command_buffer::std::ResourcesStates; use command_buffer::submit::SubmitInfo; use command_buffer::sys::PipelineBarrierBuilder; use descriptor::descriptor::DescriptorDesc; @@ -52,43 +52,19 @@ pub unsafe trait TrackedDescriptorSetsCollection: DescriptorSetsCollection { /// Finished state of the resources inside the collection. type Finished: TrackedDescriptorSetsCollectionFinished; - /// Extracts from the commands list the states relevant to the buffers and images contained in - /// the descriptor sets. Then transitions them to the right state and returns a pipeline - /// barrier to insert as part of the transition. The `usize` is the location of the barrier. - unsafe fn extract_from_commands_list_and_transition(&self, list: &mut L) - -> (Self::State, usize, PipelineBarrierBuilder) - where L: StdCommandsList; + /// Extracts the states relevant to the buffers and images contained in the descriptor sets. + /// Then transitions them to the right state and returns a pipeline barrier to insert as part + /// of the transition. The `usize` is the location of the barrier. + unsafe fn extract_states_and_transition(&self, list: &mut S) + -> (Self::State, usize, PipelineBarrierBuilder) + where S: ResourcesStates; } /// State of the resources inside the collection. -pub unsafe trait TrackedDescriptorSetsCollectionState { +pub unsafe trait TrackedDescriptorSetsCollectionState: ResourcesStates { /// Finished state of the resources inside the collection. type Finished: TrackedDescriptorSetsCollectionFinished; - /// Extracts the state of a buffer of the collection, or `None` if the buffer isn't in the - /// collection. - /// - /// Whether the buffer passed as parameter is the same as one in the collection must be - /// determined with the `is_same` method of `TrackedBuffer` or `TrackedImage`. - /// - /// # Panic - /// - /// - Panics if the state of that buffer has already been previously extracted. - /// - unsafe fn extract_buffer_state(&mut self, buffer: &B) -> Option - where B: TrackedBuffer; - - /// Returns the state of an image, or `None` if the image isn't in the collection. - /// - /// See the description of `extract_buffer_state`. - /// - /// # Panic - /// - /// - Panics if the state of that image has already been previously extracted. - /// - unsafe fn extract_image_state(&mut self, image: &I) -> Option - where I: TrackedImage; - /// Turns the object into a `TrackedDescriptorSetsCollectionFinished`. All the buffers and /// images whose state hasn't been extracted must be have `finished()` called on them as well. /// @@ -134,9 +110,9 @@ unsafe impl TrackedDescriptorSetsCollection for () { type Finished = EmptyState; #[inline] - unsafe fn extract_from_commands_list_and_transition(&self, list: &mut L) + unsafe fn extract_states_and_transition(&self, list: &mut S) -> (Self::State, usize, PipelineBarrierBuilder) - where L: StdCommandsList + where S: ResourcesStates { (EmptyState, 0, PipelineBarrierBuilder::new()) } @@ -148,6 +124,13 @@ pub struct EmptyState; unsafe impl TrackedDescriptorSetsCollectionState for EmptyState { type Finished = EmptyState; + #[inline] + unsafe fn finish(self) -> (Self::Finished, PipelineBarrierBuilder) { + (EmptyState, PipelineBarrierBuilder::new()) + } +} + +unsafe impl ResourcesStates for EmptyState { #[inline] unsafe fn extract_buffer_state(&mut self, buffer: &B) -> Option where B: TrackedBuffer @@ -161,11 +144,6 @@ unsafe impl TrackedDescriptorSetsCollectionState for EmptyState { { None } - - #[inline] - unsafe fn finish(self) -> (Self::Finished, PipelineBarrierBuilder) { - (EmptyState, PipelineBarrierBuilder::new()) - } } unsafe impl TrackedDescriptorSetsCollectionFinished for EmptyState { diff --git a/vulkano/src/descriptor/descriptor_set/mod.rs b/vulkano/src/descriptor/descriptor_set/mod.rs index 2dbbabfd..24ca58aa 100644 --- a/vulkano/src/descriptor/descriptor_set/mod.rs +++ b/vulkano/src/descriptor/descriptor_set/mod.rs @@ -10,7 +10,7 @@ use std::sync::Arc; use buffer::traits::TrackedBuffer; -use command_buffer::std::StdCommandsList; +use command_buffer::std::ResourcesStates; use command_buffer::submit::SubmitInfo; use command_buffer::sys::PipelineBarrierBuilder; use descriptor::descriptor::DescriptorDesc; @@ -57,15 +57,15 @@ pub unsafe trait TrackedDescriptorSet: DescriptorSet { type State: TrackedDescriptorSetState; type Finished: TrackedDescriptorSetFinished; - /// Extracts from the commands list the states relevant to the buffers and images contained in - /// the descriptor set. Then transitions them to the right state. - unsafe fn extract_from_commands_list_and_transition(&self, list: &mut L) - -> (Self::State, usize, PipelineBarrierBuilder) - where L: StdCommandsList; + /// Extracts the states relevant to the buffers and images contained in the descriptor set. + /// Then transitions them to the right state. + unsafe fn extract_states_and_transition(&self, list: &mut L) + -> (Self::State, usize, PipelineBarrierBuilder) + where L: ResourcesStates; } // TODO: re-read docs -pub unsafe trait TrackedDescriptorSetState { +pub unsafe trait TrackedDescriptorSetState: ResourcesStates { type Finished: TrackedDescriptorSetFinished; /// Extracts the state of a buffer of the descriptor set, or `None` if the buffer isn't in @@ -83,7 +83,7 @@ pub unsafe trait TrackedDescriptorSetState { /// Returns the state of an image, or `None` if the image isn't in the descriptor set. /// - /// See the description of `extract_current_buffer_state`. + /// See the description of `extract_buffer_state`. /// /// # Panic ///