@@ -3,7 +3,9 @@ use crate::builder_spirv::SpirvValue;
33use crate :: codegen_cx:: CodegenCx ;
44use indexmap:: IndexSet ;
55use rspirv:: dr:: Operand ;
6- use rspirv:: spirv:: { Capability , Decoration , Dim , ImageFormat , StorageClass , Word } ;
6+ use rspirv:: spirv:: {
7+ AccessQualifier , Capability , Decoration , Dim , ImageFormat , StorageClass , Word ,
8+ } ;
79use rustc_data_structures:: fx:: FxHashMap ;
810use rustc_middle:: span_bug;
911use rustc_span:: def_id:: DefId ;
@@ -74,6 +76,7 @@ pub enum SpirvType<'tcx> {
7476 multisampled : u32 ,
7577 sampled : u32 ,
7678 image_format : ImageFormat ,
79+ access_qualifier : Option < AccessQualifier > ,
7780 } ,
7881 Sampler ,
7982 SampledImage {
@@ -241,6 +244,7 @@ impl SpirvType<'_> {
241244 multisampled,
242245 sampled,
243246 image_format,
247+ access_qualifier,
244248 } => cx. emit_global ( ) . type_image_id (
245249 id,
246250 sampled_type,
@@ -250,7 +254,7 @@ impl SpirvType<'_> {
250254 multisampled,
251255 sampled,
252256 image_format,
253- None ,
257+ access_qualifier ,
254258 ) ,
255259 Self :: Sampler => cx. emit_global ( ) . type_sampler_id ( id) ,
256260 Self :: AccelerationStructureKhr => {
@@ -416,6 +420,7 @@ impl SpirvType<'_> {
416420 multisampled,
417421 sampled,
418422 image_format,
423+ access_qualifier,
419424 } => SpirvType :: Image {
420425 sampled_type,
421426 dim,
@@ -424,6 +429,7 @@ impl SpirvType<'_> {
424429 multisampled,
425430 sampled,
426431 image_format,
432+ access_qualifier,
427433 } ,
428434 SpirvType :: Sampler => SpirvType :: Sampler ,
429435 SpirvType :: SampledImage { image_type } => SpirvType :: SampledImage { image_type } ,
@@ -579,6 +585,7 @@ impl fmt::Debug for SpirvTypePrinter<'_, '_> {
579585 multisampled,
580586 sampled,
581587 image_format,
588+ access_qualifier,
582589 } => f
583590 . debug_struct ( "Image" )
584591 . field ( "id" , & self . id )
@@ -589,6 +596,7 @@ impl fmt::Debug for SpirvTypePrinter<'_, '_> {
589596 . field ( "multisampled" , & multisampled)
590597 . field ( "sampled" , & sampled)
591598 . field ( "image_format" , & image_format)
599+ . field ( "access_qualifier" , & access_qualifier)
592600 . finish ( ) ,
593601 SpirvType :: Sampler => f. debug_struct ( "Sampler" ) . field ( "id" , & self . id ) . finish ( ) ,
594602 SpirvType :: SampledImage { image_type } => f
@@ -734,6 +742,7 @@ impl SpirvTypePrinter<'_, '_> {
734742 multisampled,
735743 sampled,
736744 image_format,
745+ access_qualifier,
737746 } => f
738747 . debug_struct ( "Image" )
739748 . field ( "sampled_type" , & self . cx . debug_type ( sampled_type) )
@@ -743,6 +752,7 @@ impl SpirvTypePrinter<'_, '_> {
743752 . field ( "multisampled" , & multisampled)
744753 . field ( "sampled" , & sampled)
745754 . field ( "image_format" , & image_format)
755+ . field ( "access_qualifier" , & access_qualifier)
746756 . finish ( ) ,
747757 SpirvType :: Sampler => f. write_str ( "Sampler" ) ,
748758 SpirvType :: SampledImage { image_type } => f
0 commit comments