From c4dfc26b48b70a9785ed745142d6e24d3a710c5f Mon Sep 17 00:00:00 2001 From: Alexander Rohde Date: Mon, 2 Oct 2023 16:45:18 +0200 Subject: [PATCH] Allow for setting the array length in a shader using a specialization constant. --- 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);