[][src]Struct geyser::Cryo

pub struct Cryo { /* fields omitted */ }

This is a struct that holds an Arc<Instance>, Arc<Device> and an Arc<Queue>. This serves the purpose of making it easier to create everything needed for your GPU calculations. Note that you should try to never call Cryo::new more than once!

Here we initialize vulkan and we create a CpuAccessibleBuffer containing 69 42s.

Example

use geyser::instance::Instance;
 
let inst = Instance::new();
 
let buf = inst.buffer_from_data(vec![42; 69]);

Methods

impl Cryo[src]

pub fn new() -> Cryo[src]

Initializes vulkan and creates a new Cryo. This funtion should only be called once.

It uses the first QueueFamily that supports graphics and the first Queue in that QueueFamily

pub fn instance(&self) -> Arc<Instance>[src]

Returns a clone on the Arc<Instance> in the cryo

pub fn device(&self) -> Arc<Device>[src]

Returns a clone on the Arc<Device> in the cryo

pub fn queue(&self) -> Arc<Queue>[src]

Returns a clone on the Arc<Queue> in the cryo

pub fn buffer_from_data<D: 'static>(
    &self,
    data: Vec<D>
) -> Result<Arc<CpuAccessibleBuffer<[D]>>, DeviceMemoryAllocError>
[src]

Creates a CpuAccessibleBuffer containing the data from the supplied Vec and returns a Result

Auto Trait Implementations

impl Send for Cryo

impl Sync for Cryo

impl Unpin for Cryo

impl UnwindSafe for Cryo

impl RefUnwindSafe for Cryo

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Content for T[src]