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

OS X SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING Unsupported? #33

Open
dnwe opened this issue Jul 27, 2020 · 3 comments
Open

OS X SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING Unsupported? #33

dnwe opened this issue Jul 27, 2020 · 3 comments

Comments

@dnwe
Copy link

dnwe commented Jul 27, 2020

OS X 10.15.3 w/ Radeon Pro 5300M — SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING seems to report as Unsupported

     Running `target/release/quake-client --demo demo.dem`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: UnsupportedFeature(SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING)', /Users/dnwe/.cargo/git/checkouts/wgpu-rs-40ea39809c03c5d8/08497ce/src/backend/direct.rs:516:118
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: wgpu::backend::direct::<impl wgpu::Context for wgpu_core::hub::Global<wgpu_core::hub::IdentityManagerFactory>>::adapter_request_device
  10: wgpu::Adapter::request_device
  11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  12: std::thread::local::LocalKey<T>::with
  13: futures_executor::local_pool::block_on
  14: quake_client::main
  15: std::rt::lang_start::{{closure}}
  16: std::rt::lang_start_internal
  17: main

It's strange as wgpu seems to claim Metal on macOS 10.13+ should be supported for this:
https://github.com/gfx-rs/wgpu/blob/11b3a95671d096aae2eac0d187be5472b5ab91c0/wgpu-types/src/lib.rs#L172-L184

Is this something you've seen before?

@dnwe
Copy link
Author

dnwe commented Jul 27, 2020

Note, commenting out the feature doesn't get much further as we fail the metal limit assertion here:
https://github.com/gfx-rs/gfx/blob/3fce1bd0550110f0565018fd2b4b74a4da151c62/src/backend/metal/src/device.rs#L1290

@cormac-obrien
Copy link
Owner

It looks like the upper limit on arrays of sampled textures is 128 for Metal. I was going to convert the UI shaders to use proper array textures later on, but this bumps that up in the queue (and will fix the unsupported feature issue as well).

As for SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING being unsupported, I can't be of much help there since I don't have a Mac to test on -- if you try out the texture array example for wgpu-rs and have the same problem, that should probably be filed as an issue!

@dnwe
Copy link
Author

dnwe commented Jul 30, 2020

@cormac-obrien the texture-arrays sample does work, but that's because it does a match against the device features and only enables what is supported:

https://github.com/gfx-rs/wgpu-rs/blob/50d62046655cd180c4933dc575401ee46a14d8ad/examples/texture-arrays/main.rs#L113-L116

This doesn't come back in the features set so it doesn't enter this block for SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING.

I'll raise an issue on wgpu-rs to query the lib.rs comment that claims it should be supported on Metal

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

No branches or pull requests

2 participants