Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

texture.write(VideoFrame) uses the padded coded size instead of the visible size

オープン 初心者向け
#3,213 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@RaphaelFakhri がすでに取り組んでいます。

2026年10月20日 から。

  • #3224 @RaphaelFakhri による — オープン

評価

難易度
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 の本文から書いたものです。

説明

bug

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

software-mansion/TypeGPU のほかの issue

software-mansion/TypeGPU の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。