mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
refactor(glsl-out): hoist new if let TypeInner::Struct
out of varying_required_features
(#6230)
This commit is contained in:
parent
f842d80f52
commit
f2faf609af
@ -557,28 +557,19 @@ impl<'a, W> Writer<'a, W> {
|
||||
}
|
||||
|
||||
fn varying_required_features(&mut self, binding: Option<&Binding>, ty: Handle<Type>) {
|
||||
match self.module.types[ty].inner {
|
||||
TypeInner::Struct { ref members, .. } => {
|
||||
if let TypeInner::Struct { ref members, .. } = self.module.types[ty].inner {
|
||||
for member in members {
|
||||
self.varying_required_features(member.binding.as_ref(), member.ty);
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
if let Some(binding) = binding {
|
||||
} else if let Some(binding) = binding {
|
||||
match *binding {
|
||||
Binding::BuiltIn(built_in) => match built_in {
|
||||
crate::BuiltIn::ClipDistance => {
|
||||
self.features.request(Features::CLIP_DISTANCE)
|
||||
}
|
||||
crate::BuiltIn::CullDistance => {
|
||||
self.features.request(Features::CULL_DISTANCE)
|
||||
}
|
||||
crate::BuiltIn::ClipDistance => self.features.request(Features::CLIP_DISTANCE),
|
||||
crate::BuiltIn::CullDistance => self.features.request(Features::CULL_DISTANCE),
|
||||
crate::BuiltIn::SampleIndex => {
|
||||
self.features.request(Features::SAMPLE_VARIABLES)
|
||||
}
|
||||
crate::BuiltIn::ViewIndex => {
|
||||
self.features.request(Features::MULTI_VIEW)
|
||||
}
|
||||
crate::BuiltIn::ViewIndex => self.features.request(Features::MULTI_VIEW),
|
||||
crate::BuiltIn::InstanceIndex | crate::BuiltIn::DrawID => {
|
||||
self.features.request(Features::INSTANCE_INDEX)
|
||||
}
|
||||
@ -604,5 +595,3 @@ impl<'a, W> Writer<'a, W> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user