generator: Use lifetime borrows instead of raw pointers in pp_geometries (#420)

Fixes #301
This commit is contained in:
Marijn Suijten 2021-04-25 09:58:12 +02:00 committed by GitHub
parent 46ed5158ab
commit 6a522c878a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -41669,10 +41669,10 @@ impl<'a> AccelerationStructureBuildGeometryInfoKHRBuilder<'a> {
} }
pub fn geometries_ptrs( pub fn geometries_ptrs(
mut self, mut self,
geometries: &'a [*const AccelerationStructureGeometryKHR], geometries: &'a [&'a AccelerationStructureGeometryKHR],
) -> Self { ) -> Self {
self.inner.geometry_count = geometries.len() as _; self.inner.geometry_count = geometries.len() as _;
self.inner.pp_geometries = geometries.as_ptr(); self.inner.pp_geometries = geometries.as_ptr() as *const *const _;
self self
} }
pub fn scratch_data(mut self, scratch_data: DeviceOrHostAddressKHR) -> Self { pub fn scratch_data(mut self, scratch_data: DeviceOrHostAddressKHR) -> Self {

View file

@ -1797,9 +1797,9 @@ pub fn derive_setters(
if name == "ppGeometries" { if name == "ppGeometries" {
return Some(quote!{ return Some(quote!{
pub fn geometries_ptrs(mut self, geometries: &'a [*const AccelerationStructureGeometryKHR]) -> Self { pub fn geometries_ptrs(mut self, geometries: &'a [&'a AccelerationStructureGeometryKHR]) -> Self {
self.inner.geometry_count = geometries.len() as _; self.inner.geometry_count = geometries.len() as _;
self.inner.pp_geometries = geometries.as_ptr(); self.inner.pp_geometries = geometries.as_ptr() as *const *const _;
self self
} }
}); });