Open almarklein opened 4 years ago
+1 on this, it would be great if it could be defined similar to the parameters, as:
@python2shader
def compute_shader_multiply(
index: ("input", "GlobalInvocationId", ivec3),
data1: ("buffer", 0, Array(f32)),
data2: ("buffer", 1, Array(f32)),
data3: ("buffer", 2, Array(f32)),
constants=[Constant("LEN_VAR", 0, )]):
i = index.x
data3[i] = data1[i] * data2[i]
SpirV supports specialization: setting constants at runtime, can be useful?