On Sun, Mar 21, 2010 at 8:02 PM, Pauli Nieminen <suok...@gmail.com> wrote:
> There is bug in r200 swtnl fallback that hwtnl state is emited in swtnl flush.
> Bug causes emit size to be larger that excepted which might cause crash in 
> some
> corner cases.
>
> Signed-off-by: Pauli Nieminen <suok...@gmail.com>
> ---
>  tests/all.tests                           |    1 +
>  tests/bugs/CMakeLists.txt                 |    1 +
>  tests/bugs/r200-swtnl-material-fallback.c |   79 
> +++++++++++++++++++++++++++++
>  3 files changed, 81 insertions(+), 0 deletions(-)
>  create mode 100644 tests/bugs/r200-swtnl-material-fallback.c
>
> diff --git a/tests/all.tests b/tests/all.tests
> index d42de3b..afb0cb6 100644
> --- a/tests/all.tests
> +++ b/tests/all.tests
> @@ -241,6 +241,7 @@ add_plain_test(bugs, 'fdo10370')
>  add_plain_test(bugs, 'fdo14575')
>  add_plain_test(bugs, 'fdo20701')
>  add_plain_test(bugs, 'r300-readcache')
> +add_plain_test(bugs, 'r200-swtnl-material-fallback')
>  add_plain_test(bugs, 'tex1d-2dborder')
>  add_plain_test(bugs, 'point-sprite')
>  add_plain_test(bugs, 'fdo22540')
> diff --git a/tests/bugs/CMakeLists.txt b/tests/bugs/CMakeLists.txt
> index 3a72a96..de5ac5d 100644
> --- a/tests/bugs/CMakeLists.txt
> +++ b/tests/bugs/CMakeLists.txt
> @@ -35,3 +35,4 @@ add_executable (fdo23670-depth_test fdo23670-depth_test.c)
>  add_executable (fdo23670-drawpix_stencil fdo23670-drawpix_stencil.c)
>  add_executable (fdo24066 fdo24066.c)
>  add_executable (fdo25614-genmipmap fdo25614-genmipmap.c)
> +add_executable (r200-swtnl-material-fallback r200-swtnl-material-fallback.c)
> diff --git a/tests/bugs/r200-swtnl-material-fallback.c 
> b/tests/bugs/r200-swtnl-material-fallback.c
> new file mode 100644
> index 0000000..4cc22d8
> --- /dev/null
> +++ b/tests/bugs/r200-swtnl-material-fallback.c
> @@ -0,0 +1,79 @@
> +/*
> + * Copyright © 2010 Pauli Nieminen
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +/**
> + * Check that r200 swtnl fallback return doesn't emit hwtnl state.
> + *
> + * \author Pauli Nieminen
> + */
> +
> +
> +#include "piglit-util.h"
> +
> +int piglit_width = 100;
> +int piglit_height = 100;
> +int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;
> +
> +void
> +piglit_init(int argc, char **argv)
> +{
> +       piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
> +       glClearColor(0.0, 0.0, 0.0, 0.0);
> +}
> +
> +enum piglit_result
> +piglit_display(void)
> +{
> +       static GLfloat excepted[][3] = {
> +               {0.2,0.0,0.0},
> +               {0.2,0.2,0.2},
> +       };
> +       static GLfloat mat[][4] = {
> +               {1.0,0.0,0.0,0.0},
> +               {1.0,1.0,1.0,0.0},
> +       };
> +
> +       GLboolean pass = GL_TRUE;
> +       glClear(GL_COLOR_BUFFER_BIT);
> +       glEnable(GL_LIGHTING);
> +
> +       glBegin(GL_TRIANGLE_STRIP);
> +
> +       glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat[0]);
> +       glVertex3f((GLfloat)piglit_height, 0.0, 0.0);
> +       glVertex3f(0.0, 0.0, 0.0);
> +       glVertex3f((GLfloat)piglit_height, (GLfloat)piglit_width, 0.0);
> +       glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat[1]);
> +       glVertex3f(0.0, (GLfloat) piglit_width, 0.0);
> +
> +       glEnd();
> +
> +       if (!piglit_probe_pixel_rgb(piglit_width - 1, 1, excepted[0]))
> +               pass = GL_FALSE;
> +       if (!piglit_probe_pixel_rgb(1, piglit_height - 1, excepted[1]))
> +               pass = GL_FALSE;
> +
> +       glutSwapBuffers();
> +
> +       return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
> +}
> --
> 1.6.3.3
>
>

I pushed change to my personal git repository.
Can someone pull it and commit to piglit?
git pull git://anongit.freedesktop.org/~suokko/piglit.git master

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to