8 layout(std430, binding= 0) coherent buffer HistogramData
14 layout(binding= 0, rgba8) readonly uniform image2D image;
16 layout(local_size_x= 8, local_size_y= 8) in;
19 vec4 pixel= imageLoad(image, ivec2(gl_GlobalInvocationID.xy));
22 float grey= (pixel.r + pixel.g + pixel.b) / 3;
23 int bin= int(grey * 15);
25 atomicAdd(histogram[bin], 1);
vecteur generique 4d, ou 3d homogene, utilitaire.