Implement RenderPassDesc on Box<T: RenderPassDesc>

This commit is contained in:
Pierre Krieger 2016-11-25 16:14:20 +01:00
parent da169c73a0
commit 21a6f3e271

View File

@ -308,7 +308,39 @@ pub unsafe trait RenderPassDesc {
}
}
unsafe impl<T> RenderPassDesc for Arc<T> where T: RenderPassDesc {
unsafe impl<T: ?Sized> RenderPassDesc for Box<T> where T: RenderPassDesc {
#[inline]
fn num_attachments(&self) -> usize {
(**self).num_attachments()
}
#[inline]
fn attachment(&self, num: usize) -> Option<LayoutAttachmentDescription> {
(**self).attachment(num)
}
#[inline]
fn num_subpasses(&self) -> usize {
(**self).num_subpasses()
}
#[inline]
fn subpass(&self, num: usize) -> Option<LayoutPassDescription> {
(**self).subpass(num)
}
#[inline]
fn num_dependencies(&self) -> usize {
(**self).num_dependencies()
}
#[inline]
fn dependency(&self, num: usize) -> Option<LayoutPassDependencyDescription> {
(**self).dependency(num)
}
}
unsafe impl<T: ?Sized> RenderPassDesc for Arc<T> where T: RenderPassDesc {
#[inline]
fn num_attachments(&self) -> usize {
(**self).num_attachments()