[][src]Crate nobs_vulkanism_headless

vulkan for offscreen rendering and compute

This library compiles the nobs-vk base crates into a single depencency and introduces two more moduls:

  • cmd - Handles command buffers and syrchronization
  • fm - Handles renderpass and framebuffer management

Rearranges module namespaces, so that we only have to use a single external crate nobs_vulkanism instruction instead of the all three depencencies (nobs-vk, nobs-vkmem, nobs-vkpipes). Inlines the nobs-vk Symbols into thes crates root namespace. for nobs-vkmem and nobs-vkpipes the modules mem and pipes are created respectively.

Example

extern crate nobs_vulkanism_headless 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);
  //...
}

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

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>