wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

Bad error message for trying to copy to Depth32Float format

Open Alphapage opened this issue 1 year ago • 3 comments

Hello,

I am getting this error when trying to run a texture_depth_2d: In Queue::write_texture Copying to textures with format Depth32Float and aspect All is forbidden I changed the TextureViewDescriptor Aspect to DepthOnly without success: it seems that create_texture_with_data only accepts All in queue.write_texture( crate::ImageCopyTexture { texture: &texture, mip_level: mip, origin: crate::Origin3d { x: 0, y: 0, z: layer, }, aspect: wgt::TextureAspect::All, }, &data[binary_offset..end_offset], crate::ImageDataLayout { offset: 0, bytes_per_row: Some(bytes_per_row), rows_per_image: Some(height_blocks), }, mip_physical, );

Is it a bug or is it impossible to create texture_depth_2d from create_texture_with_data ?

Platform OSX, version of wgpu 0.19.3,

Thank you in advance for your help.

Alphapage avatar Mar 29 '24 20:03 Alphapage

The error message is a bit poor, but it's indeed not possible to copy to a Depth32Float texture, see https://www.w3.org/TR/webgpu/#depth-formats

Keeping this open to track the not-so-great error

Wumpf avatar Mar 30 '24 10:03 Wumpf

What would be an ideal wording for the error message?

andristarr avatar Apr 15 '24 15:04 andristarr

given the bug description the and aspect part here was confusing. The error should bring this only up if aspects are relevant. Not sure if there's more to be done tbh

Wumpf avatar Apr 15 '24 16:04 Wumpf