Skip to content

Commit

Permalink
fix: ColorWrites bitflags serde
Browse files Browse the repository at this point in the history
  • Loading branch information
turbocrime committed Dec 31, 2024
1 parent 4a01180 commit e8164d1
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4666,16 +4666,18 @@ fn texture_format_deserialize() {
);
}

/// Color write mask. Disabled color channels will not be written to.
///
/// Corresponds to [WebGPU `GPUColorWriteFlags`](
/// https://gpuweb.github.io/gpuweb/#typedefdef-gpucolorwriteflags).
#[repr(transparent)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(transparent))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct ColorWrites(u32);

bitflags::bitflags! {
/// Color write mask. Disabled color channels will not be written to.
///
/// Corresponds to [WebGPU `GPUColorWriteFlags`](
/// https://gpuweb.github.io/gpuweb/#typedefdef-gpucolorwriteflags).
#[repr(transparent)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(transparent))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct ColorWrites: u32 {
impl ColorWrites: u32 {
/// Enable red channel writes
const RED = 1 << 0;
/// Enable green channel writes
Expand Down

0 comments on commit e8164d1

Please sign in to comment.