The ClInside/OutsideRenderPass traits now extend CommandsListOutput as well

This commit is contained in:
PierreKrieger 2016-09-28 15:37:56 +02:00 committed by Pierre Krieger
parent f29f81ed59
commit 8e03e74761
3 changed files with 19 additions and 7 deletions

View File

@ -141,7 +141,7 @@ unsafe impl<Cb, L> CommandsList for ExecuteCommand<Cb, L>
}
unsafe impl<Cb, L> CommandsListPossibleInsideRenderPass for ExecuteCommand<Cb, L>
where Cb: CommandsListOutput, L: CommandsListPossibleInsideRenderPass
where Cb: CommandsListOutput, L: CommandsListPossibleInsideRenderPass + CommandsListBase
{
type RenderPass = L::RenderPass;
type Framebuffer = L::Framebuffer;
@ -169,7 +169,7 @@ unsafe impl<Cb, L> CommandsListPossibleInsideRenderPass for ExecuteCommand<Cb, L
}
unsafe impl<Cb, L> CommandsListPossibleOutsideRenderPass for ExecuteCommand<Cb, L>
where Cb: CommandsListOutput, L: CommandsListPossibleOutsideRenderPass
where Cb: CommandsListOutput, L: CommandsListPossibleOutsideRenderPass + CommandsListBase
{
}

View File

@ -227,15 +227,22 @@ unsafe impl<C> AbstractCommandsList for C where C: CommandsList {
}
}*/
/// Extension trait for `CommandsListBase` that indicates that we're possibly outside a render pass.
pub unsafe trait CommandsListPossibleOutsideRenderPass: CommandsListBase {
/// Extension trait for both `CommandsListBase` and `CommandsListOutput` that indicates that we're
/// possibly outside a render pass.
///
/// In other words, if this trait is *not* implemented then we're guaranteed *not* to be outside
/// of a render pass. If it is implemented, then we maybe are but that's not sure.
pub unsafe trait CommandsListPossibleOutsideRenderPass {
/*/// Returns `true` if we're outside a render pass.
fn is_outside_render_pass(&self) -> bool;*/
}
/// Extension trait for `StdCommandsCommandsListBaseList` that indicates that we're possibly inside
/// a render pass.
pub unsafe trait CommandsListPossibleInsideRenderPass: CommandsListBase {
/// Extension trait for both `CommandsListBase` and `CommandsListOutput` that indicates that we're
/// possibly inside a render pass.
///
/// In other words, if this trait is *not* implemented then we're guaranteed *not* to be inside
/// a render pass. If it is implemented, then we maybe are but that's not sure.
pub unsafe trait CommandsListPossibleInsideRenderPass {
type RenderPass: RenderPass;
type Framebuffer: Framebuffer;

View File

@ -245,6 +245,11 @@ unsafe impl<L, B> CommandsListOutput for UpdateCommandCb<L, B>
}
}
unsafe impl<L, B> CommandsListPossibleOutsideRenderPass for UpdateCommandCb<L, B>
where B: TrackedBuffer, L: CommandsListOutput
{
}
#[cfg(test)]
mod tests {
use std::time::Duration;