wgpu: adapt resolution limits to adapter capabilities - #379
Draft
adamjvr wants to merge 1 commit into
Draft
Conversation
Adapt the native wgpu resolution limits to the selected adapter's capabilities before requesting a device. This prevents adapters below wgpu's default resolution limits from failing the initial device request and unnecessarily falling back to downlevel defaults with a 2048 maximum 2D texture dimension.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adapt the native
iced_wgpuresolution-dependent limits to the capabilities reported by the selectedwgpu::Adapter.The current native path first requests
Limits::default(). On Raspberry Pi 5, the V3DV adapter supports a 4096 maximum 2D texture dimension, while the default request is larger. The request fails and iced falls back todownlevel_defaults(), unnecessarily constraining the logical device to 2048.At 2560x1440 this caused
Surface::configurefailures in COSMIC applications withmaximum extent for either dimension is 2048.Fix
Apply
.using_resolution(adapter.limits())to both native candidate limit sets. This preserves the existing default/downlevel fallback while adapting resolution-dependent limits to the actual adapter.Raspberry Pi 5 hardware A/B
cosmic-app-library@ 2560x1440: FAILcosmic-app-library@ 2560x1440: PASScosmic-workspaces@ 2560x1440: FAIL / wgpu panic / exit 101cosmic-workspaces@ 2560x1440: PASSmaxImageDimension2D: 4096GL_MAX_TEXTURE_SIZE: 4096Validation
cargo fmt --package iced_wgpu -- --check: PASScargo check --offline --package iced_wgpu: PASSgit diff --check: PASSThe checked-in upstream
Cargo.lockcurrently requires a one-line resolution refresh with the local Cargo toolchain; the same--lockedfailure was reproduced on an untouched upstream worktree. No lockfile changes are included here.This PR intentionally contains one commit modifying only
wgpu/src/window/compositor.rs.