Skip to content

upgrade to wgpu v25 #477

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

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

Conversation

ygdrasil-io
Copy link
Contributor

Upgrade to wgpu v25 and update the Android NDK version to v28.
I built a version for testing :
https://github.com/ygdrasil-io/wgpu-native/releases/tag/v25.0.0.1

Updated dependencies to wgpu-core, wgpu-types, wgpu-hal, and naga v25.0.1. Applied significant code changes to align with the updated wgpu API, including refactoring device polling, shader module descriptors, and unused features removal. Addressed compatibility issues and added necessary comments for unsupported features.
The js-sys dependency was not used in the project and is unnecessary. Cleaning up unused dependencies simplifies the configuration and reduces potential security risks.
The `js-sys` crate was no longer being used in the project but remained in the dependencies list. This cleanup reduces clutter and ensures the dependency graph remains accurate.
Bumped the WGPU_ANDROID_NDK_VERSION from r27b to r28b to use the latest available version. This ensures the build process stays up-to-date with recent updates and fixes in the Android NDK. No other changes were made to the CI configuration.
Updated CMakeLists.txt files to include the Foundation framework alongside CoreFoundation, QuartzCore, and Metal for macOS. This ensures proper linking and resolves potential dependency issues in macOS builds.
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, some concerns

@@ -296,6 +296,7 @@ pub unsafe fn map_instance_descriptor(
(Some(dxil_path), Some(dxc_path)) => wgt::Dx12Compiler::DynamicDxc {
dxil_path: dxil_path.to_string(),
dxc_path: dxc_path.to_string(),
max_shader_model: wgt::DxcShaderModel::V6_7,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add this as a member in extras

@@ -307,10 +308,12 @@ pub unsafe fn map_instance_descriptor(
backend_options: wgt::BackendOptions {
gl: wgt::GlBackendOptions {
gles_minor_version: map_gles3_minor_version(extras.gles3MinorVersion),
fence_behavior: Default::default(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This as well

Comment on lines +1147 to +1152
// TODO: fix this, UNIFORM_BUFFER_AND_STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING is not supported anymore https://github.com/gfx-rs/wgpu/issues/4407
// if features
// .contains(wgt::Features::UNIFORM_BUFFER_AND_STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING)
// {
// temp.push(native::WGPUNativeFeature_UniformBufferAndStorageTextureArrayNonUniformIndexing);
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you file an issue about fixing these, or include the fix in the PR?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can simply remove it from wgpu.h.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should review all the enumerations at once, as some are commented. Is there already an issue for tacking this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, would be good to review the feature enums 👌 Issue #190 seems related.

Comment on lines +4289 to +4290
// TODO check if we need to check the PollStatus to return true or false
Ok(_) => true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this needs to match if PollStatus == QueueEmpty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we log something when it does not match ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, matches!(poll_status, QueueEmpty) instead of always true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get it, but should we add a log to explain what is happening when we return false ?

@cwfitzgerald
Copy link
Member

With the new behavior in features, I think we can use a single unconditional dep on wgc with the dx12, gles, vulkan, and metal features.

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.

3 participants