Permit interpolation qualifiers on both vertex outputs and fragment inputs.

This commit is contained in:
Jim Blandy authored and Dzmitry Malyshau committed 2021-04-15 17:19:20 -04:00
1 parent 7fda34c4fd
commit 576723960e
1 file changed
+5 -2
+5 -2
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);
}