Lines Matching defs:vec4
50 typedef Vec4 vec4;
72 g_color_eps = vec4(1.f / ((float)(1 << deMin32(8, pixelFormat.redBits)) - 1.0f),
76 vec4(epsilon_zero);
80 g_color_eps = vec4(1.f / ((float)(1 << pixelFormat.redBits) - 1.0f),
83 vec4(epsilon_zero);
87 g_color_eps = vec4(epsilon_zero);
93 vec4 g_color_eps;
256 inline bool ColorEqual(const vec4& c0, const vec4& c1, const vec4& epsilon)
269 inline bool ColorEqual(const vec3& c0, const vec3& c1, const vec4& epsilon)
280 bool ValidateReadBuffer(int x, int y, int w, int h, const vec4& expected)
282 std::vector<vec4> display(w * h);
460 bool IsEqual(vec4 a, vec4 b)
504 NL "layout(local_size_x = 1, local_size_y = 1) in;" NL "layout(std430) buffer Output {" NL " vec4 data;" NL
505 "} g_out;" NL "void main() {" NL " g_out.data = vec4(1.0, 2.0, 3.0, 4.0);" NL "}";
523 glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(vec4), NULL, GL_DYNAMIC_DRAW);
534 vec4* data;
537 data = static_cast<vec4*>(glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), GL_MAP_READ_BIT));
539 if (!IsEqual(data[0], vec4(1.0f, 2.0f, 3.0f, 4.0f)))
751 << ");" NL "layout(std140) uniform InputBuffer {" NL " vec4 data["
753 << "];" NL "} g_in_buffer[12];" NL "layout(std430) buffer OutputBuffer {" NL " vec4 data0["
754 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data1["
755 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data2["
756 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data3["
757 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data4["
758 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data5["
759 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data6["
760 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data7["
761 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data8["
762 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data9["
763 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data10["
764 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data11["
816 glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(vec4) * kBufferSize * 12, NULL, GL_DYNAMIC_DRAW);
823 std::vector<vec4> data(kBufferSize);
826 data[j] = vec4(static_cast<float>(i * kBufferSize + j));
829 glBufferData(GL_UNIFORM_BUFFER, sizeof(vec4) * kBufferSize, &data[0], GL_DYNAMIC_DRAW);
847 std::vector<vec4> data(kBufferSize * 12);
850 glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4) * kBufferSize * 12, &data[0]);
862 if (!IsEqual(data[index * 12 + i], vec4(static_cast<float>(index * 12 + i))))
950 "uniform sampler2DMSArray g_sampler8;" NL "layout(std430) buffer OutputBuffer {" NL " vec4 data0["
951 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data1["
952 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data2["
953 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data3["
954 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data4["
955 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data5["
956 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data6["
957 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data7["
958 << global_size.x() * global_size.y() * global_size.z() << "];" NL " vec4 data8["
966 "vec4(vec3(gl_GlobalInvocationID) / vec3(kGlobalSize), 1.0));" NL
1002 std::vector<vec4> buffer_data(kBufferSize * 9);
1006 glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(vec4) * kBufferSize * 9, &buffer_data[0], GL_DYNAMIC_DRAW);
1009 std::vector<vec4> texture_data(kBufferSize, vec4(123.0f));
1054 glBufferData(GL_TEXTURE_BUFFER, kBufferSize * sizeof(vec4), &texture_data[0], GL_DYNAMIC_DRAW);
1072 glClearBufferfv(GL_COLOR, 0, &vec4(123.0f)[0]);
1074 glClearBufferfv(GL_COLOR, 0, &vec4(123.0f)[0]);
1093 glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4) * kBufferSize * 9, &buffer_data[0]);
1096 if (!IsEqual(buffer_data[index], vec4(123.0f)))
1182 " vec4 color = vec4(gl_GlobalInvocationID.x + gl_GlobalInvocationID.y) / 255.0;" NL
1184 " vec4 c = imageLoad(g_image1, ivec2(gl_GlobalInvocationID));" NL
1208 std::vector<vec4> data(kSize);
1247 std::vector<vec4> display(kWidth * kHeight);
1258 const vec4 c = vec4(float(y + x) / 255.0f);
1288 " gl_Position = vec4(g_quad[gl_VertexID], 0, 1);" NL
1292 NL "in StageData {" NL " vec2 texcoord;" NL "} fs_in;" NL "layout(location = 0) out vec4 o_color;" NL
1294 " vec4 c1 = texture(g_image1, fs_in.texcoord);" NL " vec4 c2 = texture(g_image2, fs_in.texcoord);" NL
1295 " if (c1 == c2) o_color = c1;" NL " else o_color = vec4(1, 0, 0, 1);" NL "}";
1753 "uniform vec2 g_1;" NL "uniform vec3 g_2;" NL "uniform vec4 g_3;" NL "uniform mat2 g_4;" NL
1760 " if (g_3 != vec4(7.0, 8.0, 9.0, 10.0)) g_result = 0;" NL NL
2473 "#version 430 core" NL "layout(binding = 0, std430) buffer Output {" NL " vec4 g_output;" NL "};" NL
2474 "vec4 CalculateOutput();" NL "void Run() {" NL " g_output = CalculateOutput();" NL "}";
2478 " vec4 g_output;" NL "};" NL "vec4 CalculateOutput() {" NL " g_output = vec4(0);" NL
2479 " return vec4(1, 2, 3, 4);" NL "}";
2519 glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(vec4), &vec4(0.0f)[0], GL_DYNAMIC_DRAW);
2525 vec4 data;
2528 glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), &data[0]);
2529 if (!IsEqual(data, vec4(1.0f, 2.0f, 3.0f, 4.0f)))
2575 NL "layout(binding = 0, std430) buffer Output {" NL " vec4 g_output;" NL "};" NL
2576 "vec4 CalculateOutput();" NL "void Run() {" NL " g_output = CalculateOutput();" NL "}",
2577 NL "vec4 CalculateOutput() {" NL " g_output = vec4(0);" NL " return vec4(1, 2, 3, 4);" NL "}"
2586 glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(vec4), &vec4(0.0f)[0], GL_DYNAMIC_DRAW);
2592 vec4 data;
2595 glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), &data[0]);
2596 if (!IsEqual(data, vec4(1.0f, 2.0f, 3.0f, 4.0f)))
2603 glBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), &vec4(0.0f)[0]);
2614 glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), &data[0]);
2615 if (!IsEqual(data, vec4(1.0f, 2.0f, 3.0f, 4.0f)))
2784 std::vector<vec4> data(kBufferSize);
2788 glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(vec4) * kBufferSize, &data[0], GL_DYNAMIC_DRAW);
2808 glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4) * kBufferSize, &data[0]);
2811 if (!IsEqual(data[i], vec4(static_cast<float>(i))))
2832 "layout(local_size_x = 128) in;" NL "layout(std430) buffer Output {" NL " vec4 g_output[256];" NL "};" NL
2837 " g_output[0] = vec4(g_shared_buf[1]);" NL " g_output[128] = vec4(g_shared_buf[0]);" NL
2843 " g_output[index] = vec4(g_shared_data[index].index);" // load data from shared memory
2844 NL " g_output[index + 128] = vec4(g_shared_data[index + 128].index);" NL
3100 NL "layout(local_size_x = 4) in;" NL "layout(std430) buffer Output {" NL " vec4 g_output[4];" NL "};" NL
3102 " g_output[gl_GlobalInvocationID.x] = vec4(quad[gl_GlobalInvocationID.x], 0, 1);" NL "}";
3111 NL "layout(location = 0) in vec4 i_position;" NL "out gl_PerVertex {" NL " vec4 gl_Position;" NL "};" NL
3118 NL "layout(location = 0) out vec4 o_color;" NL "void main() {" NL " o_color = vec4(0, 1, 0, 1);" NL "}";
3130 glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(vec4) * 4, NULL, GL_DYNAMIC_DRAW);
3150 if (!ValidateReadBuffer(0, 0, getWindowWidth(), getWindowHeight(), vec4(0, 1, 0, 1)))
3220 "out StageData {" NL " vec3 color;" NL "} g_vs_out;" NL "out gl_PerVertex {" NL " vec4 gl_Position;" NL
3221 "};" NL "void main() {" NL " gl_Position = vec4(g_input[gl_VertexID], 0, 1);" NL
3226 "layout(location = 0) out vec4 g_color;" NL "void main() {" NL " g_color = vec4(g_fs_in.color, 1);" NL "}";
3872 " vec4 pixel = imageLoad(g_input_image, pixel_xy);" NL
3957 NL "layout(local_size_x = 4) in;" NL "struct Vertex {" NL " vec4 position;" NL " vec4 color;" NL "};" NL
3961 " g_vertex[gl_GlobalInvocationID.x].color *= vec4(0, 1, 0, 1);" NL "}";
3968 NL "layout(location = 0) in vec4 g_position;" NL "layout(location = 1) in vec4 g_color;" NL
3969 "out StageData {" NL " vec4 color;" NL "} g_vs_out;" NL "void main() {" NL
3973 NL "in StageData {" NL " vec4 color;" NL "} g_fs_in;" NL "layout(location = 0) out vec4 g_color;" NL
3993 glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 2 * sizeof(vec4), 0);
3994 glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 2 * sizeof(vec4), reinterpret_cast<void*>(sizeof(vec4)));
4102 NL "layout(location = 0) in vec4 g_position;" NL "layout(location = 1) in vec3 g_color;" NL
4109 NL "in StageData {" NL " vec3 color;" NL "} g_fs_in;" NL "layout(location = 0) out vec4 g_color;" NL
4110 "void main() {" NL " g_color = vec4(g_fs_in.color, 1);" NL "}";
4268 "uniform vec4 g_image_value = vec4(0.125, 0.25, 0.375, 0.5);" NL "void main() {" NL
4274 " vec4 v = imageLoad(g_image0, ivec2(id.xy));" NL
4356 std::vector<vec4> data(4 * 4, vec4(0.0f));
4379 std::vector<vec4> data(4 * 4);
4389 vec4(static_cast<GLfloat>(colorData[i] / 255.), static_cast<GLfloat>(colorData[i + 1] / 255.),
4394 if (!ColorEqual(data[i], vec4(0.25f, 0.5f, 0.75f, 1.0f), g_color_eps))
4544 "void main() {" NL " gl_Position = vec4(g_vertex[gl_VertexID], 0, 1);" NL "}";
4547 NL "layout(location = 0) out vec4 g_color;" NL "void main() {" NL " g_color = vec4(1, 0, 0, 1);" NL "}";
4564 " imageStore(g_output_image, pixel_xy + ivec2(x, y), vec4(0, 1, 0, 1));" NL " }" NL
4577 "vec4 Process(vec4 ic) {" NL " return ic + vec4(1, 0, 0, 0);" NL "}" NL
4581 " vec4 ic = imageLoad(g_input_image, pixel_xy);" NL
4592 std::vector<vec4> data(128 * 128);
4631 std::vector<vec4> data(128 * 128);
4637 if (!IsEqual(data[i], vec4(1, 1, 0, 1)))
4711 NL "layout(location = 0) in vec4 g_position;" NL "layout(location = 1) in vec4 g_color;" NL
4712 "struct Vertex {" NL " vec4 position;" NL " vec4 color;" NL "};" NL "out StageData {" NL
4713 " vec4 color;" NL "} g_vs_out;" NL "layout(binding = 0, std430) buffer StageData {" NL
4719 NL "in StageData {" NL " vec4 color;" NL "} g_fs_in;" NL "layout(location = 0) out vec4 g_color;" NL
4733 NL "layout(local_size_x = 3) in;" NL "struct Vertex {" NL " vec4 position;" NL " vec4 color;" NL "};" NL
4735 "uniform vec4 g_color1 = vec4(0, 0, 1, 0);" NL "uniform int g_two = 2;" NL
4736 "void UpdateVertex2(int i) {" NL " g_vertex[i].color -= vec4(-1, 1, 0, 0);" NL "}" NL "void main() {" NL
4738 " case 0: g_vertex[gl_GlobalInvocationID.x].color += vec4(1, 0, 0, 0); break;" NL
4748 glBufferData(GL_SHADER_STORAGE_BUFFER, 3 * sizeof(vec4) * 2, NULL, GL_STATIC_COPY);
4752 glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 3 * sizeof(vec4) * 2, NULL, GL_STREAM_COPY);
4763 glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 2 * sizeof(vec4), 0);
4764 glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 2 * sizeof(vec4), reinterpret_cast<void*>(sizeof(vec4)));
4813 if (!ValidateReadBuffer(0, 0, getWindowWidth(), getWindowHeight(), vec4(0, 1, 0, 1)))
4869 "layout (local_size_x = 4,local_size_y=4 ) in;" NL "shared vec4 g_shared1[4];" NL
4886 " vec4 result = vec4(0, 1, 0, 1);" NL NL
4888 " if (!CheckMemory(thread_xy, g_values[gl_LocalInvocationIndex] * 1.0)) result = vec4(1, 0, 0, 1);" NL NL
4890 " if (!CheckMemory(thread_xy, g_values[gl_LocalInvocationIndex] * -1.0)) result = vec4(1, 0, 0, 1);" NL NL
4893 " if (!CheckMemory(thread_xy, g_values[gl_LocalInvocationIndex] * 7.0)) result = vec4(1, 0, 0, 1);" NL
4902 std::vector<vec4> data(4 * 4);
4916 std::vector<vec4> data(4 * 4);
4922 if (!IsEqual(data[i], vec4(0, 1, 0, 1)))
4974 "shared struct Type { vec4 v[2]; } g_shared[1024];" // 32768 bytes of shared memory
4977 " g_shared[id].v = vec4[2](vec4(1.0), vec4(1.0));" NL " memoryBarrierShared();" NL " barrier();" NL NL
4978 " vec4 sum = vec4(0.0);" NL " int sum_count = 0;" NL " for (int i = id - 3; i < id + 4; ++i) {" NL
4981 " if (any(greaterThan(abs((sum / sum_count) - vec4(1.0)), vec4(0.0000001f)))) return;" NL NL
4990 std::vector<vec4> data(1024 * 2);
4993 glBufferData(GL_SHADER_STORAGE_BUFFER, (GLsizeiptr)(sizeof(vec4) * data.size()), &data[0][0],
5003 std::vector<vec4> data(1024 * 2);
5004 glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, (GLsizeiptr)(sizeof(vec4) * data.size()), &data[0][0]);
5007 if (!IsEqual(data[i], vec4(1.0f)))
5066 " vec4 g_output[4];" NL "};" NL "uniform isamplerBuffer g_path_buffer;" NL
5067 "uniform vec4[4] g_input0 = vec4[4](vec4(100), vec4(200), vec4(300), vec4(400));" NL
5069 " vec4[4] g_input2;" NL "};" NL NL "void Path2(int id) {" NL
5087 std::vector<vec4> data(4, vec4(-100.0f));
5089 glBufferData(GL_SHADER_STORAGE_BUFFER, (GLsizeiptr)(sizeof(vec4) * data.size()), &data[0][0],
5094 const vec4 data[4] = { vec4(1.0f), vec4(2.0f), vec4(3.0f), vec4(4.0f) };
5110 const vec4 data[4] = { vec4(10.0f), vec4(20.0f), vec4(30.0f), vec4(40.0f) };
5131 vec4 data[4];
5135 const vec4 expected[4] = { vec4(3.0f), vec4(20.0f), vec4(-100.0f), vec4(400.0f) };
5828 "void main() {" NL " gl_Position = vec4(g_vertex[gl_VertexID], g_depth, 1);" NL "}";
5831 NL "layout(location = 0) out vec4 g_color;" NL "void main() {" NL " g_color = vec4(0, 1, 0, 1);" NL "}";
5932 if (!ValidateReadBuffer(0, 0, getWindowWidth(), getWindowHeight(), vec4(0, 1, 0, 1)))
6010 NL "layout(location = 0) in vec4 g_position;" NL "void main() {" NL " gl_Position = g_position;" NL "}";
6013 NL "layout(location = 0) out vec4 g_color;" NL "void main() {" NL " g_color = vec4(1);" NL "}";
6288 NL "layout(location = 0) in vec4 g_position;" NL "void main() {" NL " gl_Position = g_position;" NL "}";
6291 NL "layout(location = 0) out vec4 g_color;" NL "void main() {" NL " g_color = vec4(1);" NL "}";