Large array variable initialization (let arr = [0; 32 * 1024];
) compiles very slowly.
#1132
Labels
t: bug
Something isn't working
EDIT(@eddyb): while there are reasons to avoid such arrays, the slowdown is the immediate Rust-GPU bug - I've left unchanged the original text, but used
strikethroughfor parts that don't apply, IMO.User should not be able to create large sized arrays in rust-gpu shaders.Stack is limited, and large sized data-structures should be moved in buffers.Plus it makes compilation incredibly slow (I assume this syntax [0; SIZE] translates to spirv's [0, 0, 0, 0, 0, ... SIZE])
Expected Behaviour
spirv-builder should throw an error, when user creates large array in stackExample & Steps To Reproduce
let arr = [0; 32 * 1024];
cargo build
System Info
The text was updated successfully, but these errors were encountered: