@@ -3,7 +3,9 @@ use crate::builder_spirv::SpirvValue;
3
3
use crate :: codegen_cx:: CodegenCx ;
4
4
use indexmap:: IndexSet ;
5
5
use 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
+ } ;
7
9
use rustc_data_structures:: fx:: FxHashMap ;
8
10
use rustc_middle:: span_bug;
9
11
use rustc_span:: def_id:: DefId ;
@@ -74,6 +76,7 @@ pub enum SpirvType<'tcx> {
74
76
multisampled : u32 ,
75
77
sampled : u32 ,
76
78
image_format : ImageFormat ,
79
+ access_qualifier : Option < AccessQualifier > ,
77
80
} ,
78
81
Sampler ,
79
82
SampledImage {
@@ -241,6 +244,7 @@ impl SpirvType<'_> {
241
244
multisampled,
242
245
sampled,
243
246
image_format,
247
+ access_qualifier,
244
248
} => cx. emit_global ( ) . type_image_id (
245
249
id,
246
250
sampled_type,
@@ -250,7 +254,7 @@ impl SpirvType<'_> {
250
254
multisampled,
251
255
sampled,
252
256
image_format,
253
- None ,
257
+ access_qualifier ,
254
258
) ,
255
259
Self :: Sampler => cx. emit_global ( ) . type_sampler_id ( id) ,
256
260
Self :: AccelerationStructureKhr => {
@@ -416,6 +420,7 @@ impl SpirvType<'_> {
416
420
multisampled,
417
421
sampled,
418
422
image_format,
423
+ access_qualifier,
419
424
} => SpirvType :: Image {
420
425
sampled_type,
421
426
dim,
@@ -424,6 +429,7 @@ impl SpirvType<'_> {
424
429
multisampled,
425
430
sampled,
426
431
image_format,
432
+ access_qualifier,
427
433
} ,
428
434
SpirvType :: Sampler => SpirvType :: Sampler ,
429
435
SpirvType :: SampledImage { image_type } => SpirvType :: SampledImage { image_type } ,
@@ -579,6 +585,7 @@ impl fmt::Debug for SpirvTypePrinter<'_, '_> {
579
585
multisampled,
580
586
sampled,
581
587
image_format,
588
+ access_qualifier,
582
589
} => f
583
590
. debug_struct ( "Image" )
584
591
. field ( "id" , & self . id )
@@ -589,6 +596,7 @@ impl fmt::Debug for SpirvTypePrinter<'_, '_> {
589
596
. field ( "multisampled" , & multisampled)
590
597
. field ( "sampled" , & sampled)
591
598
. field ( "image_format" , & image_format)
599
+ . field ( "access_qualifier" , & access_qualifier)
592
600
. finish ( ) ,
593
601
SpirvType :: Sampler => f. debug_struct ( "Sampler" ) . field ( "id" , & self . id ) . finish ( ) ,
594
602
SpirvType :: SampledImage { image_type } => f
@@ -734,6 +742,7 @@ impl SpirvTypePrinter<'_, '_> {
734
742
multisampled,
735
743
sampled,
736
744
image_format,
745
+ access_qualifier,
737
746
} => f
738
747
. debug_struct ( "Image" )
739
748
. field ( "sampled_type" , & self . cx . debug_type ( sampled_type) )
@@ -743,6 +752,7 @@ impl SpirvTypePrinter<'_, '_> {
743
752
. field ( "multisampled" , & multisampled)
744
753
. field ( "sampled" , & sampled)
745
754
. field ( "image_format" , & image_format)
755
+ . field ( "access_qualifier" , & access_qualifier)
746
756
. finish ( ) ,
747
757
SpirvType :: Sampler => f. write_str ( "Sampler" ) ,
748
758
SpirvType :: SampledImage { image_type } => f
0 commit comments