Conversation
There was a problem hiding this comment.
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
$needsReconfigureflag - 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.
|
|
||
| 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", |
There was a problem hiding this comment.
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.
No description provided.