62ea873373
It was reporting an error: [error ] GLWrap: Error in shader gaussian6h.comp [error ] GLWrap: 0:77(1): error: storage qualifiers must come after precise, invariant, interpolation, layout and auxiliary storage qualifiers
34 lines
939 B
Plaintext
34 lines
939 B
Plaintext
uniform sampler2D source;
|
|
layout(r32f) restrict writeonly uniform image2D dest;
|
|
uniform vec2 pixel;
|
|
uniform float weights[7];
|
|
|
|
// Gaussian separated blur with radius 6.
|
|
|
|
layout (local_size_x = 8, local_size_y = 8) in;
|
|
|
|
shared float local_src[8 + 2 * 6][8];
|
|
|
|
void main()
|
|
{
|
|
int x = int(gl_LocalInvocationID.x), y = int(gl_LocalInvocationID.y);
|
|
ivec2 iuv = ivec2(gl_GlobalInvocationID.x, gl_GlobalInvocationID.y);
|
|
vec2 uv_m = (iuv - ivec2(6, 0)) * pixel;
|
|
vec2 uv = iuv * pixel;
|
|
vec2 uv_p = (iuv + ivec2(6, 0)) * pixel;
|
|
|
|
local_src[x][y] = texture(source, uv_m).x;
|
|
local_src[x + 6][y] = texture(source, uv).x;
|
|
local_src[x + 12][y] = texture(source, uv_p).x;
|
|
|
|
barrier();
|
|
|
|
float sum = local_src[x + 6][y] * weights[0];
|
|
for (int i = 1; i < 6; i++) {
|
|
sum += local_src[6 + x - i][y] * weights[i];
|
|
sum += local_src[6 + x + i][y] * weights[i];
|
|
}
|
|
|
|
imageStore(dest, iuv, vec4(sum));
|
|
}
|