Rename RenderPassRef to RenderPassAbstract

This commit is contained in:
Pierre Krieger 2017-02-03 13:10:01 +01:00
parent 1bdea56f1e
commit 0e275d5e37
8 changed files with 21 additions and 26 deletions

View File

@ -24,7 +24,7 @@ use framebuffer::EmptySinglePassRenderPassDesc;
use framebuffer::Framebuffer;
use framebuffer::FramebufferRef;
use framebuffer::RenderPass;
use framebuffer::RenderPassRef;
use framebuffer::RenderPassAbstract;
use framebuffer::Subpass;
use OomError;
use VulkanObject;
@ -114,7 +114,7 @@ impl<P> UnsafeCommandBufferBuilder<P> where P: CommandPool {
/// > be able to submit invalid commands.
pub unsafe fn new<R, F>(pool: P, kind: Kind<R, F>, flags: Flags)
-> Result<UnsafeCommandBufferBuilder<P>, OomError>
where R: RenderPassRef, F: FramebufferRef
where R: RenderPassAbstract, F: FramebufferRef
{
let secondary = match kind {
Kind::Primary => false,
@ -145,7 +145,7 @@ impl<P> UnsafeCommandBufferBuilder<P> where P: CommandPool {
pub unsafe fn already_allocated<R, F>(pool: P, cmd: AllocatedCommandBuffer,
kind: Kind<R, F>, flags: Flags)
-> Result<UnsafeCommandBufferBuilder<P>, OomError>
where R: RenderPassRef, F: FramebufferRef
where R: RenderPassAbstract, F: FramebufferRef
{
let device = pool.device().clone();
let vk = device.pointers();

View File

@ -22,7 +22,7 @@ use framebuffer::FramebufferRef;
use framebuffer::FramebufferRenderPass;
use framebuffer::RenderPass;
use framebuffer::RenderPassClearValues;
use framebuffer::RenderPassRef;
use framebuffer::RenderPassAbstract;
use VulkanObject;
use VulkanPointers;
use vk;
@ -54,7 +54,7 @@ impl<F> CmdBeginRenderPass<Arc<RenderPass>, F>
// TODO: allow setting more parameters
pub fn new<C>(framebuffer: F, secondary: bool, clear_values: C)
-> CmdBeginRenderPass<Arc<RenderPass>, F>
where <F as FramebufferRenderPass>::RenderPass: RenderPassRef + RenderPassClearValues<C>
where <F as FramebufferRenderPass>::RenderPass: RenderPassAbstract + RenderPassClearValues<C>
{
let raw_render_pass = framebuffer.render_pass().inner().internal_object();
let device = framebuffer.render_pass().device().clone();

View File

@ -20,7 +20,7 @@ use framebuffer::FramebufferRef;
use framebuffer::FramebufferRenderPass;
use framebuffer::RenderPass;
use framebuffer::RenderPassClearValues;
use framebuffer::RenderPassRef;
use framebuffer::RenderPassAbstract;
use pipeline::GraphicsPipeline;
use pipeline::vertex::Source;
@ -59,7 +59,7 @@ pub unsafe trait CommandBufferBuilder {
-> O
where Self: Sized + AddCommand<cmd::CmdBeginRenderPass<Arc<RenderPass>, F>, Out = O>,
F: FramebufferRef + FramebufferRenderPass,
<F as FramebufferRenderPass>::RenderPass: RenderPassRef + RenderPassClearValues<C>
<F as FramebufferRenderPass>::RenderPass: RenderPassAbstract + RenderPassClearValues<C>
{
let cmd = cmd::CmdBeginRenderPass::new(framebuffer, secondary, clear_values);
self.add(cmd)

View File

@ -20,7 +20,7 @@ use framebuffer::AttachmentsList;
use framebuffer::FramebufferRef;
use framebuffer::FramebufferRenderPass;
use framebuffer::RenderPass;
use framebuffer::RenderPassRef;
use framebuffer::RenderPassAbstract;
use framebuffer::RenderPassDescAttachmentsList;
use Error;
@ -55,7 +55,7 @@ impl<Rp, A> Framebuffer<Rp, A> {
/// The `attachments` parameter depends on which render pass implementation is used.
pub fn new<Ia>(render_pass: Rp, dimensions: [u32; 3], attachments: Ia)
-> Result<Arc<Framebuffer<Rp, A>>, FramebufferCreationError>
where Rp: RenderPassRef + RenderPassDescAttachmentsList<Ia, List = A>,
where Rp: RenderPassAbstract + RenderPassDescAttachmentsList<Ia, List = A>,
A: AttachmentsList,
{
let device = render_pass.device().clone();
@ -121,7 +121,7 @@ impl<Rp, A> Framebuffer<Rp, A> {
/// Returns true if this framebuffer can be used with the specified renderpass.
#[inline]
pub fn is_compatible_with<R>(&self, render_pass: &R) -> bool
where R: RenderPassRef, Rp: RenderPassRef
where R: RenderPassAbstract, Rp: RenderPassAbstract
{
unimplemented!()
// FIXME:

View File

@ -31,7 +31,7 @@
//!
//! # Render passes
//!
//! In vulkano, a render pass is represented by the `RenderPass` struct. The `RenderPassRef` trait
//! In vulkano, a render pass is represented by the `RenderPass` struct. The `RenderPassAbstract` trait
//! also exists and is implemented on objects that hold a render pass (eg. `Arc<RenderPass<...>>`).
//!
//! The `RenderPass` struct has a template parameter that contains the description of the render
@ -117,7 +117,7 @@ pub use self::traits::RenderPassClearValues;
pub use self::traits::RenderPassCompatible;
pub use self::traits::RenderPassDesc;
pub use self::traits::RenderPassDescAttachmentsList;
pub use self::traits::RenderPassRef;
pub use self::traits::RenderPassAbstract;
pub use self::traits::RenderPassSubpassInterface;
pub use self::traits::LayoutAttachmentDescription;
pub use self::traits::LayoutPassDescription;

View File

@ -28,7 +28,7 @@ use framebuffer::LoadOp;
use framebuffer::RenderPassClearValues;
use framebuffer::RenderPassDescAttachmentsList;
use framebuffer::RenderPassDesc;
use framebuffer::RenderPassRef;
use framebuffer::RenderPassAbstract;
use Error;
use OomError;
@ -384,7 +384,7 @@ unsafe impl<C, D> RenderPassClearValues<C> for RenderPass<D>
}
}
unsafe impl<D> RenderPassRef for RenderPass<D> where D: RenderPassDesc {
unsafe impl<D> RenderPassAbstract for RenderPass<D> where D: RenderPassDesc {
#[inline]
fn inner(&self) -> RenderPassSys {
RenderPassSys(self.renderpass, PhantomData)

View File

@ -111,22 +111,17 @@ unsafe impl<T> FramebufferRenderPassAbstract for T
}
}
/// Master trait for render pass objects. All render pass structs should always implement
/// this trait.
pub unsafe trait RenderPassAbstract: RenderPassRef + RenderPassDesc {} // TODO: other traits
unsafe impl<T> RenderPassAbstract for T where T: RenderPassRef + RenderPassDesc {}
/// Trait for objects that contain a Vulkan render pass object.
///
/// # Safety
///
/// - `inner()` and `device()` must return the same values every time.
pub unsafe trait RenderPassRef: DeviceOwned {
pub unsafe trait RenderPassAbstract: DeviceOwned + RenderPassDesc {
/// Returns an opaque object representing the render pass' internals.
fn inner(&self) -> RenderPassSys;
}
unsafe impl<T> RenderPassRef for T where T: SafeDeref, T::Target: RenderPassRef {
unsafe impl<T> RenderPassAbstract for T where T: SafeDeref, T::Target: RenderPassAbstract {
#[inline]
fn inner(&self) -> RenderPassSys {
(**self).inner()
@ -740,7 +735,7 @@ pub enum LoadOp {
DontCare = vk::ATTACHMENT_LOAD_OP_DONT_CARE,
}
/// Represents a subpass within a `RenderPassRef` object.
/// Represents a subpass within a `RenderPassAbstract` object.
///
/// This struct doesn't correspond to anything in Vulkan. It is simply an equivalent to a
/// tuple of a render pass and subpass index. Contrary to a tuple, however, the existence of the

View File

@ -29,7 +29,7 @@ use descriptor::pipeline_layout::PipelineLayoutSuperset;
use descriptor::pipeline_layout::PipelineLayoutSys;
use descriptor::pipeline_layout::EmptyPipelineDesc;
use framebuffer::RenderPassDesc;
use framebuffer::RenderPassRef;
use framebuffer::RenderPassAbstract;
use framebuffer::RenderPassSubpassInterface;
use framebuffer::Subpass;
use Error;
@ -160,7 +160,7 @@ struct Inner {
}
impl<Vdef, Rp> GraphicsPipeline<Vdef, (), Rp>
where Rp: RenderPassRef
where Rp: RenderPassAbstract
{
/// Builds a new graphics pipeline object.
///
@ -272,7 +272,7 @@ impl<Vdef, Rp> GraphicsPipeline<Vdef, (), Rp>
Teo: ShaderInterfaceDef,
Fi: ShaderInterfaceDefMatch<Teo> + ShaderInterfaceDefMatch<Vo>,
Fo: ShaderInterfaceDef,
Rp: RenderPassRef + RenderPassSubpassInterface<Fo>,
Rp: RenderPassAbstract + RenderPassSubpassInterface<Fo>,
{
if let Some(ref tess) = params.tessellation {
if let Err(err) = tess.tessellation_control_shader.input().matches(params.vertex_shader.output()) {
@ -318,7 +318,7 @@ impl<Vdef, L, Rp> GraphicsPipeline<Vdef, L, Rp>
Gl: PipelineLayoutDescNames,
Tcl: PipelineLayoutDescNames,
Tel: PipelineLayoutDescNames,
Rp: RenderPassRef + RenderPassDesc + RenderPassSubpassInterface<Fo>,
Rp: RenderPassAbstract + RenderPassDesc + RenderPassSubpassInterface<Fo>,
{
let vk = device.pointers();