Skip to content

Commit

Permalink
Allow for setting the array length in a shader using a specialization…
Browse files Browse the repository at this point in the history
… constant. (#2345)
  • Loading branch information
rohdealx authored Oct 3, 2023
1 parent d221047 commit ba4d11a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vulkano-shaders/src/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ba4d11a

Please # to comment.