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

request: being able to explicitly declare vertex-buffer slots for pipelines

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
typescript

調査の方向性

root.createRenderPipeline エントリポイントから始め、頂点レイアウトがバッファースロットになるまでの流れを追跡します。null エントリを含む、提案された vertexBufferSlots 配列を、既存の自動割り当てパスと比較します。完了の条件は、オプトインした固定スロットがパイプラインの各バリアントで機能し、このオプションを指定しないパイプラインでは現在の動作が維持されることです。

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

説明

TypeGPU currently assigns vertex-buffer slots consecutively in order in which vertex layouts were encountered by the shader - 0, 1, 2 etc.

I'm working on a project where it's much easier to reason about and handle things if slots were fixed. I wanted to make it so:

  • Slot 0: standard vertex data
  • Slot 1: skinning data
  • Slot 2: vertex colors
  • Slots 3+: custom

Not every pipeline has to use every slot. For example, an unskinned pipeline would use standard vertex data and vertex colors (slots 0 and 2). WebGPU supports this via null values like buffers: [standardLayout, null, colorLayout].

In the above case, typeGPU would assign the color layout to slot 1 and I couldnt find any way to reserve the unused slot (without unwrapping everything and just using basically vanilla webgpu).

Could TypeGPU support optional per pipeline slot mapping as an opt-in? I think it's totally possible to make it so current DX is unchanged while adding this as optional

root.createRenderPipeline({
    vertex,
    fragment,
    attribs,
    vertexBufferSlots: [standardLayout, null, colorLayout]
  });

This would make slots allocation predictable across pipeline variants, so render passes would not need to know which optional layouts a particular pipeline consumes.

When vertexBufferSlot option is not present, existing behaviour of assigning slots in order would remain unchanged.

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