texSubImage2D missing WebGL2 syntax

Aperta
#58,695 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
web-dev

Direzione di ricerca

Inizia cercando le dichiarazioni WebGL2 texSubImage2D, usando la firma della chiamata segnalata e l'errore ImageBitmap come punto di ingresso. Confronta gli overload disponibili con la sintassi WebGL2 e verifica che questa chiamata esatta a ImageBitmap superi il controllo dei tipi senza compromettere la forma ArrayBufferView esistente.

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

Descrizione

Bug Domain: lib.d.ts Help Wanted Needs Human Review Needs More Info
🔎 Search Terms

texSubImage2D WebGL2

🕗 Version & Regression Information
  • I was unable to test this on prior versions because I used gl.texSubImage2D with ImageBitmap as source only just now
⏯ Playground Link

No response

💻 Code
gl.texSubImage2D(
  gl.TEXTURE_2D,
  0,
  0,
  0,
  100,
  100,
  gl.RGBA,
  gl.UNSIGNED_BYTE,
  data // <----- instanceof ImageBitmap
);
🙁 Actual behavior

Error:

Argument of type 'ImageBitmap' is not assignable to parameter of type 'ArrayBufferView'.
Type 'ImageBitmap' is missing the following properties from type 'ArrayBufferView': buffer, byteLength, byteOffset

🙂 Expected behavior

The code actually works fine, but I expect TS to not complain about the type.

Additional information about the issue

I am using a worker to gradually create the texture by creating the tiles and sending them back. The data comes from createImageBitmap metod as ImageBitmap and then pass it to texSubImage2D

Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Guida per i contributori

Apri la guida per i contributori

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 microsoft/TypeScript

Tutte le issue di microsoft/TypeScript

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.