From 0c5db60d69c35387ccd8a2eba4b19b197ac5209a Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Fri, 29 Jan 2021 13:06:46 -0500 Subject: [PATCH] [spv] fix depth sampler type --- src/back/spv/instructions.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/back/spv/instructions.rs b/src/back/spv/instructions.rs index 7984bbc3e8..8aa98e70d5 100644 --- a/src/back/spv/instructions.rs +++ b/src/back/spv/instructions.rs @@ -217,19 +217,15 @@ pub(super) fn instruction_type_image( instruction.add_operand(sampled_type_id); instruction.add_operand(dim as u32); - instruction.add_operand(match image_class { - crate::ImageClass::Depth => 1, - _ => 0, - }); + let (depth, multi, sampled) = match image_class { + crate::ImageClass::Sampled { kind: _, multi } => (false, multi, true), + crate::ImageClass::Depth => (true, false, true), + crate::ImageClass::Storage(_) => (false, false, false), + }; + instruction.add_operand(depth as u32); instruction.add_operand(arrayed as u32); - instruction.add_operand(match image_class { - crate::ImageClass::Sampled { multi: true, .. } => 1, - _ => 0, - }); - instruction.add_operand(match image_class { - crate::ImageClass::Sampled { .. } => 1, - _ => 0, - }); + instruction.add_operand(multi as u32); + instruction.add_operand(sampled as u32); let format = match image_class { crate::ImageClass::Storage(format) => match format {