[Piglit] [PATCH 1/4] fbo-3d: fix for non-NPOT
Marek Olšák
maraeo at gmail.com
Mon Aug 16 12:35:06 PDT 2010
On Mon, Aug 16, 2010 at 2:46 PM, Luca Barbieri <luca at luca-barbieri.com>wrote:
> fbo-3d is incorrectly computing the texture coordinate in the POT case.
> ---
> tests/fbo/fbo-3d.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tests/fbo/fbo-3d.c b/tests/fbo/fbo-3d.c
> index 4ecff44..fbd4d3a 100644
> --- a/tests/fbo/fbo-3d.c
> +++ b/tests/fbo/fbo-3d.c
> @@ -50,13 +50,15 @@ float depth_color[NUM_DEPTHS][4] = {
> {0.0, 1.0, 1.0, 0.0},
> };
>
> +int pot_depth;
> +
> static int
> create_3d_fbo(void)
> {
> GLuint tex, fb;
> GLenum status;
> int depth;
> - int pot_depth =
> glutExtensionSupported("GL_ARB_texture_non_power_of_two") ?
> + pot_depth =
> glutExtensionSupported("GL_ARB_texture_non_power_of_two") ?
> NUM_DEPTHS: POT_DEPTHS;
>
> glGenTextures(1, &tex);
> @@ -110,7 +112,7 @@ done:
> static void
> draw_depth(int x, int y, int depth)
> {
> - float depth_coord = (float)depth / (NUM_DEPTHS - 1);
> + float depth_coord = (float)depth / (pot_depth - 1);
>
> glViewport(0, 0, piglit_width, piglit_height);
> piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
> --
> 1.7.0.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
Pushed, thanks.
Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20100816/81e2badd/attachment.htm>
More information about the Piglit
mailing list