Conversation
There was a problem hiding this comment.
Pull request overview
WebGPU 実装におけるリサイズ時の描画不具合(canvas の width/height 更新で GPUCanvasContext が暗黙的に unconfigure される問題)を回避するため、リサイズ完了処理と configure() / getCurrentTexture() の呼び出し順を調整するPRです。合わせてパッケージバージョンと一部開発依存関係も更新されています。
Changes:
- WebGPU
Context.resize()でのconfigure()再実行を遅延し、次フレーム開始時に再configure()してからgetCurrentTexture()するよう変更 - 描画開始前に
$resizeComplete()を実行するようにし、WebGPU の unconfigure 状態で描画開始しないよう順序を変更 - バージョンを
3.0.2に更新し、関連する devDependencies / lockfile を更新
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/index.ts | 起動時ログのプレイヤーバージョン表記を 3.0.2 に更新 |
| packages/webgpu/src/Context.ts | リサイズ後の configure() を ensureMainTexture() 側に寄せ、再設定フラグで制御 |
| packages/renderer/src/Command/usecase/CommandRenderUseCase.ts | 描画開始前に $resizeComplete() を実行するよう順序変更 |
| package.json | パッケージバージョンと devDependencies を更新 |
| package-lock.json | 依存関係更新に伴うロックファイル更新 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // リサイズ完了処理を描画開始前に実行 | ||
| // WebGPUではcanvas.width/height設定がコンテキストをunconfigureするため、 | ||
| // beginFrame()→ensureMainTexture()でconfigure()→getCurrentTexture()する前に | ||
| // canvas.width/heightを確定させる必要がある | ||
| if ($isResize()) { | ||
| $resizeComplete(); | ||
| } |
There was a problem hiding this comment.
リサイズ時は「$resizeComplete()が最初に呼ばれる」ことが重要なので、既存テストを拡張して $resizeComplete の呼び出しが $context.clearTransferBounds() などの描画処理より前になることを検証した方が安全です(WebGPUのunconfigure回避の意図をテストで固定化)。
| "name": "@next2d/player", | ||
| "version": "3.0.1", | ||
| "version": "3.0.2", | ||
| "description": "Experience the fast and beautiful anti-aliased rendering of WebGL. You can create rich, interactive graphics, cross-platform applications and games without worrying about browser or device compatibility.", |
There was a problem hiding this comment.
PRタイトルはリサイズバグ修正ですが、このPRではプレイヤーバージョン更新に加えて複数の依存関係更新も含まれています。リサイズ修正と依存関係更新は影響範囲やロールバック容易性が異なるため、(1) 目的として明記するか、(2) 可能ならPRを分けてレビュー/リリースリスクを下げてください。
| // リサイズ後はcanvas.width/heightが$resizeComplete()で更新されているので | ||
| // ここでconfigure()を呼んでからgetCurrentTexture()を取得する | ||
| if (this.$needsReconfigure) { | ||
| this.canvasContext.configure({ | ||
| "device": this.device, | ||
| "format": this.preferredFormat, | ||
| "alphaMode": "premultiplied" | ||
| }); | ||
| this.$needsReconfigure = false; | ||
| } |
There was a problem hiding this comment.
WebGPUのリサイズ後フロー($needsReconfigure→configure()→getCurrentTexture())は不具合の再発に直結しやすいので、ユニットテストで担保したいです。例: context.resize()後にbeginFrame()を呼ぶと、getCurrentTexture()の前にcanvasContext.configure()が1回だけ呼ばれ、以降は呼ばれないことを検証してください。
No description provided.