File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
crates/spirv-std/macros/src Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -574,11 +574,11 @@ mod params {
574574 }
575575
576576 pub fn image_access_to_const_u32 ( access : Option < AccessQualifier > ) -> proc_macro2:: TokenStream {
577- match access {
578- Some ( AccessQualifier :: ReadOnly ) => quote ! ( AccessQualifier :: ReadOnly as u32 ) ,
579- Some ( AccessQualifier :: WriteOnly ) => quote ! ( AccessQualifier :: WriteOnly as u32 ) ,
580- Some ( AccessQualifier :: ReadWrite ) => quote ! ( AccessQualifier :: ReadWrite as u32 ) ,
581- None => quote ! ( 3 ) ,
577+ if let Some ( aq ) = access {
578+ let n = aq as u32 ;
579+ quote ! ( #n )
580+ } else {
581+ quote ! ( 3 )
582582 }
583583 }
584584
Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ use std::fmt::Write;
123123/// Accepted values: `true` or `false`. Default: `false`.
124124/// - `depth` — Whether it is known that the image is a depth image.
125125/// Accepted values: `true` or `false`. Default: `unknown`.
126+ /// - `access` — The access qualifier of the image, if known.
127+ /// Accepted values: `readonly`, `writeonly` or `readwrite`.
126128///
127129/// [`ImageFormat`]: spirv_std_types::image_params::ImageFormat
128130///
You can’t perform that action at this time.
0 commit comments