[−][src]Struct nobs_vk::instance::Builder
Builder for an Instance
Configures validation layers, application, engine name and used extensions for the new instance.
Creating an Instance will take ownership of the specified VkLib object. However it is still necessary to create it before the Builder, so that we can look up supported layers and extensions, while configuring.
Example
#[macro_use] extern crate nobs_vk as vk; let vk_lib = vk::VkLib::new(); let inst = vk::instance::new() .validate(vk::DEBUG_REPORT_ERROR_BIT_EXT | vk::DEBUG_REPORT_WARNING_BIT_EXT) .application("awesome app", make_version!(1, 0, 0)) .engine("very fast with lots of PS", make_version!(1, 33, 7)) // add extensions like this //.add_extension(vk::KHR_SURFACE_EXTENSION_NAME) //.add_extension(vk::KHR_XLIB_SURFACE_EXTENSION_NAME) .create(vk_lib) .expect("instance creation failed");
Methods
impl Builder
[src]
pub fn validate(&mut self, flags: DebugReportFlagsEXT) -> &mut Self
[src]
Enables or disables validation layers.
Arguments
flags
- chooses between0
- validation disabled- other - automatically adds the
VK_LAYER_LUNARG_standard_validation
layer and configure the debug callback
pub fn application(&mut self, name: &str, version: u32) -> &mut Self
[src]
Set the application name and version
Arguments
name
- application nameversion
- application version, as created with make_version
pub fn engine(&mut self, name: &str, version: u32) -> &mut Self
[src]
Set the engine name and version
Arguments
name
- engine nameversion
- engine version, as created with make_version
pub fn get_supported_layers() -> Vec<String>
[src]
Retrieve a list of all supported layers on this system
Returns
The names of all supported layers in this vulkan instance.
The vk::EnumerateInstanceLayerProperties
command can fail, in this case an empty list is returned
pub fn is_layer_supported(name: &str) -> bool
[src]
Check if the specified name is a supported layer
pub fn add_layer(&mut self, name: &str) -> &mut Self
[src]
Adds a layer, if it is supported
pub fn add_layers(&mut self, names: &[&str]) -> &mut Self
[src]
Adds layers, if they are supported
pub fn get_supported_extensions(layer: Option<&str>) -> Vec<String>
[src]
Retrieve a list of all supported extensions on this system
Returns
The names of all supported extensions in this vulkan instance.
The vk::EnumerateInstanceExtensionProperties
command can fail, in this case an empty list is returned
pub fn is_extension_supported(layer: Option<&str>, name: &str) -> bool
[src]
Check if the specified name is a supported extension
pub fn add_extension(&mut self, name: &str) -> &mut Self
[src]
Adds an extension, if it is supported
pub fn add_extensions(&mut self, names: &[&str]) -> &mut Self
[src]
Adds extensions, if they are supported
pub fn create(&mut self, vklib: Box<VkLib>) -> Result<Instance, Error>
[src]
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,