[require] GLSL >= 1.30 GL_ARB_shader_bit_encoding [vertex shader] #version 130 #extension GL_ARB_shader_bit_encoding : enable in vec4 piglit_vertex; out vec4 color; vec4 temps[6]; int addr0; void main() { temps[0] = vec4(0.2, 0 , 0 , 0); temps[1] = vec4(0 , 0.2, 0 , 0); temps[2] = vec4(0 , 0 , 0.2, 0); temps[3] = vec4(0.2, 0.2, 0 , 0); temps[4] = vec4(0 , 0 , 0 , 0); temps[5] = vec4(0 , 0 , 0 , 0); int n = 0; while (n < 4) { #if 1 addr0 = int(floatBitsToInt(temps[5].xxxx)); #else addr0 = int(floatBitsToInt(temps[5].x)); #endif temps[4] += temps[addr0]; temps[5].x = intBitsToFloat(n + 1); n = floatBitsToInt(temps[5].x); }; gl_Position = piglit_vertex; color = temps[4]; } [fragment shader] #version 130 in vec4 color; void main() { gl_FragColor = color; } [test] clear color 0.0 0.0 0.0 0.0 clear ortho draw rect -1 -1 2 2 probe rgba 2 2 .40 .40 .20 0.0