Closed as not planned
Description
Quite often, an algorithm will have a working data size configurable by a constant, and this size is correlated with the thread group size. Here's what I would like to do, but doesn't work:
const BUF_SIZE: u32 = 64;
// use BUF_SIZE to declare arrays and what not
#[spirv(compute(threads(BUF_SIZE, 1, 1)))]
pub fn main_cs(...) { ... }
Instead I have to fall back to:
#[spirv(compute(threads(64, 1, 1)))] // 64 == BUF_SIZE
I guess the way attributes work might make this impossible? Or is there a way?
In GLSL/HLSL, this is trivial but that's because there's a preprocessor which just injects a #define
-d value through text replacement.