[][src]Macro vulkayes_core::shader_block_struct

macro_rules! shader_block_struct {
    (
		$( #[$attribute: meta] )*
		$vv: vis struct $struct_name: ident {
			$(
				$ty: ident $name: ident;
			)+
		}
	) => { ... };
}

Creates a struct that is layout-compatible with glsl shader struct/block definition.

Usage:

shader_block_struct! {
	#[derive(PartialEq)]
	pub struct Foo {
		vec4 color;
		// glsl struct member definitions...
	}
}

Generates:

#[repr(C)]
#[derive(Debug, Copy, Clone, Default)]
#[repr(align(4))]
#[derive(PartialEq)]
pub struct Foo {
	pub color: [f32; 4]
}