texture.write(VideoFrame) uses the padded coded size instead of the visible size
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend, computer-graphics
Hướng nghiên cứu
Đọc packages/typegpu/src/core/texture/textureWrite.ts, tập trung vào imageSize() và cách xử lý VideoFrame. So sánh các kích thước được dùng với displayWidth/displayHeight hoặc visibleRect, như mô tả trong issue. Thêm hoặc cập nhật một bài kiểm thử cho frame có kích thước mã hóa khác với kích thước hiển thị, sau đó xác nhận rằng texture.write(frame) chấp nhận texture có kích thước hiển thị tương ứng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.3k
- Fork
- 143
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 72
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của software-mansion/TypeGPU
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
software-mansion/TypeGPU#3327 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
docs: Mnist on small phonesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
software-mansion/TypeGPU#3320 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Opt-out for the module-load eval probe (strict CSP reports a violation on import)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
software-mansion/TypeGPU#3276 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
software-mansion/TypeGPU#3219 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
impr: Error message in examplesĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
software-mansion/TypeGPU#3008 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của software-mansion/TypeGPU
Issue tương tự
-
FR: Support CJK brackets, symbols and full-width markers in footnoteHeuristics (EBPAJ support)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
readest/readest#7413 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
content triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eliasstravik/herdr-projects#788 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Ability to edit tagsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày