[Migrated] Image macro doesn't fully enforce valid use of non-sampled storage images
Personne n'a encore pris cette issue.
- Langage dominant
- Rust
- Étoiles
- 3.4k
- Forks
- 126
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
readableflag in the macro which gets auto-disabled under the above conditions, and when disabled, decorates theOpTypeImagewithNonReadableand doesn't allow to do.read/.fetchon the Image. - However, if it is manually enabled, then we do the current behavior, allowing
readetc. (assumingshaderStorageImageReadWithoutFormatis enabled).
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la macro Image et suivez l’impact de type, sampled=false et .read/.fetch sur le OpTypeImage généré. Vérifiez comment NonReadable est émis et comment les opérations de lecture sont autorisées. C’est terminé lorsque les images de stockage non échantillonnées invalides sont marquées NonReadable et ne peuvent pas être lues sauf si cela est explicitement activé, avec un comportement vérifié par rapport à la règle Vulkan décrite dans l’issue.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust
- Domaine
- compilers
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100