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

vulkan: use effective api version for determining device features #3011

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

i509VCB
Copy link
Contributor

@i509VCB i509VCB commented Sep 5, 2022

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Description
wgpu wrongly assumes that the instance version will always be the maximum version supported. This assumption can be broken by using Instance::from_raw. This pull request fixes that issue by calculating the "effective" api version the device supports, which is the lower of the instance version and physical device version. More information can be found in the Vulkan specification's documentation for VkPhysicalDeviceProperties.

Testing
Tests succeed locally.

Testing could be improved by introducing CI runs in the future which artificially lower the instance version to test the behavior is correct. Possibly via an environment variable such as WGPU_VULKAN_INSTANCE_VERSION.

wgpu wrongly assumes that the instance version will always be the maximum value. This assumption can be broken by using Instance::from_raw. This pull request fixes that issue by calculating the "effective" api version the device supports, which is the lower of the instance version and physical device version. More information can be found in the Vulkan specification's documentation for VkPhysicalDeviceProperties.
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.

Slipped through the cracks, sorry!

@cwfitzgerald cwfitzgerald merged commit 65e4051 into gfx-rs:master Sep 20, 2022
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.

2 participants