[wgpu.image] Workaround WGPU OpenGL heuristics
This commit is contained in:
parent
c76a9eb2ff
commit
4272090d36
1 changed files with 6 additions and 2 deletions
|
|
@ -24,10 +24,14 @@ pub struct Atlas {
|
||||||
|
|
||||||
impl Atlas {
|
impl Atlas {
|
||||||
pub fn new(device: &wgpu::Device) -> Self {
|
pub fn new(device: &wgpu::Device) -> Self {
|
||||||
|
// We start with 2 layers, to help wgpu figure out that this texture is `GL_TEXTURE_2D_ARRAY` rather
|
||||||
|
// than `GL_TEXTURE_2D`
|
||||||
|
// https://github.com/gfx-rs/wgpu/blob/004e3efe84a320d9331371ed31fa50baa2414911/wgpu-hal/src/gles/mod.rs#L371
|
||||||
|
let layers = vec![Layer::Empty, Layer::Empty];
|
||||||
let extent = wgpu::Extent3d {
|
let extent = wgpu::Extent3d {
|
||||||
width: SIZE,
|
width: SIZE,
|
||||||
height: SIZE,
|
height: SIZE,
|
||||||
depth_or_array_layers: 1,
|
depth_or_array_layers: layers.len() as u32,
|
||||||
};
|
};
|
||||||
|
|
||||||
let texture = device.create_texture(&wgpu::TextureDescriptor {
|
let texture = device.create_texture(&wgpu::TextureDescriptor {
|
||||||
|
|
@ -55,7 +59,7 @@ impl Atlas {
|
||||||
Atlas {
|
Atlas {
|
||||||
texture,
|
texture,
|
||||||
texture_view,
|
texture_view,
|
||||||
layers: vec![Layer::Empty],
|
layers,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue