From 9542c2a097b8c616aaffdc1d58d69d1df4f79369 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 11 Apr 2016 15:54:13 +0200 Subject: [PATCH] Add small test for EmptyRenderPass --- vulkano/src/framebuffer/empty.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/vulkano/src/framebuffer/empty.rs b/vulkano/src/framebuffer/empty.rs index ca4609bf..330f5522 100644 --- a/vulkano/src/framebuffer/empty.rs +++ b/vulkano/src/framebuffer/empty.rs @@ -14,7 +14,6 @@ use std::sync::Arc; use device::Device; use format::ClearValue; -use framebuffer::framebuffer::FramebufferCreationError; use framebuffer::sys::UnsafeRenderPass; use framebuffer::traits::RenderPass; use framebuffer::traits::RenderPassDesc; @@ -65,7 +64,6 @@ unsafe impl RenderPass for EmptySinglePassRenderPass { } } - unsafe impl RenderPassDesc for EmptySinglePassRenderPass { type AttachmentsIter = EmptyIter; type PassesIter = OptionIntoIter; @@ -105,6 +103,11 @@ unsafe impl RenderPassDesc for EmptySinglePassRenderPass { None } } + + #[inline] + fn num_samples(&self, subpass: u32) -> Option { + None + } } unsafe impl RenderPassAttachmentsList<()> for EmptySinglePassRenderPass { @@ -124,3 +127,14 @@ unsafe impl RenderPassClearValues<()> for EmptySinglePassRenderPass { iter::empty() } } + +#[cfg(test)] +mod tests { + use framebuffer::EmptySinglePassRenderPass; + + #[test] + fn create() { + let (device, _) = gfx_dev_and_queue!(); + let _ = EmptySinglePassRenderPass::new(&device).unwrap(); + } +}