-
Notifications
You must be signed in to change notification settings - Fork 909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metal just returns NULL when creating a large 3D texture #3153
Comments
let texture_descriptor = wgpu::TextureDescriptor {
size: wgpu::Extent3d {
width: 1024,
height: 2048,
depth_or_array_layers: 256,
},
// ...
};
let mut list: Vec<wgpu::Texture> = vec![];
for i in 0..300 {
println!("Create texture {}", i);
let a_texture = device.create_texture(&texture_descriptor);
list.push(a_texture);
} I tested it on Mac and iPhone using the above code. Changing size to 4096x4096x256, it will crash on M1 Mac when |
Looking at the metal docs, it sounds right.
|
Description
I'm creating an R32Uint texture of size 1024x2048x256, and this line just returns a NULL handle:
A smaller size works (e.g. 128 for the depth).
It's either a driver bug, or we are hitting another limit that we don't know about.
Repro steps
available upon demand :)
This happens in vange-rs
Expected vs observed behavior
We should return an error, or succeed.
Extra materials
Total number of requested texels is 512M.
The total byte size is 2Gb. This one is interesting.
Metal behaves as if it can't allocate more than 1Gb, hence reducing the Z dimension to 128 works (it brings the total size to 1GB). Metal has a limit for the max buffer size. Maybe it also applies to textures?
Platform
The text was updated successfully, but these errors were encountered: