X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mirror.comp;fp=mirror.comp;h=d4021367a5158c5cf9107a1c3457d7c1f7d7e53b;hb=8ee9712bae3cff206b3e3205748633edb33cbbcf;hp=0000000000000000000000000000000000000000;hpb=e683d4e49549b2d4c6906d2ebc4184904f4fe9f8;p=movit diff --git a/mirror.comp b/mirror.comp new file mode 100644 index 0000000..d402136 --- /dev/null +++ b/mirror.comp @@ -0,0 +1,14 @@ +// A compute shader to mirror the inputs, in 2x2 blocks. For testing only. + +layout(local_size_x = 1) in; + +void FUNCNAME() +{ + ivec2 tc = ivec2(gl_GlobalInvocationID.xy) * ivec2(2, 2); + int offs = int(gl_NumWorkGroups.x) * 2 - 1; + + OUTPUT(ivec2(offs - tc.x, tc.y), INPUT(NORMALIZE_TEXTURE_COORDS(vec2(tc.x, tc.y)))); + OUTPUT(ivec2(offs - tc.x - 1, tc.y), INPUT(NORMALIZE_TEXTURE_COORDS(vec2(tc.x + 1, tc.y)))); + OUTPUT(ivec2(offs - tc.x, tc.y + 1), INPUT(NORMALIZE_TEXTURE_COORDS(vec2(tc.x, tc.y + 1)))); + OUTPUT(ivec2(offs - tc.x - 1, tc.y + 1), INPUT(NORMALIZE_TEXTURE_COORDS(vec2(tc.x + 1, tc.y + 1)))); +}