Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

feat: Allow overrides as the length of workgroup arrays

Aperta
#3,133 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start by tracing d.arrayOf and tgpu.workgroupVar, then inspect how overrides are represented and how array lengths flow into sizeOf and buffer reads or writes. Done means workgroup arrays can use an override length, invalid address spaces and CPU-side operations produce clear errors, and the TypeScript type is defined.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Follow-up to #3131.

Problem

WGSL allows an override as the length of an array in the workgroup address space:

override tileSize: u32 = 64;

var<workgroup> tile: array<f32, tileSize>;

In TypeGPU, d.arrayOf(schema, length) only accepts a number, so the length of a workgroup array can't depend on an override.

Proposal

Let array schemas take an override as their length:

const tileSize = tgpu['~unstable'].override(d.u32, 64);

const tile = tgpu.workgroupVar(d.arrayOf(d.f32, tileSize));

Things to figure out

  • WGSL only allows these arrays in the workgroup address space. Using one anywhere else (buffers, private variables, function variables, etc.) should give a clear error.
  • CPU-side code that depends on the array length (sizeOf, reading and writing buffers, etc.) can't know it. These arrays should be rejected there.
  • How the type of such an array looks on the TypeScript side.
Lingua principale
TypeScript
Stelle
3.3k
Fork
135
Merge medio
4g 1h
PR unite (30g)
64

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di software-mansion/TypeGPU

Tutte le issue di software-mansion/TypeGPU

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.