Rust-GPU / Rust-GPU/rust-gpu

[Migrated] Image macro doesn't fully enforce valid use of non-sampled storage images

Aperta
#116 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Rust
Stelle
3.4k
Fork
125
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/812
Old labels: t: bug,s: blocked
Originally creatd by fu5ha on 2021-11-29T20:17:40Z


Currently, if we create an image type with the image macro as such:

Image!(2D, type=f32, sampled=false),

the image will still be able to be .read/.fetched, and the spirv Image object won't be decorated as NonReadable. However, according to vulkan spec, "If shaderStorageImageReadWithoutFormat is not enabled, any variable created with a "Type" of OpTypeImage that has a "Sampled" operand of 2 and an "Image Format" operand of Unknown must be decorated with NonReadable."

This can be solved for now by just using an explicit format=blah in the Image macro instead of type, but I think we could also handle this/validate it in the macro automatically. I think the best way forward would be:

  • Make a readable flag in the macro which gets auto-disabled under the above conditions, and when disabled, decorates the OpTypeImage with NonReadable and doesn't allow to do .read/.fetch on the Image.
  • However, if it is manually enabled, then we do the current behavior, allowing read etc. (assuming shaderStorageImageReadWithoutFormat is enabled).

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.

Direzione di ricerca

Inizia dalla macro Image e traccia come type, sampled=false e .read/.fetch influenzano l’OpTypeImage generato. Controlla come viene emesso NonReadable e come vengono consentite le operazioni di lettura. Il lavoro è completato quando le immagini di storage non campionate non valide vengono contrassegnate come NonReadable e non possono essere lette a meno che ciò non venga abilitato esplicitamente, verificando il comportamento rispetto alla regola Vulkan descritta nell’issue.

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

Valutazione

Stack tecnologico
rust
Ambito
compilers
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.