From ba4d11afa96f8c8e71a55fb286526b46989f5561 Mon Sep 17 00:00:00 2001 From: Alexander Rohde Date: Tue, 3 Oct 2023 17:32:39 +0200 Subject: [PATCH] Allow for setting the array length in a shader using a specialization constant. (#2345) --- vulkano-shaders/src/structs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vulkano-shaders/src/structs.rs b/vulkano-shaders/src/structs.rs index 4251c53001..4e71028831 100644 --- a/vulkano-shaders/src/structs.rs +++ b/vulkano-shaders/src/structs.rs @@ -581,7 +581,7 @@ impl TypeArray { let length = length_id .map(|id| match shader.spirv.id(id).instruction() { - Instruction::Constant { value, .. } => { + Instruction::Constant { value, .. } | Instruction::SpecConstant { value, .. } => { assert!(matches!(value.len(), 1 | 2)); let len = value.iter().rev().fold(0u64, |a, &b| (a << 32) | b as u64);