[glsl-in] Respect user defined interpolation

This commit is contained in:
João Capucho authored and Dzmitry Malyshau committed 2021-08-04 12:39:36 -04:00
1 parent 6f21004369
commit ec0d97d961
1 file changed
+6 -6
+6 -6
View File
@@ -419,12 +419,12 @@ impl Program {
if let Some(location) = location {
let input = storage == StorageQualifier::Input;
let interpolation = self.module.types[ty].inner.scalar_kind().map(|kind| {
if let ScalarKind::Float = kind {
Interpolation::Perspective
} else {
Interpolation::Flat
}
let interpolation = interpolation.or_else(|| {
let kind = self.module.types[ty].inner.scalar_kind()?;
Some(match kind {
ScalarKind::Float => Interpolation::Perspective,
_ => Interpolation::Flat,
})
});
let handle = self.module.global_variables.append(GlobalVariable {