mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-01-10 11:28:29 -05:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user