Gate @interpolate(linear) behind a downlevel flag (#9972)

This commit is contained in:
Emil Ernerfeldt authored and GitHub committed 2026-08-16 12:11:15 +00:00
1 parent b6db26411c
commit a6caee7084
16 files changed
+132 -7

No files matched your search

+7 -2
View File
@@ -785,12 +785,17 @@ impl VaryingContext<'_> {
// qualifiers, so we won't complain about that here.
let _ = sampling;
let required = match sampling {
let mut required = match sampling {
Some(crate::Sampling::Sample) => Capabilities::MULTISAMPLED_SHADING,
_ => Capabilities::empty(),
};
if interpolation == Some(crate::Interpolation::Linear) {
required |= Capabilities::LINEAR_INTERPOLATION;
}
if !self.capabilities.contains(required) {
return Err(VaryingError::UnsupportedCapability(required));
return Err(VaryingError::UnsupportedCapability(
required - self.capabilities,
));
}
if interpolation != Some(crate::Interpolation::PerVertex) {
+6
View File
@@ -218,6 +218,12 @@ bitflags::bitflags! {
const MEMORY_DECORATION_VOLATILE = 1 << 42;
/// Support for 16-bit integer types.
const SHADER_INT16 = 1 << 43;
/// Support for [`Interpolation::Linear`] (`@interpolate(linear)` in WGSL).
///
/// This is core WebGPU, but GLSL ES (and thus WebGL) has no `noperspective` qualifier (unless enabled by extensions).
///
/// [`Interpolation::Linear`]: crate::Interpolation::Linear
const LINEAR_INTERPOLATION = 1 << 44;
}
}