mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-10-29 21:42:26 +00:00
Allow for setting the array length in a shader using a specialization constant. (#2345)
This commit is contained in:
parent
d22104709f
commit
ba4d11afa9
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user