Vulkan GPU Programming with the ash rust crate

Vulkan GPU Programming with the ash rust crate

Kidan Nelson (lvl 1)
Rust Concepts

Preview this deck

Associated Types

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

1

All-time users

1

Favorites

0

Last updated

1 year ago

Date created

Sep 7, 2023

Cards (22)

Rust Concepts

(15 cards)

Associated Types

Front

A way to associate a type placeholder with a trait, making it more generic.

Ex: trait Iterator { type Item; fn next(&mut self) -> Option<Self::Item>; }

Back

async/await

Front

 Syntax for writing asynchronous code in Rust. Introduced in Rust 1.39. Async traits are not supported currently by default

Ex: async fn fetch_data() -> Result<Data, Error> { ... }

Back

Lifetimes

Front

Annotations to relate the lifetimes of multiple references.
Ex: fn longest<'a>(s1: &'a str, s2: &'a str) -> &'a str

Back

Fn, FnMut, and FnOnce Traits

Front

 Traits representing different types of function pointers and closures.

Ex: fn call_with_one<F>(func: F) where F: Fn(i32) -> i32 { func(1) }

Back

Attributes

Front

Metadata applied to modules, functions, or items. Can be used for conditional compilation, linting, etc.

Ex: #[derive(Debug)] struct MyStruct;

Back

PhantomData<T>

Front

 A zero-sized type used to mark certain generic types in structs without storing them.

Ex: struct Wrapper<T> { data: u32, phantom: PhantomData<T> }

Back

Rc<T> and Arc<T>
 

Front

Reference-counted types. Rc is for single-threaded scenarios, while Arc is atomic and can be used in multi-threaded contexts.

Ex: let rc = Rc::new(vec![1.0, 2.0, 3.0]);

Back

Concurrency

Front

Rust's approach to thread safety. Ensures data races can't happen by design.

Ex: let handle = thread::spawn(move || { ... });

Back

unsafe Keyword

Front

A keyword to denote operations that bypass Rust's safety checks. Used for FFI, raw pointers, and more.

Ex: unsafe { some_unsafe_function() };

Back

Pattern Matching

Front

Allows deconstructing values and checking their shapes.

Ex: match value { Some(x) => println!("{}", x), None => (), }

Back

Pin<T>

Front

A pointer type to ensure the data it points to will never be moved again. Essential for certain async operations.

Ex: let mut pinned = Box::pin(data);

Back

Box<T>

Front

A heap-allocated pointer. Useful for transferring ownership without copying the data.

Ex: let b = Box::new(5);

Back

Drop Trait

 

Front

Allows customization of what happens when a value goes out of scope.

Ex: impl Drop for MyType { fn drop(&mut self) { println!("Dropped!"); } }

Back

Generics

Front

Allows writing code that is abstracted over types.

Ex: struct Point<T> { x: T, y: T }

Back

Deref and DerefMut Traits

Front

Allows overloading of dereference operators. Enables custom pointer types to behave like references.

Ex: impl Deref for MyType { type Target = T; ... }

Back

Ash API Reference

(0 cards)

Winit API Reference

(7 cards)

Event (winit)

Front

 An enum in winit representing various events, including window events, device events, and user input events.

Back

KeyboardInput

Front

Represents a keyboard input event in winit. Contains information about the state of the key (pressed or released) and which key was affected.

Back

ControlFlow

Front

Determines how the winit event loop should proceed after processing events. Has variants like Poll (continuously run) and Wait (wait for events).

Back

ElementState

Front

Represents the state of a button or key in winit. Has two variants: Pressed and Released. Used to determine the current state of a keyboard key or mouse button.

Back

WindowEvent

Front

An enum in winit representing events specifically related to the window, such as resizing, moving, or closing.

Back

EventLoop

Front

 The main event loop provided by winit. Responsible for handling all events and driving the application forward.

Back

VirtualKeyCode

Front

An enum in winit representing all possible keys on a keyboard. Allows checking for specific keys, like VirtualKeyCode::A for the "A" key.

Back

Vulkan API

(0 cards)

GPU Programming Concepts

(0 cards)