Initial commit
This commit is contained in:
38
binaries/assets/shaders/addition.comp
Normal file
38
binaries/assets/shaders/addition.comp
Normal file
@@ -0,0 +1,38 @@
|
||||
#version 460
|
||||
|
||||
|
||||
//shared float shareData[1024]; // Shared between all threads in work group.
|
||||
|
||||
layout ( local_size_x = 10, local_size_y = 10, local_size_z = 1 ) in;
|
||||
|
||||
|
||||
|
||||
|
||||
layout( std430, binding = 0 ) buffer inputBlock {
|
||||
|
||||
vec2 array_a[ 100 ];
|
||||
|
||||
vec2 array_b[ 100 ];
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
layout( std430, binding = 1 ) buffer outputBlock {
|
||||
|
||||
vec2 array_c[ 100 ];
|
||||
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
uint index = gl_LocalInvocationIndex;
|
||||
|
||||
vec2 a = array_a[ index ];
|
||||
|
||||
vec2 b = array_b[ index ];
|
||||
|
||||
array_c[ index ] = a + b;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user