diff options
Diffstat (limited to 'assets/Compute.glsl')
| -rw-r--r-- | assets/Compute.glsl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/assets/Compute.glsl b/assets/Compute.glsl new file mode 100644 index 0000000..9a36a84 --- /dev/null +++ b/assets/Compute.glsl @@ -0,0 +1,24 @@ +#type compute +#version 430 core + +layout(local_size_x = 256) in; + +layout(std430, binding = 0) buffer InputBuffer +{ + float data[]; +} inputBuffer; + +layout(std430, binding = 1) buffer OutputBuffer +{ + float data[]; +} outputBuffer; + +uniform float u_Scale; +uniform float u_Offset; + +void main() +{ + uint index = gl_GlobalInvocationID.x; + float inputValue = inputBuffer.data[index]; + outputBuffer.data[index] = inputValue * u_Scale + u_Offset; +} |
