We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f54333e commit 4191f5cCopy full SHA for 4191f5c
sugarloaf/src/components/layer/atlas.rs
@@ -72,9 +72,22 @@ impl Atlas {
72
73
fn get_bytes_per_pixel(&self) -> u32 {
74
match self.texture.format() {
75
+ // 16-bit float formats (F16)
76
+ wgpu::TextureFormat::R16Float => 2,
77
+ wgpu::TextureFormat::Rg16Float => 4,
78
wgpu::TextureFormat::Rgba16Float => 8,
79
+ // 8-bit unorm formats
80
+ wgpu::TextureFormat::R8Unorm => 1,
81
+ wgpu::TextureFormat::Rg8Unorm => 2,
82
wgpu::TextureFormat::Rgba8Unorm => 4,
- _ => 4,
83
+ // Fallback for any unexpected format
84
+ _ => {
85
+ tracing::warn!(
86
+ "Unexpected texture format in atlas: {:?}, assuming 4 bytes per pixel",
87
+ self.texture.format()
88
+ );
89
+ 4
90
+ }
91
}
92
93
0 commit comments