[Piglit] [PATCH 5/6] Fix bogus texture name used in fp-kil

Paul Berry stereotype441 at gmail.com
Sun Aug 26 12:48:47 PDT 2012


On 25 August 2012 01:12, Chris Forbes <chrisf at ijw.co.nz> wrote:

> fp-kil assumed that `1` was an unused texture name. This isn't
> true if running with -fbo, so use glGenTextures to get a name
> that's really unused.
>
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  tests/shaders/fp-kil.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tests/shaders/fp-kil.c b/tests/shaders/fp-kil.c
> index 3f35452..d9b78fe 100644
> --- a/tests/shaders/fp-kil.c
> +++ b/tests/shaders/fp-kil.c
> @@ -113,7 +113,7 @@ static const struct {
>                 { 0.0, 0.0, 0.0, 1.0 }
>         },
>
> -       // Program 0
> +       // Program 1
>

I don't mixing an unrelated comment fix into the patch, especially since
the fix is so obviously correct.  But it would be nice to briefly mention
it in the commit message just to avoid jarring people (e.g. "also fixed a
bogus comment").

In any case, this patch is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>.


>         {
>                 "texture #1",
>                 0.125, 1.125,
> @@ -264,6 +264,7 @@ void
>  piglit_init(int argc, char **argv)
>  {
>         int i, x, y;
> +       int texname;
>         GLubyte tex[4][4][4];
>
>         if (piglit_get_gl_version() < 13) {
> @@ -293,9 +294,10 @@ piglit_init(int argc, char **argv)
>                 }
>         }
>
> +       glGenTextures(1, &texname);
>         glActiveTexture(GL_TEXTURE0);
>         glEnable(GL_TEXTURE_2D);
> -       glBindTexture(GL_TEXTURE_2D, 1);
> +       glBindTexture(GL_TEXTURE_2D, texname);
>         glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0,
>                      GL_RGBA, GL_UNSIGNED_BYTE, tex);
>
> --
> 1.7.12
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20120826/4630f567/attachment.html>


More information about the Piglit mailing list