Skip to content

Comments

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

Closed
ienaga wants to merge 4 commits intomainfrom
develop
Closed

webgpu: リサイズ処理のバグ改修#253
ienaga wants to merge 4 commits intomainfrom
develop

Conversation

@ienaga
Copy link
Member

@ienaga ienaga commented Feb 11, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 11, 2026 08:24
Copy link
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

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.

Comment on lines +32 to +38
// リサイズ完了処理を描画開始前に実行
// WebGPUではcanvas.width/height設定がコンテキストをunconfigureするため、
// beginFrame()→ensureMainTexture()でconfigure()→getCurrentTexture()する前に
// canvas.width/heightを確定させる必要がある
if ($isResize()) {
$resizeComplete();
}
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.

リサイズ時は「$resizeComplete()が最初に呼ばれる」ことが重要なので、既存テストを拡張して $resizeComplete の呼び出しが $context.clearTransferBounds() などの描画処理より前になることを検証した方が安全です(WebGPUのunconfigure回避の意図をテストで固定化)。

Copilot uses AI. Check for mistakes.
Comment on lines 2 to 4
"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.",
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.

PRタイトルはリサイズバグ修正ですが、このPRではプレイヤーバージョン更新に加えて複数の依存関係更新も含まれています。リサイズ修正と依存関係更新は影響範囲やロールバック容易性が異なるため、(1) 目的として明記するか、(2) 可能ならPRを分けてレビュー/リリースリスクを下げてください。

Copilot uses AI. Check for mistakes.
Comment on lines +2489 to +2498
// リサイズ後はcanvas.width/heightが$resizeComplete()で更新されているので
// ここでconfigure()を呼んでからgetCurrentTexture()を取得する
if (this.$needsReconfigure) {
this.canvasContext.configure({
"device": this.device,
"format": this.preferredFormat,
"alphaMode": "premultiplied"
});
this.$needsReconfigure = false;
}
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.

WebGPUのリサイズ後フロー($needsReconfigure→configure()→getCurrentTexture())は不具合の再発に直結しやすいので、ユニットテストで担保したいです。例: context.resize()後にbeginFrame()を呼ぶと、getCurrentTexture()の前にcanvasContext.configure()が1回だけ呼ばれ、以降は呼ばれないことを検証してください。

Copilot uses AI. Check for mistakes.
@ienaga ienaga closed this Feb 11, 2026
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.

1 participant