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

@typegpu/gl: support texture.write() options

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

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

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
47/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
backend

調査の方向性

Start in packages/typegpu-gl at WebGLTexture.write() and compare its behavior with the WebGPU texture write path, especially the handling of 'render' textures. The issue lists WebGL 2 mappings for several options and calls out framebuffer blitting for resampling; identify which options can be supported and which need a specific error. Done means options work where supported and unsupported ones are named in the error; the issue does not name tests to run.

索引モデルが issue の本文から書いたものです。

説明

enhancement

Description

On a root from @typegpu/gl, any texture.write() call that passes an options object throws:

WebGL fallback does not support texture.write() options yet.

Code that passes options on WebGPU, such as { premultipliedAlpha: false, fit: 'clip' } (added in #2641), has to check isGLRoot(root) and call write differently on each backend:

if (isGLRoot(root)) {
  texture.write(source);
} else {
  texture.write(source, { premultipliedAlpha: false, fit: 'clip' });
}

This defeats the point of a drop-in fallback.

Proposal

Support the options in WebGLTexture.write() in packages/typegpu-gl, or at least accept and ignore those that already match WebGL's behavior. Most of them map onto WebGL 2 directly:

  • premultipliedAlpha: UNPACK_PREMULTIPLY_ALPHA_WEBGL
  • flipY: UNPACK_FLIP_Y_WEBGL
  • origin / mipLevel: the xoffset/yoffset/level arguments of texSubImage2D
  • sourceOrigin and fit: 'clip': UNPACK_SKIP_PIXELS / UNPACK_SKIP_ROWS / UNPACK_ROW_LENGTH for buffers, or a sized texSubImage2D for image sources
  • fit: 'fill' / resampling: a blit through a framebuffer, as the WebGPU path does for 'render' textures

Options that can't be supported should throw a specific error naming the unsupported option rather than rejecting every options object.


Found in @typegpu/gl 0.12.6. Related: #2641, #2858, #1637.

主要言語
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 を短くまとめたダイジェスト。