@@ -35,7 +35,7 @@ impl crate::Adapter for super::Adapter {
35
35
. shared
36
36
. device
37
37
. lock ( )
38
- . new_command_queue_with_max_command_buffer_count ( MAX_COMMAND_BUFFERS )
38
+ . newCommandQueueWithMaxCommandBufferCount ( MAX_COMMAND_BUFFERS )
39
39
. unwrap ( ) ;
40
40
41
41
// Acquiring the meaning of timestamp ticks is hard with Metal!
@@ -519,7 +519,7 @@ impl super::PrivateCapabilities {
519
519
features_sets
520
520
. iter ( )
521
521
. cloned ( )
522
- . any ( |x| raw. supports_feature_set ( x) )
522
+ . any ( |x| raw. supportsFeatureSet ( x) )
523
523
}
524
524
525
525
pub fn new ( device : & ProtocolObject < dyn MTLDevice > ) -> Self {
@@ -553,27 +553,27 @@ impl super::PrivateCapabilities {
553
553
554
554
let version = NSProcessInfo :: processInfo ( ) . operatingSystemVersion ( ) ;
555
555
556
- let os_is_mac = device. supports_feature_set ( MTLFeatureSet :: macOS_GPUFamily1_v1) ;
556
+ let os_is_mac = device. supportsFeatureSet ( MTLFeatureSet :: macOS_GPUFamily1_v1) ;
557
557
// Metal was first introduced in OS X 10.11 and iOS 8. The current version number of visionOS is 1.0.0. Additionally,
558
558
// on the Simulator, Apple only provides the Apple2 GPU capability, and the Apple2+ GPU capability covers the capabilities of Apple2.
559
559
// Therefore, the following conditions can be used to determine if it is visionOS.
560
560
// https://developer.apple.com/documentation/metal/developing_metal_apps_that_run_in_simulator
561
- let os_is_xr = version. majorVersion < 8 && device. supports_family ( MTLGPUFamily :: Apple2 ) ;
561
+ let os_is_xr = version. majorVersion < 8 && device. supportsFamily ( MTLGPUFamily :: Apple2 ) ;
562
562
let family_check = os_is_xr || version. at_least ( ( 10 , 15 ) , ( 13 , 0 ) , os_is_mac) ;
563
563
564
564
let mut sample_count_mask = crate :: TextureFormatCapabilities :: MULTISAMPLE_X4 ; // 1 and 4 samples are supported on all devices
565
- if device. supports_texture_sample_count ( 2 ) {
565
+ if device. supportsTextureSampleCount ( 2 ) {
566
566
sample_count_mask |= crate :: TextureFormatCapabilities :: MULTISAMPLE_X2 ;
567
567
}
568
- if device. supports_texture_sample_count ( 8 ) {
568
+ if device. supportsTextureSampleCount ( 8 ) {
569
569
sample_count_mask |= crate :: TextureFormatCapabilities :: MULTISAMPLE_X8 ;
570
570
}
571
- if device. supports_texture_sample_count ( 16 ) {
571
+ if device. supportsTextureSampleCount ( 16 ) {
572
572
sample_count_mask |= crate :: TextureFormatCapabilities :: MULTISAMPLE_X16 ;
573
573
}
574
574
575
575
let rw_texture_tier = if version. at_least ( ( 10 , 13 ) , ( 11 , 0 ) , os_is_mac) {
576
- device. read_write_texture_support ( )
576
+ device. readWriteTextureSupport ( )
577
577
} else if version. at_least ( ( 10 , 12 ) , OS_NOT_SUPPORT , os_is_mac) {
578
578
if Self :: supports_any ( device, & [ MTLFeatureSet :: macOS_ReadWriteTextureTier2] ) {
579
579
MTLReadWriteTextureTier :: Tier2
@@ -586,18 +586,18 @@ impl super::PrivateCapabilities {
586
586
587
587
let mut timestamp_query_support = TimestampQuerySupport :: empty ( ) ;
588
588
if version. at_least ( ( 11 , 0 ) , ( 14 , 0 ) , os_is_mac)
589
- && device. supports_counter_sampling ( MTLCounterSamplingPoint :: AtStageBoundary )
589
+ && device. supportsCounterSampling ( MTLCounterSamplingPoint :: AtStageBoundary )
590
590
{
591
591
// If we don't support at stage boundary, don't support anything else.
592
592
timestamp_query_support. insert ( TimestampQuerySupport :: STAGE_BOUNDARIES ) ;
593
593
594
- if device. supports_counter_sampling ( MTLCounterSamplingPoint :: AtDrawBoundary ) {
594
+ if device. supportsCounterSampling ( MTLCounterSamplingPoint :: AtDrawBoundary ) {
595
595
timestamp_query_support. insert ( TimestampQuerySupport :: ON_RENDER_ENCODER ) ;
596
596
}
597
- if device. supports_counter_sampling ( MTLCounterSamplingPoint :: AtDispatchBoundary ) {
597
+ if device. supportsCounterSampling ( MTLCounterSamplingPoint :: AtDispatchBoundary ) {
598
598
timestamp_query_support. insert ( TimestampQuerySupport :: ON_COMPUTE_ENCODER ) ;
599
599
}
600
- if device. supports_counter_sampling ( MTLCounterSamplingPoint :: AtBlitBoundary ) {
600
+ if device. supportsCounterSampling ( MTLCounterSamplingPoint :: AtBlitBoundary ) {
601
601
timestamp_query_support. insert ( TimestampQuerySupport :: ON_BLIT_ENCODER ) ;
602
602
}
603
603
// `TimestampQuerySupport::INSIDE_WGPU_PASSES` emerges from the other flags.
@@ -631,13 +631,13 @@ impl super::PrivateCapabilities {
631
631
read_write_texture_tier : rw_texture_tier,
632
632
msaa_desktop : os_is_mac,
633
633
msaa_apple3 : if family_check {
634
- device. supports_family ( MTLGPUFamily :: Apple3 )
634
+ device. supportsFamily ( MTLGPUFamily :: Apple3 )
635
635
} else {
636
- device. supports_feature_set ( MTLFeatureSet :: iOS_GPUFamily3_v4)
636
+ device. supportsFeatureSet ( MTLFeatureSet :: iOS_GPUFamily3_v4)
637
637
} ,
638
- msaa_apple7 : family_check && device. supports_family ( MTLGPUFamily :: Apple7 ) ,
638
+ msaa_apple7 : family_check && device. supportsFamily ( MTLGPUFamily :: Apple7 ) ,
639
639
resource_heaps : Self :: supports_any ( device, RESOURCE_HEAP_SUPPORT ) ,
640
- argument_buffers : device. argument_buffers_support ( ) ,
640
+ argument_buffers : device. argumentBuffersSupport ( ) ,
641
641
shared_textures : !os_is_mac,
642
642
mutable_comparison_samplers : Self :: supports_any (
643
643
device,
@@ -650,30 +650,29 @@ impl super::PrivateCapabilities {
650
650
BASE_VERTEX_FIRST_INSTANCE_SUPPORT ,
651
651
) ,
652
652
dual_source_blending : Self :: supports_any ( device, DUAL_SOURCE_BLEND_SUPPORT ) ,
653
- low_power : !os_is_mac || device. is_low_power ( ) ,
654
- headless : os_is_mac && device. is_headless ( ) ,
653
+ low_power : !os_is_mac || device. isLowPower ( ) ,
654
+ headless : os_is_mac && device. isHeadless ( ) ,
655
655
layered_rendering : Self :: supports_any ( device, LAYERED_RENDERING_SUPPORT ) ,
656
656
function_specialization : Self :: supports_any ( device, FUNCTION_SPECIALIZATION_SUPPORT ) ,
657
657
depth_clip_mode : Self :: supports_any ( device, DEPTH_CLIP_MODE ) ,
658
658
texture_cube_array : Self :: supports_any ( device, TEXTURE_CUBE_ARRAY_SUPPORT ) ,
659
659
supports_float_filtering : os_is_mac
660
660
|| ( version. at_least ( ( 11 , 0 ) , ( 14 , 0 ) , os_is_mac)
661
- && device. supports32_bit_float_filtering ( ) ) ,
662
- format_depth24_stencil8 : os_is_mac
663
- && device. is_depth24_stencil8_pixel_format_supported ( ) ,
661
+ && device. supports32BitFloatFiltering ( ) ) ,
662
+ format_depth24_stencil8 : os_is_mac && device. isDepth24Stencil8PixelFormatSupported ( ) ,
664
663
format_depth32_stencil8_filter : os_is_mac,
665
664
format_depth32_stencil8_none : !os_is_mac,
666
665
format_min_srgb_channels : if os_is_mac { 4 } else { 1 } ,
667
666
format_b5 : !os_is_mac,
668
667
format_bc : os_is_mac,
669
668
format_eac_etc : !os_is_mac
670
669
// M1 in macOS supports EAC/ETC2
671
- || ( family_check && device. supports_family ( MTLGPUFamily :: Apple7 ) ) ,
670
+ || ( family_check && device. supportsFamily ( MTLGPUFamily :: Apple7 ) ) ,
672
671
// A8(Apple2) and later always support ASTC pixel formats
673
- format_astc : ( family_check && device. supports_family ( MTLGPUFamily :: Apple2 ) )
672
+ format_astc : ( family_check && device. supportsFamily ( MTLGPUFamily :: Apple2 ) )
674
673
|| Self :: supports_any ( device, ASTC_PIXEL_FORMAT_FEATURES ) ,
675
674
// A13(Apple6) M1(Apple7) and later always support HDR ASTC pixel formats
676
- format_astc_hdr : family_check && device. supports_family ( MTLGPUFamily :: Apple6 ) ,
675
+ format_astc_hdr : family_check && device. supportsFamily ( MTLGPUFamily :: Apple6 ) ,
677
676
format_any8_unorm_srgb_all : Self :: supports_any ( device, ANY8_UNORM_SRGB_ALL ) ,
678
677
format_any8_unorm_srgb_no_write : !Self :: supports_any ( device, ANY8_UNORM_SRGB_ALL )
679
678
&& !os_is_mac,
@@ -728,10 +727,10 @@ impl super::PrivateCapabilities {
728
727
max_buffers_per_stage : 31 ,
729
728
max_vertex_buffers : 31 . min ( crate :: MAX_VERTEX_BUFFERS as u32 ) ,
730
729
max_textures_per_stage : if os_is_mac
731
- || ( family_check && device. supports_family ( MTLGPUFamily :: Apple6 ) )
730
+ || ( family_check && device. supportsFamily ( MTLGPUFamily :: Apple6 ) )
732
731
{
733
732
128
734
- } else if family_check && device. supports_family ( MTLGPUFamily :: Apple4 ) {
733
+ } else if family_check && device. supportsFamily ( MTLGPUFamily :: Apple4 ) {
735
734
96
736
735
} else {
737
736
31
@@ -740,7 +739,7 @@ impl super::PrivateCapabilities {
740
739
buffer_alignment : if os_is_mac || os_is_xr { 256 } else { 64 } ,
741
740
max_buffer_size : if version. at_least ( ( 10 , 14 ) , ( 12 , 0 ) , os_is_mac) {
742
741
// maxBufferLength available on macOS 10.14+ and iOS 12.0+
743
- device. max_buffer_length ( ) as u64
742
+ device. maxBufferLength ( ) as u64
744
743
} else if os_is_mac {
745
744
1 << 30 // 1GB on macOS 10.11 and up
746
745
} else {
@@ -761,7 +760,7 @@ impl super::PrivateCapabilities {
761
760
max_texture_3d_size : 2048 ,
762
761
max_texture_layers : 2048 ,
763
762
max_fragment_input_components : if os_is_mac
764
- || device. supports_feature_set ( MTLFeatureSet :: iOS_GPUFamily4_v1)
763
+ || device. supportsFeatureSet ( MTLFeatureSet :: iOS_GPUFamily4_v1)
765
764
{
766
765
124
767
766
} else {
@@ -781,14 +780,13 @@ impl super::PrivateCapabilities {
781
780
} ,
782
781
// Per https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
783
782
max_color_attachment_bytes_per_sample : if family_check
784
- && device. supports_family ( MTLGPUFamily :: Apple4 )
783
+ && device. supportsFamily ( MTLGPUFamily :: Apple4 )
785
784
{
786
785
64
787
786
} else {
788
787
32
789
788
} ,
790
- max_varying_components : if device
791
- . supports_feature_set ( MTLFeatureSet :: macOS_GPUFamily1_v1)
789
+ max_varying_components : if device. supportsFeatureSet ( MTLFeatureSet :: macOS_GPUFamily1_v1)
792
790
{
793
791
124
794
792
} else {
@@ -826,8 +824,8 @@ impl super::PrivateCapabilities {
826
824
] ,
827
825
) ,
828
826
supports_binary_archives : family_check
829
- && ( device. supports_family ( MTLGPUFamily :: Apple3 )
830
- || device. supports_family ( MTLGPUFamily :: Mac1 ) ) ,
827
+ && ( device. supportsFamily ( MTLGPUFamily :: Apple3 )
828
+ || device. supportsFamily ( MTLGPUFamily :: Mac1 ) ) ,
831
829
supports_capture_manager : version. at_least ( ( 10 , 13 ) , ( 11 , 0 ) , os_is_mac) ,
832
830
can_set_maximum_drawables_count : version. at_least ( ( 10 , 14 ) , ( 11 , 2 ) , os_is_mac) ,
833
831
can_set_display_sync : version. at_least ( ( 10 , 13 ) , OS_NOT_SUPPORT , os_is_mac) ,
@@ -841,39 +839,39 @@ impl super::PrivateCapabilities {
841
839
] ,
842
840
) ,
843
841
supports_arrays_of_textures_write : family_check
844
- && ( device. supports_family ( MTLGPUFamily :: Apple6 )
845
- || device. supports_family ( MTLGPUFamily :: Mac1 )
846
- || device. supports_family ( MTLGPUFamily :: MacCatalyst1 ) ) ,
842
+ && ( device. supportsFamily ( MTLGPUFamily :: Apple6 )
843
+ || device. supportsFamily ( MTLGPUFamily :: Mac1 )
844
+ || device. supportsFamily ( MTLGPUFamily :: MacCatalyst1 ) ) ,
847
845
supports_mutability : version. at_least ( ( 10 , 13 ) , ( 11 , 0 ) , os_is_mac) ,
848
846
//Depth clipping is supported on all macOS GPU families and iOS family 4 and later
849
847
supports_depth_clip_control : os_is_mac
850
- || device. supports_feature_set ( MTLFeatureSet :: iOS_GPUFamily4_v1) ,
848
+ || device. supportsFeatureSet ( MTLFeatureSet :: iOS_GPUFamily4_v1) ,
851
849
supports_preserve_invariance : version. at_least ( ( 11 , 0 ) , ( 13 , 0 ) , os_is_mac) ,
852
850
// Metal 2.2 on mac, 2.3 on iOS.
853
851
supports_shader_primitive_index : version. at_least ( ( 10 , 15 ) , ( 14 , 0 ) , os_is_mac) ,
854
852
has_unified_memory : if version. at_least ( ( 10 , 15 ) , ( 13 , 0 ) , os_is_mac) {
855
- Some ( device. has_unified_memory ( ) )
853
+ Some ( device. hasUnifiedMemory ( ) )
856
854
} else {
857
855
None
858
856
} ,
859
857
timestamp_query_support,
860
858
supports_simd_scoped_operations : family_check
861
- && ( device. supports_family ( MTLGPUFamily :: Metal3 )
862
- || device. supports_family ( MTLGPUFamily :: Mac2 )
863
- || device. supports_family ( MTLGPUFamily :: Apple7 ) ) ,
859
+ && ( device. supportsFamily ( MTLGPUFamily :: Metal3 )
860
+ || device. supportsFamily ( MTLGPUFamily :: Mac2 )
861
+ || device. supportsFamily ( MTLGPUFamily :: Apple7 ) ) ,
864
862
// https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf#page=5
865
863
int64 : family_check
866
- && ( device. supports_family ( MTLGPUFamily :: Apple3 )
867
- || device. supports_family ( MTLGPUFamily :: Metal3 ) ) ,
864
+ && ( device. supportsFamily ( MTLGPUFamily :: Apple3 )
865
+ || device. supportsFamily ( MTLGPUFamily :: Metal3 ) ) ,
868
866
// https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf#page=6
869
867
int64_atomics : family_check
870
- && ( ( device. supports_family ( MTLGPUFamily :: Apple8 )
871
- && device. supports_family ( MTLGPUFamily :: Mac2 ) )
872
- || device. supports_family ( MTLGPUFamily :: Apple9 ) ) ,
868
+ && ( ( device. supportsFamily ( MTLGPUFamily :: Apple8 )
869
+ && device. supportsFamily ( MTLGPUFamily :: Mac2 ) )
870
+ || device. supportsFamily ( MTLGPUFamily :: Apple9 ) ) ,
873
871
// https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf#page=6
874
872
float_atomics : family_check
875
- && ( device. supports_family ( MTLGPUFamily :: Apple7 )
876
- || device. supports_family ( MTLGPUFamily :: Mac2 ) ) ,
873
+ && ( device. supportsFamily ( MTLGPUFamily :: Apple7 )
874
+ || device. supportsFamily ( MTLGPUFamily :: Mac2 ) ) ,
877
875
supports_shared_event : version. at_least ( ( 10 , 14 ) , ( 12 , 0 ) , os_is_mac) ,
878
876
}
879
877
}
@@ -1235,7 +1233,7 @@ impl super::PrivateDisabilities {
1235
1233
let is_intel = device. name ( ) . to_string ( ) . starts_with ( "Intel" ) ;
1236
1234
Self {
1237
1235
broken_viewport_near_depth : is_intel
1238
- && !device. supports_feature_set ( MTLFeatureSet :: macOS_GPUFamily1_v4) ,
1236
+ && !device. supportsFeatureSet ( MTLFeatureSet :: macOS_GPUFamily1_v4) ,
1239
1237
broken_layered_clear_image : is_intel,
1240
1238
}
1241
1239
}
0 commit comments