Skip to content

webgpu: リサイズ処理のバグ改修#254

Merged
ienaga merged 4 commits intomainfrom
develop
Feb 11, 2026
Merged

webgpu: リサイズ処理のバグ改修#254
ienaga merged 4 commits intomainfrom
develop

Conversation

@ienaga
Copy link
Copy Markdown
Member

@ienaga ienaga commented Feb 11, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 11, 2026 08:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a WebGPU resize handling bug by implementing a deferred reconfiguration pattern. The issue stems from WebGPU's behavior where setting canvas.width/height implicitly unconfigures the context, requiring configure() to be called before getCurrentTexture(). The fix ensures the correct sequence: resize() → $resizeComplete() sets canvas dimensions → configure() → getCurrentTexture().

Changes:

  • Introduced deferred canvas context reconfiguration in WebGPU using a $needsReconfigure flag
  • Moved $resizeComplete() call to execute before frame rendering begins, ensuring canvas dimensions are set before context reconfiguration
  • Added comprehensive test coverage for the resize and reconfigure flow

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/index.ts Updated version string from 3.0.0 to 3.0.2
packages/webgpu/src/Context.ts Implemented deferred reconfiguration pattern with $needsReconfigure flag; removed immediate canvas dimension setting and configure() call from resize()
packages/webgpu/src/Context.test.ts Added comprehensive test suite for resize and reconfigure flow (9 new test cases)
packages/renderer/src/Command/usecase/CommandRenderUseCase.ts Moved $resizeComplete() call from after rendering to before frame start to ensure canvas dimensions are set before configure()
package.json Version bump to 3.0.2 and dev dependency updates
package-lock.json Version bump to 3.0.2 and lockfile updates for dev dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts

if (!("next2d" in window)) {
console.log("%c Next2D Player %c 3.0.0 %c https://next2d.app",
console.log("%c Next2D Player %c 3.0.2 %c https://next2d.app",
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The version in the console.log was updated from 3.0.0 to 3.0.2, but the package.json shows the previous version as 3.0.1. This creates a discrepancy where the version string in src/index.ts jumped from 3.0.0 to 3.0.2, skipping 3.0.1. The version should be consistent across all version strings in the codebase. Consider whether src/index.ts should have been 3.0.1 before this change, or verify that this version jump is intentional.

Copilot uses AI. Check for mistakes.
@ienaga ienaga merged commit a9ce032 into main Feb 11, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants