Add a Safety section to the documentation of create_instance and create_device (#272)
* Add a Safety section to the documentation of `create_instance` and `create_device` * Change doc links back to original format
This commit is contained in:
parent
98def0a4e3
commit
39a6a8552a
|
@ -77,6 +77,10 @@ pub trait EntryV1_0 {
|
|||
type Instance;
|
||||
fn fp_v1_0(&self) -> &vk::EntryFnV1_0;
|
||||
fn static_fn(&self) -> &vk::StaticFn;
|
||||
/// # Safety
|
||||
/// In order for the created `Instance` to be valid for the duration of its
|
||||
/// usage, the `Entry` this was called on must be dropped later than the
|
||||
/// resulting `Instance`.
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateInstance.html>"]
|
||||
unsafe fn create_instance(
|
||||
&self,
|
||||
|
@ -138,6 +142,10 @@ pub trait EntryV1_0 {
|
|||
|
||||
impl<L> EntryV1_0 for EntryCustom<L> {
|
||||
type Instance = Instance;
|
||||
/// # Safety
|
||||
/// In order for the created `Instance` to be valid for the duration of its
|
||||
/// usage, the `Entry` this was called on must be dropped later than the
|
||||
/// resulting `Instance`.
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateInstance.html>"]
|
||||
unsafe fn create_instance(
|
||||
&self,
|
||||
|
|
|
@ -38,6 +38,10 @@ impl Instance {
|
|||
|
||||
impl InstanceV1_0 for Instance {
|
||||
type Device = Device;
|
||||
/// # Safety
|
||||
/// In order for the created `Device` to be valid for the duration of its
|
||||
/// usage, the `Instance` this was called on must be dropped later than the
|
||||
/// resulting `Device`.
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDevice.html>"]
|
||||
unsafe fn create_device(
|
||||
&self,
|
||||
|
@ -288,6 +292,10 @@ pub trait InstanceV1_0 {
|
|||
type Device;
|
||||
fn handle(&self) -> vk::Instance;
|
||||
fn fp_v1_0(&self) -> &vk::InstanceFnV1_0;
|
||||
/// # Safety
|
||||
/// In order for the created `Device` to be valid for the duration of its
|
||||
/// usage, the `Instance` this was called on must be dropped later than the
|
||||
/// resulting `Device`.
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDevice.html>"]
|
||||
unsafe fn create_device(
|
||||
&self,
|
||||
|
|
Loading…
Reference in a new issue