[][src]Crate nobs_vulkanism

vulkan for rendering to a window

This library is an extension to nobs-vulkanism-headless that adds the module wnd

  • wnd - Handles window and swapchain creation

Inludes the symbols from nobs-vulkanism-headless into che crate's root namespace and defines the wnd module.

Example

extern crate nobs_vulkanism as vk;

fn main() {
  // nobs-vk Symbols remain in vk::*
  let 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", 0)
    .create(lib)
    .unwrap();

  let (pdevice, device) = vk::device::PhysicalDevice::enumerate_all(inst.handle)
    .remove(0)
    .into_device()
    .add_queue(vk::device::QueueProperties {
      present: false,
      graphics: true,
      compute: true,
      transfer: true,
    })
    .create()
    .unwrap();

  // Symbols of dependent moduls are put in their own namespace within vk::
  // e.g.:
  let mut allocator = vk::mem::Allocator::new(pdevice.handle, device.handle);
  //...
}

Re-exports

pub extern crate winit;

Modules

cmd

Handle vulkan commands, command pools, command buffers and batched submitting and syncronisation

device

Covenience device and physical device creation.

fb

Manages vulkan framebuffers and renderpasses

instance

Covenience instance creation.

mem

See nobs_vkmem

pipes

See nobs_vkpipes

wnd

Manage vulkan windows and swapchains

Macros

make_version

Create a version number from a major, minor and patch as it is defined in vulkan version numbers and semantics

version_major

Extract major number from version, created with make_version or retrieved from vulkan

version_minor

Extract minor number from version, created with make_version or retrieved from vulkan

version_patch

Extract patch number from version, created with make_version or retrieved from vulkan

vk_check

Wraps a call to a vulkan command and converts it's returned error code with make_result.

vk_uncheck

Same as vk_check but instead of returning the Result calls unwrap on it.

Structs

VkLib

Vulkan library initialization struct

Enums

Error

Enum type for all unsuccessful return codes in nobs_vk::Result

Success

Enum type for all successful return codes in nobs_vk::Result

Constants

VERSION_1_0
VERSION_1_1

Functions

make_result

Converts the integer error code from a vulkan command into a Result<Success, Error>