mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +01:00
[spv-out] deduplicate sampler types
This commit is contained in:
1 parent
7ec90512a8
commit
28cba79452
1 file changed
+4
-2
@@ -131,6 +131,7 @@ enum LocalType {
|
||||
SampledImage {
|
||||
image_type_id: Word,
|
||||
},
|
||||
Sampler,
|
||||
}
|
||||
|
||||
impl PhysicalLayout {
|
||||
@@ -181,6 +182,7 @@ impl PhysicalLayout {
|
||||
arrayed,
|
||||
class,
|
||||
},
|
||||
crate::TypeInner::Sampler { comparison: _ } => LocalType::Sampler,
|
||||
_ => return None,
|
||||
})
|
||||
}
|
||||
@@ -777,8 +779,8 @@ impl Writer {
|
||||
)?;
|
||||
Instruction::type_pointer(id, class, type_id)
|
||||
}
|
||||
// all the image types go through `write_type_declaration_arena`
|
||||
LocalType::Image { .. } => unreachable!(),
|
||||
// all the samplers and image types go through `write_type_declaration_arena`
|
||||
LocalType::Image { .. } | LocalType::Sampler => unreachable!(),
|
||||
LocalType::SampledImage { image_type_id } => {
|
||||
Instruction::type_sampled_image(id, image_type_id)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user