diff --git a/vulkano/src/command_buffer/cb/sys.rs b/vulkano/src/command_buffer/cb/sys.rs index dd8e2ec5..a5b05f52 100644 --- a/vulkano/src/command_buffer/cb/sys.rs +++ b/vulkano/src/command_buffer/cb/sys.rs @@ -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

UnsafeCommandBufferBuilder

where P: CommandPool { /// > be able to submit invalid commands. pub unsafe fn new(pool: P, kind: Kind, flags: Flags) -> Result, OomError> - where R: RenderPassRef, F: FramebufferRef + where R: RenderPassAbstract, F: FramebufferRef { let secondary = match kind { Kind::Primary => false, @@ -145,7 +145,7 @@ impl

UnsafeCommandBufferBuilder

where P: CommandPool { pub unsafe fn already_allocated(pool: P, cmd: AllocatedCommandBuffer, kind: Kind, flags: Flags) -> Result, OomError> - where R: RenderPassRef, F: FramebufferRef + where R: RenderPassAbstract, F: FramebufferRef { let device = pool.device().clone(); let vk = device.pointers(); diff --git a/vulkano/src/command_buffer/cmd/begin_render_pass.rs b/vulkano/src/command_buffer/cmd/begin_render_pass.rs index a1ddb687..46973c93 100644 --- a/vulkano/src/command_buffer/cmd/begin_render_pass.rs +++ b/vulkano/src/command_buffer/cmd/begin_render_pass.rs @@ -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 CmdBeginRenderPass, F> // TODO: allow setting more parameters pub fn new(framebuffer: F, secondary: bool, clear_values: C) -> CmdBeginRenderPass, F> - where ::RenderPass: RenderPassRef + RenderPassClearValues + where ::RenderPass: RenderPassAbstract + RenderPassClearValues { let raw_render_pass = framebuffer.render_pass().inner().internal_object(); let device = framebuffer.render_pass().device().clone(); diff --git a/vulkano/src/command_buffer/helper_trait.rs b/vulkano/src/command_buffer/helper_trait.rs index 19b495b8..dbd6e814 100644 --- a/vulkano/src/command_buffer/helper_trait.rs +++ b/vulkano/src/command_buffer/helper_trait.rs @@ -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, F>, Out = O>, F: FramebufferRef + FramebufferRenderPass, - ::RenderPass: RenderPassRef + RenderPassClearValues + ::RenderPass: RenderPassAbstract + RenderPassClearValues { let cmd = cmd::CmdBeginRenderPass::new(framebuffer, secondary, clear_values); self.add(cmd) diff --git a/vulkano/src/framebuffer/framebuffer.rs b/vulkano/src/framebuffer/framebuffer.rs index 90bf24a8..bb35c965 100644 --- a/vulkano/src/framebuffer/framebuffer.rs +++ b/vulkano/src/framebuffer/framebuffer.rs @@ -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 Framebuffer { /// The `attachments` parameter depends on which render pass implementation is used. pub fn new(render_pass: Rp, dimensions: [u32; 3], attachments: Ia) -> Result>, FramebufferCreationError> - where Rp: RenderPassRef + RenderPassDescAttachmentsList, + where Rp: RenderPassAbstract + RenderPassDescAttachmentsList, A: AttachmentsList, { let device = render_pass.device().clone(); @@ -121,7 +121,7 @@ impl Framebuffer { /// Returns true if this framebuffer can be used with the specified renderpass. #[inline] pub fn is_compatible_with(&self, render_pass: &R) -> bool - where R: RenderPassRef, Rp: RenderPassRef + where R: RenderPassAbstract, Rp: RenderPassAbstract { unimplemented!() // FIXME: diff --git a/vulkano/src/framebuffer/mod.rs b/vulkano/src/framebuffer/mod.rs index e1a4bbef..9ab37a11 100644 --- a/vulkano/src/framebuffer/mod.rs +++ b/vulkano/src/framebuffer/mod.rs @@ -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>`). //! //! 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; diff --git a/vulkano/src/framebuffer/sys.rs b/vulkano/src/framebuffer/sys.rs index f101f560..93868cfc 100644 --- a/vulkano/src/framebuffer/sys.rs +++ b/vulkano/src/framebuffer/sys.rs @@ -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 RenderPassClearValues for RenderPass } } -unsafe impl RenderPassRef for RenderPass where D: RenderPassDesc { +unsafe impl RenderPassAbstract for RenderPass where D: RenderPassDesc { #[inline] fn inner(&self) -> RenderPassSys { RenderPassSys(self.renderpass, PhantomData) diff --git a/vulkano/src/framebuffer/traits.rs b/vulkano/src/framebuffer/traits.rs index b93e1572..31162b54 100644 --- a/vulkano/src/framebuffer/traits.rs +++ b/vulkano/src/framebuffer/traits.rs @@ -111,22 +111,17 @@ unsafe impl 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 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 RenderPassRef for T where T: SafeDeref, T::Target: RenderPassRef { +unsafe impl 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 diff --git a/vulkano/src/pipeline/graphics_pipeline/mod.rs b/vulkano/src/pipeline/graphics_pipeline/mod.rs index cc8ca10c..779134db 100644 --- a/vulkano/src/pipeline/graphics_pipeline/mod.rs +++ b/vulkano/src/pipeline/graphics_pipeline/mod.rs @@ -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 GraphicsPipeline - where Rp: RenderPassRef + where Rp: RenderPassAbstract { /// Builds a new graphics pipeline object. /// @@ -272,7 +272,7 @@ impl GraphicsPipeline Teo: ShaderInterfaceDef, Fi: ShaderInterfaceDefMatch + ShaderInterfaceDefMatch, Fo: ShaderInterfaceDef, - Rp: RenderPassRef + RenderPassSubpassInterface, + Rp: RenderPassAbstract + RenderPassSubpassInterface, { 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 GraphicsPipeline Gl: PipelineLayoutDescNames, Tcl: PipelineLayoutDescNames, Tel: PipelineLayoutDescNames, - Rp: RenderPassRef + RenderPassDesc + RenderPassSubpassInterface, + Rp: RenderPassAbstract + RenderPassDesc + RenderPassSubpassInterface, { let vk = device.pointers();