[Migrated] Image macro doesn't fully enforce valid use of non-sampled storage images
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Rust
- Star
- 3.4k
- Fork
- 125
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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).
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu từ macro Image và lần theo cách type, sampled=false và .read/.fetch ảnh hưởng đến OpTypeImage được tạo ra. Kiểm tra cách NonReadable được phát ra và cách các thao tác đọc được cho phép. Hoàn thành khi các storage image không lấy mẫu không hợp lệ được đánh dấu là NonReadable và không thể được đọc trừ khi được bật một cách rõ ràng, với hành vi được kiểm tra đối chiếu với quy tắc Vulkan được mô tả trong issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- rust
- Lĩnh vực
- compilers
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100