• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2016 The vulkano developers
2 // Licensed under the Apache License, Version 2.0
3 // <LICENSE-APACHE or
4 // https://www.apache.org/licenses/LICENSE-2.0> or the MIT
5 // license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
6 // at your option. All files in the project carrying such
7 // notice may not be copied, modified, or distributed except
8 // according to those terms.
9 
10 //! Low-level builders that allow submitting an operation to a queue.
11 //!
12 //! In order to submit an operation to the GPU, you must use one of the builder structs of this
13 //! module. These structs are low-level and unsafe, and are mostly used to implement other parts
14 //! of vulkano, so you are encouraged to not use them directly.
15 
16 pub use self::bind_sparse::SubmitBindSparseBatchBuilder;
17 pub use self::bind_sparse::SubmitBindSparseBufferBindBuilder;
18 pub use self::bind_sparse::SubmitBindSparseBuilder;
19 pub use self::bind_sparse::SubmitBindSparseError;
20 pub use self::bind_sparse::SubmitBindSparseImageBindBuilder;
21 pub use self::bind_sparse::SubmitBindSparseImageOpaqueBindBuilder;
22 pub use self::queue_present::SubmitPresentBuilder;
23 pub use self::queue_present::SubmitPresentError;
24 pub use self::queue_submit::SubmitCommandBufferBuilder;
25 pub use self::queue_submit::SubmitCommandBufferError;
26 pub use self::semaphores_wait::SubmitSemaphoresWaitBuilder;
27 
28 mod bind_sparse;
29 mod queue_present;
30 mod queue_submit;
31 mod semaphores_wait;
32 
33 /// Contains all the possible submission builders.
34 #[derive(Debug)]
35 pub enum SubmitAnyBuilder<'a> {
36     Empty,
37     SemaphoresWait(SubmitSemaphoresWaitBuilder<'a>),
38     CommandBuffer(SubmitCommandBufferBuilder<'a>),
39     QueuePresent(SubmitPresentBuilder<'a>),
40     BindSparse(SubmitBindSparseBuilder<'a>),
41 }
42 
43 impl<'a> SubmitAnyBuilder<'a> {
44     /// Returns true if equal to `SubmitAnyBuilder::Empty`.
45     #[inline]
is_empty(&self) -> bool46     pub fn is_empty(&self) -> bool {
47         match self {
48             &SubmitAnyBuilder::Empty => true,
49             _ => false,
50         }
51     }
52 }
53