File: mirror.comp

package info (click to toggle)
movit 1.7.2-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 3,248 kB
  • sloc: cpp: 16,677; sh: 3,940; makefile: 167
file content (14 lines) | stat: -rw-r--r-- 631 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
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))));
}