gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.68k stars 928 forks source link

unit test failure clear_texture_2d_uncompressed #3309

Open tomcraven opened 1 year ago

tomcraven commented 1 year ago

Description Unit test clear_texture::clear_texture_2d_uncompressed failure for backend Gl and adapter name NVIDIA GeForce RTX 2080/PCIe/SSE2

Repro steps On my machine running this command on master reproduces the issue: WGPU_ADAPTER_NAME="NVIDIA GeForce RTX 2080/PCIe/SSE2" WGPU_BACKEND="Gl" cargo nextest run --no-fail-fast --no-capture -- clear_texture::clear_texture_2d_uncompressed

Expected vs observed behavior Unit test should pass but I see the validation canary is being set and failing the test with this in the output:

[2022-12-19T19:01:49Z ERROR wgpu_hal::gles::egl] GLES: [API/Error] ID 1282 : GL_INVALID_OPERATION error generated.

Extra materials I think I've narrowed the error down to Bgra8Unorm texture format and the call to tex_sub_image_3d here - https://github.com/gfx-rs/wgpu/blob/46831a8b25751d687ce049ccdaec52576bb991bc/wgpu-hal/src/gles/queue.rs#L495-L507

Looking at https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexSubImage3D.xhtml and the GL_INVALID_OPERATION descriptions I think I was able to rule out all but the GL_PIXEL_UNPACK_BUFFER causes but my openGl is a little rusty so don't take my word for it :)

Platform ubuntu 5.15.0-53-generic OpenGL version string: 4.6.0 NVIDIA 515.65.01 ASUS Dual GeForce RTX 2080 graphics card

cwfitzgerald commented 1 year ago

This seems to have been exposed by https://github.com/gfx-rs/wgpu/pull/3296 as well.