Skip to content

Commit

Permalink
Support feature detection on mac/metal for extended blending
Browse files Browse the repository at this point in the history
  • Loading branch information
freqmod committed Aug 3, 2023
1 parent e1239fa commit d20945d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wgpu-hal/src/metal/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,9 +773,10 @@ impl super::PrivateCapabilities {
} else {
None
},
support_timestamp_query: version.at_least((11, 0), (14, 0), os_is_mac)
support_timestamp_query: version.at_least((12, 0), (11, 0), os_is_mac)
&& device
.supports_counter_sampling(metal::MTLCounterSamplingPoint::AtStageBoundary),
blend_func_extended: version.at_least((11, 0), (14, 0), os_is_mac),
support_timestamp_query_in_passes: version.at_least((11, 0), (14, 0), os_is_mac)
&& device.supports_counter_sampling(metal::MTLCounterSamplingPoint::AtDrawBoundary)
&& device
Expand Down Expand Up @@ -807,6 +808,7 @@ impl super::PrivateCapabilities {
| F::DEPTH32FLOAT_STENCIL8
| F::MULTI_DRAW_INDIRECT;

features.set(F::BLEND_FUNC_EXTENDED , self.blend_func_extended);
features.set(F::TIMESTAMP_QUERY, self.support_timestamp_query);
// TODO: Not yet implemented.
// features.set(
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/metal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ struct PrivateCapabilities {
has_unified_memory: Option<bool>,
support_timestamp_query: bool,
support_timestamp_query_in_passes: bool,
blend_func_extended: bool,
}

#[derive(Clone, Debug)]
Expand Down

0 comments on commit d20945d

Please sign in to comment.