InstanceBuilder

Struct InstanceBuilder 

Source
pub struct InstanceBuilder<'a> { /* private fields */ }
Expand description

Allows to easily create an erupt::InstanceLoader and friends.

Implementations§

Source§

impl<'a> InstanceBuilder<'a>

Source

pub fn new() -> Self

Create a new instance builder with opinionated defaults.

Source

pub fn with_loader_builder(loader_builder: InstanceLoaderBuilder<'a>) -> Self

Create a new instance builder with a custom erupt::InstanceLoaderBuilder and opinionated defaults.

Source

pub fn app_name(self, app_name: &str) -> Result<Self, NulError>

Application name to advertise.

Source

pub fn app_version(self, major: u32, minor: u32) -> Self

Application version to advertise.

Source

pub fn app_version_raw(self, app_version: u32) -> Self

Application version to advertise.

Source

pub fn engine_name(self, engine_name: &str) -> Result<Self, NulError>

Engine name to advertise.

Source

pub fn engine_version(self, major: u32, minor: u32) -> Self

Engine version to advertise.

Source

pub fn engine_version_raw(self, engine_version: u32) -> Self

Engine version to advertise.

Source

pub fn require_api_version(self, major: u32, minor: u32) -> Self

Instance API version to be used as minimum requirement.

Source

pub fn require_api_version_raw(self, api_version: u32) -> Self

Instance API version to be used as minimum requirement.

Source

pub fn request_api_version(self, major: u32, minor: u32) -> Self

Instance API version to request. If it is not supported, fall back to the highest supported version.

Source

pub fn request_api_version_raw(self, api_version: u32) -> Self

Instance API version to request. If it is not supported, fall back to the highest supported version.

Source

pub fn request_layer(self, layer: *const c_char) -> Self

Try to enable this layer, ignore if it’s not supported

Source

pub fn require_layer(self, layer: *const c_char) -> Self

Enable this layer, fail if it’s not supported.

Source

pub fn request_extension(self, extension: *const c_char) -> Self

Try to enable this extension, ignore if it is not supported.

Source

pub fn require_extension(self, extension: *const c_char) -> Self

Enable this extension, fail if it’s not supported.

Source

pub fn require_surface_extensions( self, window_handle: &impl HasRawWindowHandle, ) -> Option<Self>

Adds an requirement on all Vulkan extensions necessary to create a surface on window_handle. You can also manually add these extensions. Returns None if the corresponding Vulkan surface extensions couldn’t be found. This is only supported on feature surface.

Source

pub fn validation_layers(self, validation_layers: ValidationLayers) -> Self

Add Khronos validation layers.

Source

pub fn request_debug_messenger(self, debug_messenger: DebugMessenger) -> Self

Try to create a debug messenger with the config provided by debug_messenger.

Source

pub fn debug_message_severity( self, severity: DebugUtilsMessageSeverityFlagsEXT, ) -> Self

Filter for the severity of debug messages.

Source

pub fn debug_message_type(self, ty: DebugUtilsMessageTypeFlagsEXT) -> Self

Filter for the type of debug messages.

Source

pub fn enable_validation_feature( self, validation_feature: ValidationFeatureEnableEXT, ) -> Self

Enable an additional feature in the validation layers.

Source

pub fn disable_validation_feature( self, validation_feature: ValidationFeatureDisableEXT, ) -> Self

Disable an feature in the validation layers.

Source

pub fn allocation_callbacks(self, allocator: AllocationCallbacks) -> Self

Allocation callback to use for internal Vulkan calls in the builder.

Source

pub unsafe fn build<T>( self, entry: &'a CustomEntryLoader<T>, ) -> Result<(InstanceLoader, Option<DebugUtilsMessengerEXT>, InstanceMetadata), InstanceCreationError>

Returns the erupt::InstanceLoader, an debug messenger if it was requested and successfully created, and InstanceMetadata about what is actually enabled in the instance.

Trait Implementations§

Source§

impl<'a> Default for InstanceBuilder<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for InstanceBuilder<'a>

§

impl<'a> !RefUnwindSafe for InstanceBuilder<'a>

§

impl<'a> !Send for InstanceBuilder<'a>

§

impl<'a> !Sync for InstanceBuilder<'a>

§

impl<'a> Unpin for InstanceBuilder<'a>

§

impl<'a> !UnwindSafe for InstanceBuilder<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.