Update experimental AMD extension

This commit is contained in:
Maik Klein 2019-02-28 10:14:40 +01:00
parent 1e13b999d7
commit d6a6aa310e

View file

@ -208,8 +208,14 @@ pub struct PhysicalDeviceGpaPropertiesAmdBuilder<'a> {
inner: PhysicalDeviceGpaPropertiesAmd, inner: PhysicalDeviceGpaPropertiesAmd,
marker: ::std::marker::PhantomData<&'a ()>, marker: ::std::marker::PhantomData<&'a ()>,
} }
pub unsafe trait ExtendsPhysicalDeviceGpaPropertiesAmd {} pub unsafe trait ExtendsPhysicalDeviceGpaPropertiesAmd {
unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceGpaPropertiesAmd {} unsafe fn as_ptr_mut(&mut self) -> *mut BaseOutStructure;
}
unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceGpaPropertiesAmd {
unsafe fn as_ptr_mut(&mut self) -> *mut BaseOutStructure {
::std::mem::transmute(self)
}
}
impl<'a> ::std::ops::Deref for PhysicalDeviceGpaPropertiesAmdBuilder<'a> { impl<'a> ::std::ops::Deref for PhysicalDeviceGpaPropertiesAmdBuilder<'a> {
type Target = PhysicalDeviceGpaPropertiesAmd; type Target = PhysicalDeviceGpaPropertiesAmd;
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
@ -648,8 +654,14 @@ pub struct PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a> {
inner: PhysicalDeviceWaveLimitPropertiesAmd, inner: PhysicalDeviceWaveLimitPropertiesAmd,
marker: ::std::marker::PhantomData<&'a ()>, marker: ::std::marker::PhantomData<&'a ()>,
} }
pub unsafe trait ExtendsPhysicalDeviceWaveLimitPropertiesAmd {} pub unsafe trait ExtendsPhysicalDeviceWaveLimitPropertiesAmd {
unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceWaveLimitPropertiesAmd {} unsafe fn as_ptr_mut(&mut self) -> *mut BaseOutStructure;
}
unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceWaveLimitPropertiesAmd {
unsafe fn as_ptr_mut(&mut self) -> *mut BaseOutStructure {
::std::mem::transmute(self)
}
}
impl<'a> ::std::ops::Deref for PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a> { impl<'a> ::std::ops::Deref for PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a> {
type Target = PhysicalDeviceWaveLimitPropertiesAmd; type Target = PhysicalDeviceWaveLimitPropertiesAmd;
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
@ -657,11 +669,18 @@ impl<'a> ::std::ops::Deref for PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a> {
} }
} }
impl<'a> PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a> { impl<'a> PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a> {
pub fn next<T>(mut self, next: &'a mut T) -> PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a> pub fn push_next<T>(
mut self,
next: &'a mut T,
) -> PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a>
where where
T: ExtendsPhysicalDeviceWaveLimitPropertiesAmd, T: ExtendsPhysicalDeviceWaveLimitPropertiesAmd,
{ {
self.inner.p_next = next as *mut T as *mut c_void; unsafe {
let next_ptr = next.as_ptr_mut();
(*next_ptr).p_next = self.inner.p_next as _;
self.inner.p_next = next_ptr as _;
}
self self
} }
pub fn build(self) -> PhysicalDeviceWaveLimitPropertiesAmd { pub fn build(self) -> PhysicalDeviceWaveLimitPropertiesAmd {