Skip to content
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

Enable compressed formats in wgpu for 3D textures #5751

Open
wants to merge 13 commits into
base: trunk
Choose a base branch
from

Conversation

mehmetoguzderin
Copy link
Contributor

Fixes #5750

Since it has been a while since I created a PR for wgpu, I might have overlooked some aspects. Your guidance would be appreciated. Thank you!

@mehmetoguzderin mehmetoguzderin requested a review from a team as a code owner May 28, 2024 23:33
@teoxoy
Copy link
Member

teoxoy commented May 29, 2024

I do have a larger concern about this though; with the availability of ASTC/ETC formats on Vulkan gpuweb/gpuweb#3183 (comment) and it seems ETC formats on Metal as well (contrary to their docs) gpuweb/gpuweb#3183 (comment).

@mehmetoguzderin
Copy link
Contributor Author

@teoxoy right, seems like further investigation is necessary as to only allow BCn or also ASTC (ETC2 seems harder).

wgpu-types/src/lib.rs Outdated Show resolved Hide resolved
@teoxoy
Copy link
Member

teoxoy commented Jun 3, 2024

The macOS runner seems to be failing a lot of tests (looks like the ones that actually execute something on the queue) right after we start executing clear_texture_compressed_bcn.

        SLOW [> 45.000s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_compressed_bcn
        SLOW [> 45.000s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_uncompressed
        SLOW [> 45.000s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_uncompressed_gles
        PASS [  60.282s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_uncompressed
        PASS [  61.647s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_compressed_bcn
...
 TERMINATING [> 90.000s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_uncompressed_gles
     TIMEOUT [  90.003s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_uncompressed_gles
...
     Summary [ 881.135s] 382 tests run: 360 passed (15 slow), 17 failed, 5 timed out, 0 skipped
     TIMEOUT [  90.003s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_uncompressed_gles
        FAIL [  60.095s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::compute_pass_ownership::compute_pass_resource_ownership
        FAIL [  60.116s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::occlusion_query::occlusion_query
        FAIL [  60.150s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::push_constants::partial_update
        FAIL [  60.115s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::regression::issue_3349::multi_stage_data_binding
     TIMEOUT [  90.008s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::regression::issue_4122::clear_buffer_range_respected
        FAIL [  60.143s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::scissor_tests::scissor_test_custom_rect
        FAIL [  60.111s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::scissor_tests::scissor_test_full_rect
        FAIL [  60.115s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader::data_builtins::pack4x_i8
        FAIL [  60.126s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader::data_builtins::pack4x_u8
        FAIL [  60.104s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader::data_builtins::unpack4x_i8
        FAIL [  60.102s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader::data_builtins::unpack4x_u8
        FAIL [  60.155s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader::numeric_builtins::numeric_builtins
     TIMEOUT [  90.010s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader::struct_layout::push_constant_input
     TIMEOUT [  90.010s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader::struct_layout::storage_input
        FAIL [  61.269s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader::struct_layout::uniform_input
        FAIL [  60.112s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader_primitive_index::draw
        FAIL [  60.126s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader_primitive_index::draw_indexed
        FAIL [  60.185s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::shader_view_format::reinterpret_srgb
     TIMEOUT [  90.010s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::vertex_indices::vertex_indices
        FAIL [  60.075s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::write_texture::write_texture_subset_2d
        FAIL [  60.112s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::write_texture::write_texture_subset_3d

For reference, this is how long the clear texture ones take on trunk:

        PASS [   0.347s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_uncompressed
        PASS [   0.730s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_compressed_bcn
        PASS [   2.736s] wgpu-test::wgpu-test [Executed] [Metal/Apple Paravirtual device/0] wgpu_test::clear_texture::clear_texture_uncompressed_gles

This is odd since the BC test eventually succeeds but there is some internal state getting messed up making the device unusable even across tests?

@mehmetoguzderin
Copy link
Contributor Author

@teoxoy On my local device (just baseline M1), I get the following runtime for BCn clear tests:

PASS [   3.343s] wgpu-test::wgpu-test [Executed] [Metal/Apple M1/1] wgpu_test::clear_texture::clear_texture_compressed_bcn
PASS [   3.295s] wgpu-test::wgpu-test [Executed] [Vulkan/Apple M1/0] wgpu_test::clear_texture::clear_texture_compressed_bcn

So, unfortunately, I am unable to reproduce the CI's situation locally. BTW, I just checked the validation layers on my macOS environment, and they are all set to valid paths, which seem to work across many apps, including Vulkan Configurator itself, yet I still get the same [Vulkan/Apple M1/0] wgpu_test::shader::struct_layout::uniform_input failure (the only test fail on my system).

@teoxoy
Copy link
Member

teoxoy commented Jun 3, 2024

That sounds like another curious issue tracked by #5665.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable compressed formats for 3D textures
2 participants