vulkan_rust_sys/
clear_value.rs1use crate::structs::{ClearColorValue, ClearDepthStencilValue, ClearValue};
4
5impl ClearColorValue {
6 #[inline]
8 pub const fn from_float32(rgba: [f32; 4]) -> Self {
9 Self { float32: rgba }
10 }
11
12 #[inline]
14 pub const fn from_int32(rgba: [i32; 4]) -> Self {
15 Self { int32: rgba }
16 }
17
18 #[inline]
20 pub const fn from_uint32(rgba: [u32; 4]) -> Self {
21 Self { uint32: rgba }
22 }
23}
24
25impl ClearValue {
26 #[inline]
28 pub const fn color_f32(rgba: [f32; 4]) -> Self {
29 Self {
30 color: ClearColorValue::from_float32(rgba),
31 }
32 }
33
34 #[inline]
36 pub const fn color_i32(rgba: [i32; 4]) -> Self {
37 Self {
38 color: ClearColorValue::from_int32(rgba),
39 }
40 }
41
42 #[inline]
44 pub const fn color_u32(rgba: [u32; 4]) -> Self {
45 Self {
46 color: ClearColorValue::from_uint32(rgba),
47 }
48 }
49
50 #[inline]
52 pub const fn depth_stencil(depth: f32, stencil: u32) -> Self {
53 Self {
54 depth_stencil: ClearDepthStencilValue { depth, stencil },
55 }
56 }
57}