pub struct InstanceBuilder<'a> { /* private fields */ }Expand description
Allows to easily create an erupt::InstanceLoader and friends.
Implementations§
Source§impl<'a> InstanceBuilder<'a>
impl<'a> InstanceBuilder<'a>
Sourcepub fn with_loader_builder(loader_builder: InstanceLoaderBuilder<'a>) -> Self
pub fn with_loader_builder(loader_builder: InstanceLoaderBuilder<'a>) -> Self
Create a new instance builder with a custom
erupt::InstanceLoaderBuilder and opinionated defaults.
Sourcepub fn app_version(self, major: u32, minor: u32) -> Self
pub fn app_version(self, major: u32, minor: u32) -> Self
Application version to advertise.
Sourcepub fn app_version_raw(self, app_version: u32) -> Self
pub fn app_version_raw(self, app_version: u32) -> Self
Application version to advertise.
Sourcepub fn engine_name(self, engine_name: &str) -> Result<Self, NulError>
pub fn engine_name(self, engine_name: &str) -> Result<Self, NulError>
Engine name to advertise.
Sourcepub fn engine_version(self, major: u32, minor: u32) -> Self
pub fn engine_version(self, major: u32, minor: u32) -> Self
Engine version to advertise.
Sourcepub fn engine_version_raw(self, engine_version: u32) -> Self
pub fn engine_version_raw(self, engine_version: u32) -> Self
Engine version to advertise.
Sourcepub fn require_api_version(self, major: u32, minor: u32) -> Self
pub fn require_api_version(self, major: u32, minor: u32) -> Self
Instance API version to be used as minimum requirement.
Sourcepub fn require_api_version_raw(self, api_version: u32) -> Self
pub fn require_api_version_raw(self, api_version: u32) -> Self
Instance API version to be used as minimum requirement.
Sourcepub fn request_api_version(self, major: u32, minor: u32) -> Self
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.
Sourcepub fn request_api_version_raw(self, api_version: u32) -> Self
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.
Sourcepub fn request_layer(self, layer: *const c_char) -> Self
pub fn request_layer(self, layer: *const c_char) -> Self
Try to enable this layer, ignore if it’s not supported
Sourcepub fn require_layer(self, layer: *const c_char) -> Self
pub fn require_layer(self, layer: *const c_char) -> Self
Enable this layer, fail if it’s not supported.
Sourcepub fn request_extension(self, extension: *const c_char) -> Self
pub fn request_extension(self, extension: *const c_char) -> Self
Try to enable this extension, ignore if it is not supported.
Sourcepub fn require_extension(self, extension: *const c_char) -> Self
pub fn require_extension(self, extension: *const c_char) -> Self
Enable this extension, fail if it’s not supported.
Sourcepub fn require_surface_extensions(
self,
window_handle: &impl HasRawWindowHandle,
) -> Option<Self>
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.
Sourcepub fn validation_layers(self, validation_layers: ValidationLayers) -> Self
pub fn validation_layers(self, validation_layers: ValidationLayers) -> Self
Add Khronos validation layers.
Sourcepub fn request_debug_messenger(self, debug_messenger: DebugMessenger) -> Self
pub fn request_debug_messenger(self, debug_messenger: DebugMessenger) -> Self
Try to create a debug messenger with the config provided by
debug_messenger.
Sourcepub fn debug_message_severity(
self,
severity: DebugUtilsMessageSeverityFlagsEXT,
) -> Self
pub fn debug_message_severity( self, severity: DebugUtilsMessageSeverityFlagsEXT, ) -> Self
Filter for the severity of debug messages.
Sourcepub fn debug_message_type(self, ty: DebugUtilsMessageTypeFlagsEXT) -> Self
pub fn debug_message_type(self, ty: DebugUtilsMessageTypeFlagsEXT) -> Self
Filter for the type of debug messages.
Sourcepub fn enable_validation_feature(
self,
validation_feature: ValidationFeatureEnableEXT,
) -> Self
pub fn enable_validation_feature( self, validation_feature: ValidationFeatureEnableEXT, ) -> Self
Enable an additional feature in the validation layers.
Sourcepub fn disable_validation_feature(
self,
validation_feature: ValidationFeatureDisableEXT,
) -> Self
pub fn disable_validation_feature( self, validation_feature: ValidationFeatureDisableEXT, ) -> Self
Disable an feature in the validation layers.
Sourcepub fn allocation_callbacks(self, allocator: AllocationCallbacks) -> Self
pub fn allocation_callbacks(self, allocator: AllocationCallbacks) -> Self
Allocation callback to use for internal Vulkan calls in the builder.
Sourcepub unsafe fn build<T>(
self,
entry: &'a CustomEntryLoader<T>,
) -> Result<(InstanceLoader, Option<DebugUtilsMessengerEXT>, InstanceMetadata), InstanceCreationError>
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.