Skip to content

Trigger a surface resize to deal with window resize race condition#9525

Open
k9 wants to merge 1 commit into
gfx-rs:trunkfrom
k9:bugfix/triangle
Open

Trigger a surface resize to deal with window resize race condition#9525
k9 wants to merge 1 commit into
gfx-rs:trunkfrom
k9:bugfix/triangle

Conversation

@k9
Copy link
Copy Markdown
Contributor

@k9 k9 commented May 7, 2026

Connections
#9515

Description
Address race condition where hello triangle on webgpu can sometimes draw a fully-red screen since:

  • the surface size is 0x0 when async initialization occurs
  • winit's Resized event with the real window size may be ignored since it can be fired before the async initialization's Initialized event has been processed.

Testing
Explain how this change is tested.

Squash or Rebase?
Squash

Checklist

  • I self-reviewed and fully understand this PR.
  • WebGPU implementations built with wgpu may be affected behaviorally.
  • Validation and feature gates are in place to confine behavioral changes.
  • Tests demonstrate the validation and altered logic works.
  • CHANGELOG.md entries for the user-facing effects of this change are present.
  • The PR is minimal, and doesn't make sense to land as multiple PRs.
  • Commits are logically scoped and individually reviewable.
  • The PR description has enough context to understand the motivation and solution implemented.

@k9 k9 force-pushed the bugfix/triangle branch from dce3965 to 0fe61e0 Compare May 8, 2026 17:07
@k9 k9 marked this pull request as ready for review May 8, 2026 17:08
@k9 k9 changed the title Trigger a resize to deal with Loading race condition Trigger a surface resize to deal with window resize race condition May 8, 2026
Copy link
Copy Markdown
Collaborator

@inner-daemons inner-daemons left a comment

Choose a reason for hiding this comment

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

LGTM

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