texture.write(VideoFrame) uses the padded coded size instead of the visible size
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
packages/typegpu/src/core/texture/textureWrite.tsを読み、imageSize()とVideoFrameの処理に注目してください。issueの説明にあるように、使用される寸法をdisplayWidth/displayHeightまたはvisibleRectと比較してください。コードサイズが表示サイズと異なるフレームのテストを追加または更新し、texture.write(frame)が表示サイズの一致するテクスチャを受け入れることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Description
texture.write(videoFrame) reads a VideoFrame's size from codedWidth/codedHeight. Those are the decoder's padded buffer dimensions, not the visible image. Decoders often pad to a macroblock multiple, so a 320×240 video can give frames with a coded size of 320×258. The size check then fails against a texture created at the video's real size:
Texture write source size 320x258 does not match target size 320x240
Repro
const root = await tgpu.init();
// `frame` is a decoded VideoFrame from a 320x240 H.264 file
// (e.g. from a WebCodecs VideoDecoder or Mediabunny's VideoSample.toVideoFrame()).
// frame.codedWidth/Height = 320x258; frame.displayWidth/Height = 320x240.
const texture = root
.createTexture({ size: [frame.displayWidth, frame.displayHeight], format: 'rgba8unorm' })
.$usage('sampled', 'render');
texture.write(frame); // throws: source size 320x258 does not match target size 320x240
Cause
imageSize() in packages/typegpu/src/core/texture/textureWrite.ts falls back to codedWidth/codedHeight for VideoFrames. It should use displayWidth/displayHeight (or visibleRect). Those match what copyExternalImageToTexture copies and what the WebGL path's texSubImage2D uploads.
Workaround
Pass { fit: 'clip' } to write(), which copies the top-left region of the requested size.
Found in typegpu 0.12.7.
- 主要言語
- TypeScript
- スター
- 3.3k
- フォーク
- 135
- 平均マージ
- 4日 1時間
- マージ済み PR(30日)
- 64
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
software-mansion/TypeGPU のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
software-mansion/TypeGPU#3219 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
software-mansion/TypeGPU#3008 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
software-mansion/TypeGPU#2948 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
docs: Fix camera orientation in "Monocular Light Injection" example対応中かも @pullfrog が 62 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
software-mansion/TypeGPU#2890 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
fix: Expand the signature of `std.sign` and `std.floor` to accept the union `number | d.v2f | d.v3f | d.v4f`対応中かも @oxura が 49 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
software-mansion/TypeGPU#2821 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
software-mansion/TypeGPU の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
zts212653/clowder-ai#1678 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
Progressive-Victory/the-website#680 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100