Rename StdFramebuffer to Framebuffer

This commit is contained in:
Pierre Krieger 2016-11-22 19:07:53 +01:00
parent baabaa7479
commit dbce54f272
4 changed files with 17 additions and 17 deletions

View File

@ -23,7 +23,7 @@ use command_buffer::RawCommandBufferPrototype;
use device::Device;
use framebuffer::EmptySinglePassRenderPass;
use framebuffer::RenderPassRef;
use framebuffer::StdFramebuffer;
use framebuffer::Framebuffer;
use framebuffer::Subpass;
use framebuffer::traits::FramebufferRef;
use image::Layout;
@ -58,14 +58,14 @@ pub enum Kind<'a, R, F: 'a> {
},
}
impl<'a> Kind<'a, EmptySinglePassRenderPass, StdFramebuffer<EmptySinglePassRenderPass, ()>> {
impl<'a> Kind<'a, EmptySinglePassRenderPass, Framebuffer<EmptySinglePassRenderPass, ()>> {
/// Equivalent to `Kind::Primary`.
///
/// > **Note**: If you use `let kind = Kind::Primary;` in your code, you will probably get a
/// > compilation error because the Rust compiler couldn't determine the template parameters
/// > of `Kind`. To solve that problem in an easy way you can use this function instead.
#[inline]
pub fn primary() -> Kind<'a, EmptySinglePassRenderPass, StdFramebuffer<EmptySinglePassRenderPass, ()>> {
pub fn primary() -> Kind<'a, EmptySinglePassRenderPass, Framebuffer<EmptySinglePassRenderPass, ()>> {
Kind::Primary
}
}

View File

@ -515,7 +515,7 @@ mod tests {
use device::Queue;
use framebuffer::framebuffer::EmptyAttachmentsList;
use framebuffer::EmptySinglePassRenderPass;
use framebuffer::StdFramebuffer;
use framebuffer::Framebuffer;
use sync::Fence;
use sync::PipelineStages;
use sync::Semaphore;
@ -540,7 +540,7 @@ mod tests {
let (device, queue) = gfx_dev_and_queue!();
let pool = Device::standard_command_pool(&device, queue.family());
let kind = Kind::Primary::<EmptySinglePassRenderPass, StdFramebuffer<EmptySinglePassRenderPass, EmptyAttachmentsList>>;
let kind = Kind::Primary::<EmptySinglePassRenderPass, Framebuffer<EmptySinglePassRenderPass, EmptyAttachmentsList>>;
let cb = UnsafeCommandBufferBuilder::new(pool, kind, Flags::OneTimeSubmit).unwrap();
let cb = Basic { inner: cb.build().unwrap() };

View File

@ -40,7 +40,7 @@ use vk;
/// A framebuffer can be used alongside with any other render pass object as long as it is
/// compatible with the render pass that his framebuffer was created with. You can determine
/// whether two renderpass objects are compatible by calling `is_compatible_with`.
pub struct StdFramebuffer<Rp, A> {
pub struct Framebuffer<Rp, A> {
device: Arc<Device>,
render_pass: Rp,
framebuffer: vk::Framebuffer,
@ -48,12 +48,12 @@ pub struct StdFramebuffer<Rp, A> {
resources: A,
}
impl<Rp, A> StdFramebuffer<Rp, A> {
impl<Rp, A> Framebuffer<Rp, A> {
/// Builds a new framebuffer.
///
/// The `attachments` parameter depends on which `RenderPassRef` implementation is used.
pub fn new<Ia>(render_pass: Rp, dimensions: [u32; 3],
attachments: Ia) -> Result<Arc<StdFramebuffer<Rp, A>>, FramebufferCreationError>
attachments: Ia) -> Result<Arc<Framebuffer<Rp, A>>, FramebufferCreationError>
where Rp: RenderPassRef + RenderPassAttachmentsList<Ia>,
Ia: IntoAttachmentsList<List = A>,
A: AttachmentsList
@ -122,7 +122,7 @@ impl<Rp, A> StdFramebuffer<Rp, A> {
output
};
Ok(Arc::new(StdFramebuffer {
Ok(Arc::new(Framebuffer {
device: device,
render_pass: render_pass,
framebuffer: framebuffer,
@ -177,7 +177,7 @@ impl<Rp, A> StdFramebuffer<Rp, A> {
}
}
unsafe impl<Rp, A> FramebufferRef for StdFramebuffer<Rp, A>
unsafe impl<Rp, A> FramebufferRef for Framebuffer<Rp, A>
where Rp: RenderPassRef, A: AttachmentsList
{
type RenderPassRef = Rp;
@ -198,7 +198,7 @@ unsafe impl<Rp, A> FramebufferRef for StdFramebuffer<Rp, A>
}
}
unsafe impl<Rp, A> VulkanObject for StdFramebuffer<Rp, A> {
unsafe impl<Rp, A> VulkanObject for Framebuffer<Rp, A> {
type Object = vk::Framebuffer;
#[inline]
@ -207,7 +207,7 @@ unsafe impl<Rp, A> VulkanObject for StdFramebuffer<Rp, A> {
}
}
impl<Rp, A> Drop for StdFramebuffer<Rp, A> {
impl<Rp, A> Drop for Framebuffer<Rp, A> {
#[inline]
fn drop(&mut self) {
unsafe {
@ -448,7 +448,7 @@ impl From<Error> for FramebufferCreationError {
#[cfg(test)]
mod tests {
use format::R8G8B8A8Unorm;
use framebuffer::StdFramebuffer;
use framebuffer::Framebuffer;
use framebuffer::FramebufferCreationError;
use image::attachment::AttachmentImage;
@ -480,7 +480,7 @@ mod tests {
let image = AttachmentImage::new(&device, [1024, 768], R8G8B8A8Unorm).unwrap();
let _ = StdFramebuffer::new(&render_pass, [1024, 768, 1], example::AList {
let _ = Framebuffer::new(&render_pass, [1024, 768, 1], example::AList {
color: image.clone()
}).unwrap();
}
@ -496,7 +496,7 @@ mod tests {
let image = AttachmentImage::new(&device, [1024, 768], R8G8B8A8Unorm).unwrap();
let alist = example::AList { color: image.clone() };
match StdFramebuffer::new(&render_pass, [0xffffffff, 0xffffffff, 0xffffffff], alist) {
match Framebuffer::new(&render_pass, [0xffffffff, 0xffffffff, 0xffffffff], alist) {
Err(FramebufferCreationError::DimensionsTooLarge) => (),
_ => panic!()
}
@ -513,7 +513,7 @@ mod tests {
let image = AttachmentImage::new(&device, [512, 512], R8G8B8A8Unorm).unwrap();
let alist = example::AList { color: image.clone() };
match StdFramebuffer::new(&render_pass, [600, 600, 1], alist) {
match Framebuffer::new(&render_pass, [600, 600, 1], alist) {
Err(FramebufferCreationError::AttachmentTooSmall) => (),
_ => panic!()
}

View File

@ -67,7 +67,7 @@
//!
pub use self::empty::EmptySinglePassRenderPass;
pub use self::framebuffer::StdFramebuffer;
pub use self::framebuffer::Framebuffer;
pub use self::framebuffer::FramebufferCreationError;
pub use self::sys::RenderPass;
pub use self::sys::RenderPassSys;