On 10/15/2015 04:07 AM, Jan Vesely wrote:
On Mon, 2015-10-12 at 15:42 +0300, Tapani Pälli wrote:
v2: review feedback from Iago Toral and Ian Romanick
+
+       /* Loop through formats listed in 'tests'. */
+       for (unsigned j = 0; j < ARRAY_SIZE(tests); j += 2) {

for loop breaks build.
read-depth.c:130:2: error: ‘for’ loop initial declarations are only
allowed in C99 or C11 mode
   for (unsigned j = 0; j < ARRAY_SIZE(tests); j += 2) {

gcc (Gentoo 4.9.3 p1.0, pie-0.6.2) 4.9.3

Sorry, I've pushed a fix for this. Thanks for reporting!

+
+               float expect = 0.0;
+
+               GLuint fbo = create_depth_fbo(tests[j]);
+               if (!fbo)
+                       return PIGLIT_FAIL;
+
+               /* Step from -1.0 to 1.0, linear depth. Render a
rectangle at depth i,
+                * read pixel and verify expected depth value.
+                */
+               for (float i = -1.0; !equals(i, 1.0 + step); i +=
step) {

same as above
read-depth.c:141:3: error: ‘for’ loop initial declarations are only
allowed in C99 or C11 mode
    for (float i = -1.0; !equals(i, 1.0 + step); i += step) {

Jan

+
+                       glClear(GL_DEPTH_BUFFER_BIT);
+                       glUniform1f(glGetUniformLocation(prog,
"depth"), i);
+
+                       piglit_draw_rect(-1, -1, 2, 2);
+
+                       if (!(read_depth(tests[j + 1], expect)))
+                               return PIGLIT_FAIL;
+
+                       expect += step / 2.0;
+               }
+               glDeleteFramebuffers(1, &fbo);
+       }
+       return PIGLIT_PASS;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+       piglit_require_extension("GL_NV_read_depth");
+       prog = piglit_build_simple_program(vs_source, fs_source);
+       glUseProgram(prog);
+}
_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to