aboutsummaryrefslogtreecommitdiff
path: root/stockton-render/src/draw/macros.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:22 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:22 +0100
commitd7d0f0277c437004ed476393542da39c84c5cf9f (patch)
tree65c369e00fc1416c74019fde4456b0bf90d3067c /stockton-render/src/draw/macros.rs
parent10b3d4ac59e826b31d2114999e31893390acfb9c (diff)
chore(render): update hal and fix some errors
Diffstat (limited to 'stockton-render/src/draw/macros.rs')
-rw-r--r--stockton-render/src/draw/macros.rs89
1 files changed, 0 insertions, 89 deletions
diff --git a/stockton-render/src/draw/macros.rs b/stockton-render/src/draw/macros.rs
deleted file mode 100644
index 8558b71..0000000
--- a/stockton-render/src/draw/macros.rs
+++ /dev/null
@@ -1,89 +0,0 @@
-//! Helper macros, mostly for the graphics pipeline definitions
-
-/// Macro for easily defining buffer attribute descriptions
-/// Usage:
-/// ```
-/// // 0 is the binding value
-/// let attributes: Vec<AttributeDesc> = pipeline_vb_attributes!(0,
-/// size_of::<f32>() * 3; Rgb32Sfloat
-/// size_of::<f32>() * 2; Rg32Sfloat,
-/// size_of::<u32>(); R32Sint
-/// );
-/// ```
-/// See the hal::pso::Format enum for possible types
-#[allow(clippy::vec_init_then_push)]
-macro_rules! pipeline_vb_attributes {
- // Special case for single item
- ( $binding:expr, $firstSize:expr; $firstType:ident ) => ({
- #![allow(clippy::vec_init_then_push)]
- vec![
- AttributeDesc {
- location: 0,
- binding: $binding,
- element: Element {
- format: Format::$firstType,
- offset: $firstSize as u32
- }
- }
- ]
- });
-
- // Start of recursion
- ( $binding:expr,
- $firstSize:expr; $firstType:ident,
- $( $size:expr; $type:ident ),*
- ) => ({
- use hal::pso::{AttributeDesc, Element};
-
- let mut vec = Vec::new();
-
- vec.push(AttributeDesc {
- location: 0,
- binding: $binding,
- element: Element {
- format: Format::$firstType,
- offset: 0
- }
- });
-
- pipeline_vb_attributes!(
- vec; $binding; 1; $firstSize,
- $($size; $type),*
- );
-
- vec
- });
-
- // Middle of recursion
- ( $vec:ident; $binding:expr; $location:expr; $prevSize:expr,
- $firstSize:expr; $firstType:ident,
- $($size:expr; $type:ident),* ) => ({
-
- $vec.push(AttributeDesc {
- location: $location,
- binding: $binding,
- element: Element {
- format: Format::$firstType,
- offset: $prevSize as u32
- }
- });
-
- pipeline_vb_attributes!(
- $vec; $binding; ($location + 1); ($prevSize + $firstSize),
- $($size; $type),*
- );
- });
-
- // End of recursion
- ( $vec:ident; $binding:expr; $location:expr; $prevSize:expr,
- $firstSize:expr; $firstType:ident ) => ({
- $vec.push(AttributeDesc {
- location: $location,
- binding: $binding,
- element: Element {
- format: Format::$firstType,
- offset: $prevSize as u32
- }
- });
- });
-}