Implement clip-distances extension for GL and Vulkan backends (#7730)

* Basic implementation of `clip_distances` for Vulkan and GL backends

* Added GPU test for `clip-distances`

* Update feature array size

* Add changelog entry

* Validate `clip_distances` array size

* Check for `clip_distances` enable directive

* Consolidate code for generating `enable` directives in WGSL backend and add `clip_distances`.
This commit is contained in:
Dmitry Zamkov
2025-06-16 03:33:31 -05:00
committed by GitHub
parent 486a77d682
commit bbb7cc79ef
27 changed files with 518 additions and 86 deletions

View File

@@ -59,6 +59,9 @@ mod webgpu_impl {
#[doc(hidden)]
pub const WEBGPU_FEATURE_DUAL_SOURCE_BLENDING: u64 = 1 << 13;
#[doc(hidden)]
pub const WEBGPU_FEATURE_CLIP_DISTANCES: u64 = 1 << 14;
}
macro_rules! bitflags_array_impl {
@@ -1463,7 +1466,18 @@ bitflags_array! {
/// - Metal (with MSL 1.2+)
/// - Vulkan (with dualSrcBlend)
/// - DX12
///
/// This is a web and native feature.
const DUAL_SOURCE_BLENDING = WEBGPU_FEATURE_DUAL_SOURCE_BLENDING;
/// Allows the use of `@builtin(clip_distances)` in WGSL.
///
/// Supported platforms:
/// - Vulkan (mainly on Desktop GPUs)
/// - GL (Desktop or `GL_EXT_clip_cull_distance`)
///
/// This is a web and native feature.
const CLIP_DISTANCES = WEBGPU_FEATURE_CLIP_DISTANCES;
}
}