On Mon, Aug 16, 2010 at 2:46 PM, Luca Barbieri <span dir="ltr">&lt;<a href="mailto:luca@luca-barbieri.com">luca@luca-barbieri.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

fbo-3d is incorrectly computing the texture coordinate in the POT case.<br>
---<br>
 tests/fbo/fbo-3d.c |    6 ++++--<br>
 1 files changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/tests/fbo/fbo-3d.c b/tests/fbo/fbo-3d.c<br>
index 4ecff44..fbd4d3a 100644<br>
--- a/tests/fbo/fbo-3d.c<br>
+++ b/tests/fbo/fbo-3d.c<br>
@@ -50,13 +50,15 @@ float depth_color[NUM_DEPTHS][4] = {<br>
        {0.0, 1.0, 1.0, 0.0},<br>
 };<br>
<br>
+int pot_depth;<br>
+<br>
 static int<br>
 create_3d_fbo(void)<br>
 {<br>
        GLuint tex, fb;<br>
        GLenum status;<br>
        int depth;<br>
-       int pot_depth = glutExtensionSupported(&quot;GL_ARB_texture_non_power_of_two&quot;) ?<br>
+       pot_depth = glutExtensionSupported(&quot;GL_ARB_texture_non_power_of_two&quot;) ?<br>
                NUM_DEPTHS: POT_DEPTHS;<br>
<br>
        glGenTextures(1, &amp;tex);<br>
@@ -110,7 +112,7 @@ done:<br>
 static void<br>
 draw_depth(int x, int y, int depth)<br>
 {<br>
-       float depth_coord = (float)depth / (NUM_DEPTHS - 1);<br>
+       float depth_coord = (float)depth / (pot_depth - 1);<br>
<br>
        glViewport(0, 0, piglit_width, piglit_height);<br>
        piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);<br>
<font color="#888888">--<br>
1.7.0.4<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></blockquote></div><br>Pushed, thanks.<br><br>Marek<br>