mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-30 10:03:58 +01:00
Gate @interpolate(linear) behind a downlevel flag (#9972)
This commit is contained in:
1 parent
b6db26411c
commit
a6caee7084
16 files changed
+132
-7
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user