-
Notifications
You must be signed in to change notification settings - Fork 104
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
Limits fallback #302
Limits fallback #302
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I'm not fully grasping how this works in practice.
IIUC, when you have an adapter that supports the default limits, it will create a device with these limits (unless the user specifies specific limits). If there is (at least) one default limit that the adapter cannot provide, the default limits (all of 'm) fall back to a lower standard (GLES3 compatible-ish).
Correct, also do note that these default limits are only used in following conditions:
If user is relying on these defaults, then with this behaviour user would have to only worry about two possible levels of device types, one with default webgpu limits another with downlevel limits. If we do something else like try to use the webgpu default limits and clamping to available adapter limits - then it would no longer be the case. A more critical user should not rely on these defaults, they should do their own investigation of possible device limits for their app/game and pass them for device creation. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
So what happens when the user provides values for some limits, and This PR can be merged regardless of the answer, as far as I am concerned 👍 |
Currently, if user provides some limit values and provides undefined for some ( |
And in case of limits that are exposed by wgpu-core are not present in |
Thanks for the explanation! All clear now 😄 |
Fixes #297
Context
Support creating devices with lower than
Limits::default()
limits, by falling back toLimits::downlevel_default()
if adapter's limits are lower thanLimits::default()
. (checked by usingwgt::Limits::check_limits()
)Testing
untested, but added a unit test