File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed
Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -366,13 +366,10 @@ pub fn map_resource_usage(ty: &wgt::BindingType) -> MTLResourceUsage {
366366 } ,
367367 wgt:: BindingType :: Sampler ( ..) => MTLResourceUsage :: empty ( ) ,
368368 wgt:: BindingType :: Buffer { ty, .. } => match ty {
369- wgt:: BufferBindingType :: Uniform => MTLResourceUsage :: Read ,
370- wgt:: BufferBindingType :: Storage { read_only } => {
371- if * read_only {
372- MTLResourceUsage :: Read
373- } else {
374- MTLResourceUsage :: Read | MTLResourceUsage :: Write
375- }
369+ wgt:: BufferBindingType :: Uniform
370+ | wgt:: BufferBindingType :: Storage { read_only : true } => MTLResourceUsage :: Read ,
371+ wgt:: BufferBindingType :: Storage { read_only : false } => {
372+ MTLResourceUsage :: Read | MTLResourceUsage :: Write
376373 }
377374 } ,
378375 _ => unreachable ! ( ) ,
@@ -381,14 +378,10 @@ pub fn map_resource_usage(ty: &wgt::BindingType) -> MTLResourceUsage {
381378
382379pub fn map_binding_access ( ty : & wgt:: BufferBindingType ) -> MTLBindingAccess {
383380 match ty {
384- wgt:: BufferBindingType :: Uniform => MTLBindingAccess :: ReadOnly ,
385- wgt:: BufferBindingType :: Storage { read_only } => {
386- if * read_only {
387- MTLBindingAccess :: ReadOnly
388- } else {
389- MTLBindingAccess :: ReadWrite
390- }
381+ wgt:: BufferBindingType :: Uniform | wgt:: BufferBindingType :: Storage { read_only : true } => {
382+ MTLBindingAccess :: ReadOnly
391383 }
384+ wgt:: BufferBindingType :: Storage { read_only : false } => MTLBindingAccess :: ReadWrite ,
392385 }
393386}
394387
Original file line number Diff line number Diff line change @@ -994,7 +994,7 @@ impl crate::Device for super::Device {
994994 conv:: map_binding_access ( & ty) ,
995995 ) ;
996996
997- // Argument encoder reports the required size and alignment
997+ // Argument encoder reports the required size and alignment
998998 // of the pointer-array buffer.
999999 let encoder = device
10001000 . newArgumentEncoderWithArguments ( & NSArray :: from_retained_slice (
You can’t perform that action at this time.
0 commit comments