]> git.sesse.net Git - movit/blob - mirror.comp
Fix an issue where we'd add an unneeded bounce for mipmaps in some cases.
[movit] / mirror.comp
1 // A compute shader to mirror the inputs, in 2x2 blocks. For testing only.
2
3 layout(local_size_x = 1) in;
4
5 void FUNCNAME()
6 {
7         ivec2 tc = ivec2(gl_GlobalInvocationID.xy) * ivec2(2, 2);
8         int offs = int(gl_NumWorkGroups.x) * 2 - 1;
9
10         OUTPUT(ivec2(offs - tc.x,     tc.y),     INPUT(NORMALIZE_TEXTURE_COORDS(vec2(tc.x,     tc.y))));
11         OUTPUT(ivec2(offs - tc.x - 1, tc.y),     INPUT(NORMALIZE_TEXTURE_COORDS(vec2(tc.x + 1, tc.y))));
12         OUTPUT(ivec2(offs - tc.x,     tc.y + 1), INPUT(NORMALIZE_TEXTURE_COORDS(vec2(tc.x,     tc.y + 1))));
13         OUTPUT(ivec2(offs - tc.x - 1, tc.y + 1), INPUT(NORMALIZE_TEXTURE_COORDS(vec2(tc.x + 1, tc.y + 1))));
14 }