[−][src]Struct geyser::Cryo
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]
pub fn device(&self) -> Arc<Device>
[src]
pub fn queue(&self) -> Arc<Queue>
[src]
pub fn buffer_from_data<D: 'static>(
&self,
data: Vec<D>
) -> Result<Arc<CpuAccessibleBuffer<[D]>>, DeviceMemoryAllocError>
[src]
&self,
data: Vec<D>
) -> Result<Arc<CpuAccessibleBuffer<[D]>>, DeviceMemoryAllocError>
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,