SPIRV-Cross/shaders-msl/comp/global-invocation-id-writable-ssbo-in-function.comp
2017-01-26 20:12:00 -05:00

13 lines
294 B
Plaintext

#version 450
layout(set = 0, binding = 0) buffer myBlock {
int a;
float b[1];
} myStorage;
float getB() {
return myStorage.b[gl_GlobalInvocationID.x];
}
void main() {
myStorage.a = (myStorage.a + 1) % 256;
myStorage.b[gl_GlobalInvocationID.x] = mod((getB() + 0.02), 1.0);
}