File tree Expand file tree Collapse file tree 5 files changed +36
-2
lines changed
Expand file tree Collapse file tree 5 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ Bottom level categories:
4242
4343## Unreleased
4444
45+ ### Added/New Features
46+
47+ #### Metal
48+
49+ - Unconditionally enable ` Features::CLIP_DISTANCES ` . By @ErichDonGubler in [ #9270 ] ( https://github.com/gfx-rs/wgpu/pull/9270 ) .
50+
4551### Changes
4652
4753#### General
Original file line number Diff line number Diff line change @@ -841,7 +841,7 @@ pub fn supported_capabilities() -> crate::valid::Capabilities {
841841 // No BUFFER_BINDING_ARRAY
842842 | Caps :: STORAGE_TEXTURE_BINDING_ARRAY
843843 | Caps :: STORAGE_BUFFER_BINDING_ARRAY
844- | Caps :: CLIP_DISTANCES // CLIP_DISTANCES isn't supported by metal backend? But is supported by MSL writer
844+ | Caps :: CLIP_DISTANCES
845845 // No CULL_DISTANCE
846846 | Caps :: STORAGE_TEXTURE_16BIT_NORM_FORMATS
847847 | Caps :: MULTIVIEW
Original file line number Diff line number Diff line change 11capabilities = " CLIP_DISTANCES"
2- targets = " SPIRV | GLSL | WGSL"
2+ targets = " SPIRV | GLSL | WGSL | METAL "
33
44[glsl ]
55version.Desktop = 330
Original file line number Diff line number Diff line change 1+ // language: metal1.0
2+ #include < metal_stdlib>
3+ #include < simd/simd.h>
4+
5+ using metal::uint;
6+
7+ struct type_2 {
8+ float inner[1 ];
9+ };
10+ struct VertexOutput {
11+ metal::float4 position;
12+ type_2 clip_distances;
13+ char _pad2[12 ];
14+ };
15+
16+ struct main_Output {
17+ metal::float4 position [[position]];
18+ float clip_distances [[clip_distance]] [1 ];
19+ };
20+ vertex main_Output main_ (
21+ ) {
22+ VertexOutput out = {};
23+ out.clip_distances .inner [0 ] = 0.5 ;
24+ VertexOutput _e4 = out;
25+ const auto _tmp = _e4;
26+ return main_Output { _tmp.position , {_tmp.clip_distances .inner [0 ]} };
27+ }
Original file line number Diff line number Diff line change @@ -1094,6 +1094,7 @@ impl super::CapabilitiesQuery {
10941094 self . timestamp_query_support
10951095 . contains ( TimestampQuerySupport :: INSIDE_WGPU_PASSES ) ,
10961096 ) ;
1097+ features. set ( F :: CLIP_DISTANCES , true ) ;
10971098 features. set (
10981099 F :: DUAL_SOURCE_BLENDING ,
10991100 self . msl_version >= MTLLanguageVersion :: Version1_2 && self . dual_source_blending ,
You can’t perform that action at this time.
0 commit comments