Rust-GPU / Rust-GPU/rust-gpu

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

Offen
#116 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Rust
Sterne
3.4k
Forks
125
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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).

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne beim Image-Makro und verfolge, wie type, sampled=false und .read/.fetch das generierte OpTypeImage beeinflussen. Prüfe, wie NonReadable emittiert wird und wie Leseoperationen erlaubt werden. Erledigt ist dies, wenn ungültige nicht gesampelte Storage-Images als NonReadable markiert werden und nicht gelesen werden können, sofern dies nicht ausdrücklich aktiviert wurde, wobei das Verhalten anhand der im Issue beschriebenen Vulkan-Regel geprüft wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
compilers
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.