Merge pull request #652 from tomaka/gp-subpass

Add GraphicsPipelineAbstract::subpass()
This commit is contained in:
tomaka 2017-07-18 14:22:09 +02:00 committed by GitHub
commit 42998a2b45

View File

@ -1584,9 +1584,19 @@ impl Drop for Inner {
/// Trait implemented on objects that reference a graphics pipeline. Can be made into a trait
/// object.
pub unsafe trait GraphicsPipelineAbstract: PipelineLayoutAbstract + RenderPassAbstract + VertexSource<Vec<Arc<BufferAccess + Send + Sync>>> {
/// Returns an opaque object that represents the inside of the graphics pipeline.
/// Returns an opaque object that represents the inside of the graphics pipeline.
fn inner(&self) -> GraphicsPipelineSys;
/// Returns the index of the subpass this graphics pipeline is rendering to.
fn subpass_index(&self) -> u32;
/// Returns the subpass this graphics pipeline is rendering to.
#[inline]
fn subpass(self) -> Subpass<Self> where Self: Sized {
let index = self.subpass_index();
Subpass::from(self, index).expect("Wrong subpass index in GraphicsPipelineAbstract::subpass")
}
/// Returns true if the line width used by this pipeline is dynamic.
fn has_dynamic_line_width(&self) -> bool;
@ -1622,6 +1632,11 @@ unsafe impl<Mv, L, Rp> GraphicsPipelineAbstract for GraphicsPipeline<Mv, L, Rp>
GraphicsPipelineSys(self.inner.pipeline, PhantomData)
}
#[inline]
fn subpass_index(&self) -> u32 {
self.render_pass_subpass
}
#[inline]
fn has_dynamic_line_width(&self) -> bool {
self.dynamic_line_width
@ -1672,6 +1687,11 @@ unsafe impl<T> GraphicsPipelineAbstract for T
GraphicsPipelineAbstract::inner(&**self)
}
#[inline]
fn subpass_index(&self) -> u32 {
(**self).subpass_index()
}
#[inline]
fn has_dynamic_line_width(&self) -> bool {
(**self).has_dynamic_line_width()