Permit interpolation qualifiers on both vertex outputs and fragment inputs.

This commit is contained in:
Jim Blandy
2021-04-15 12:14:48 -07:00
committed by Dzmitry Malyshau
parent 7fda34c4fd
commit 576723960e

View File

@@ -210,8 +210,11 @@ impl VaryingContext<'_> {
if !self.location_mask.insert(location as usize) {
return Err(VaryingError::BindingCollision { location });
}
let needs_interpolation =
self.stage == crate::ShaderStage::Fragment && !self.output;
let needs_interpolation = match self.stage {
crate::ShaderStage::Vertex => self.output,
crate::ShaderStage::Fragment => !self.output,
_ => false,
};
if !needs_interpolation && interpolation.is_some() {
return Err(VaryingError::InvalidInterpolation);
}