Skip to content

Commit

Permalink
More texture formats
Browse files Browse the repository at this point in the history
  • Loading branch information
EriKWDev committed Dec 15, 2024
1 parent 450bb7d commit 3e381b7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions blade-graphics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ pub enum TextureFormat {
Bgra8UnormSrgb,
Rgba8Snorm,
R16Float,
Rg16Float,
Rgba16Float,
R32Float,
Rg32Float,
Expand All @@ -307,6 +308,15 @@ pub enum TextureFormat {
Bc4Snorm,
Bc5Unorm,
Bc5Snorm,
Bc6UFloat,
Bc6SFloat,
Bc7Unorm,
Bc7UnormSrgb,
// packed 32-bit
Rgb10a2Unorm,
Bgr10a2Unorm,
Rg11b10Float,
Rgb9e5Float,
}

#[derive(Clone, Copy, Debug)]
Expand Down
9 changes: 9 additions & 0 deletions blade-graphics/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ impl super::TextureFormat {
Self::Bgra8UnormSrgb => uncompressed(4),
Self::Rgba8Snorm => uncompressed(4),
Self::R16Float => uncompressed(2),
Self::Rg16Float => uncompressed(4),
Self::Rgba16Float => uncompressed(8),
Self::R32Float => uncompressed(4),
Self::Rg32Float => uncompressed(8),
Expand All @@ -83,6 +84,14 @@ impl super::TextureFormat {
Self::Bc4Snorm => cx_bc(8),
Self::Bc5Unorm => cx_bc(16),
Self::Bc5Snorm => cx_bc(16),
Self::Bc6UFloat => cx_bc(16),
Self::Bc6SFloat => cx_bc(16),
Self::Bc7Unorm => cx_bc(16),
Self::Bc7UnormSrgb => cx_bc(16),
Self::Rgb10a2Unorm => uncompressed(4),
Self::Bgr10a2Unorm => uncompressed(4),
Self::Rg11b10Float => uncompressed(4),
Self::Rgb9e5Float => uncompressed(4),
}
}

Expand Down

0 comments on commit 3e381b7

Please sign in to comment.