gKit2 light
min_data.glsl
Go to the documentation of this file.
1 
3 
4 #version 430
5 
6 #ifdef COMPUTE_SHADER
7 
8 layout(binding= 0, std430) readonly buffer inputData
9 {
10  int data[];
11 };
12 
13 layout(binding= 1, std430) coherent buffer tmpData
14 {
15  int tmp[];
16 };
17 
18 uniform uint N;
19 uniform uint n;
20 
21 layout(local_size_x= 1024) in;
22 void main( )
23 {
24  uint id= gl_GlobalInvocationID.x;
25 
26  if(id < N/2)
27  tmp[N/2+id]= min(data[id*2], data[id*2+1]);
28 
29  if(id < n/2)
30  tmp[n/2+id]= min(tmp[n+id*2], tmp[n+id*2+1]);
31 }
32 
33 #endif
34 
Point min(const Point &a, const Point &b)
renvoie la plus petite composante de chaque point. x, y, z= min(a.x, b.x), min(a.y,...
Definition: vec.cpp:30