mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-23 16:01:04 +01:00
Enable FLOAT32_BLENDABLE on Metal, in Deno, and separate from filtering (#9032)
--------- Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
This commit is contained in:
1 parent
b42b565b20
commit
3dfa9af0db
4 files changed
+9
-11
No files matched your search
+1
-1
@@ -57,7 +57,7 @@ By @cwfitzgerald in [#8999](https://github.com/gfx-rs/wgpu/pull/8999).
|
||||
- Added support for no-perspective barycentric coordinates. By @atlv24 in [#8852](https://github.com/gfx-rs/wgpu/issues/8852).
|
||||
- Added support for obtaining `AdapterInfo` from `Device`. By @sagudev in [#8807](https://github.com/gfx-rs/wgpu/pull/8807).
|
||||
- Added `Limits::or_worse_values_from`. By @atlv24 in [#8870](https://github.com/gfx-rs/wgpu/pull/8870).
|
||||
- Added `Features::FLOAT32_BLENDABLE`. By @timokoesters in [#8963](https://github.com/gfx-rs/wgpu/pull/8963).
|
||||
- Added `Features::FLOAT32_BLENDABLE` on Vulkan and Metal. By @timokoesters in [#8963](https://github.com/gfx-rs/wgpu/pull/8963) and @andyleiserson in [#9032](https://github.com/gfx-rs/wgpu/pull/9032).
|
||||
- Made the following available in `const` contexts:
|
||||
- `naga`
|
||||
- `Arena::len`
|
||||
|
||||
@@ -394,6 +394,8 @@ pub enum GPUFeatureName {
|
||||
Bgra8unormStorage,
|
||||
#[webidl(rename = "float32-filterable")]
|
||||
Float32Filterable,
|
||||
#[webidl(rename = "float32-blendable")]
|
||||
Float32Blendable,
|
||||
#[webidl(rename = "dual-source-blending")]
|
||||
DualSourceBlending,
|
||||
#[webidl(rename = "subgroups")]
|
||||
@@ -489,6 +491,7 @@ pub fn feature_names_to_features(
|
||||
GPUFeatureName::Rg11b10ufloatRenderable => Features::RG11B10UFLOAT_RENDERABLE,
|
||||
GPUFeatureName::Bgra8unormStorage => Features::BGRA8UNORM_STORAGE,
|
||||
GPUFeatureName::Float32Filterable => Features::FLOAT32_FILTERABLE,
|
||||
GPUFeatureName::Float32Blendable => Features::FLOAT32_BLENDABLE,
|
||||
GPUFeatureName::DualSourceBlending => Features::DUAL_SOURCE_BLENDING,
|
||||
GPUFeatureName::Subgroups => Features::SUBGROUP,
|
||||
GPUFeatureName::ExternalTexture => Features::EXTERNAL_TEXTURE,
|
||||
@@ -578,6 +581,9 @@ pub fn features_to_feature_names(
|
||||
if features.contains(wgpu_types::Features::FLOAT32_FILTERABLE) {
|
||||
return_features.insert(Float32Filterable);
|
||||
}
|
||||
if features.contains(wgpu_types::Features::FLOAT32_BLENDABLE) {
|
||||
return_features.insert(Float32Blendable);
|
||||
}
|
||||
if features.contains(wgpu_types::Features::DUAL_SOURCE_BLENDING) {
|
||||
return_features.insert(DualSourceBlending);
|
||||
}
|
||||
|
||||
@@ -4088,16 +4088,7 @@ impl Device {
|
||||
cs.format,
|
||||
));
|
||||
}
|
||||
let blendable = format_features.flags.contains(Tfff::BLENDABLE);
|
||||
let filterable = format_features.flags.contains(Tfff::FILTERABLE);
|
||||
let adapter_specific = self
|
||||
.features
|
||||
.contains(wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES);
|
||||
// according to WebGPU specifications the texture needs to be
|
||||
// [`TextureFormatFeatureFlags::FILTERABLE`] if blending is set - use
|
||||
// [`Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES`] to elude
|
||||
// this limitation
|
||||
if cs.blend.is_some() && (!blendable || (!filterable && !adapter_specific)) {
|
||||
if cs.blend.is_some() && !format_features.flags.contains(Tfff::BLENDABLE) {
|
||||
break 'error Some(pipeline::ColorStateError::FormatNotBlendable(
|
||||
cs.format,
|
||||
));
|
||||
|
||||
@@ -1020,6 +1020,7 @@ impl super::PrivateCapabilities {
|
||||
| F::EXTERNAL_TEXTURE;
|
||||
|
||||
features.set(F::FLOAT32_FILTERABLE, self.supports_float_filtering);
|
||||
features.set(F::FLOAT32_BLENDABLE, true);
|
||||
features.set(F::INDIRECT_FIRST_INSTANCE, self.indirect_draw_dispatch);
|
||||
features.set(
|
||||
F::TIMESTAMP_QUERY | F::TIMESTAMP_QUERY_INSIDE_ENCODERS,
|
||||
|
||||
Reference in new issue
Block a user