[Piglit] [PATCH v2 2/2] primitive-restart: add testing of additional restart indicies

Eric Anholt eric at anholt.net
Mon May 14 17:13:09 PDT 2012


On Thu, 10 May 2012 12:11:55 -0700, Jordan Justen <jordan.l.justen at intel.com> wrote:
> In test_draw_by_index (glArrayElement/glDrawElements):
> * GL_UNSIGNED_BYTE: add testing 100.
> * GL_UNSIGNED_SHORT: add testing 0xffff.
> * GL_UNSIGNED_INT: add testing 0xffffffff.
> 
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  tests/general/primitive-restart.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/general/primitive-restart.c b/tests/general/primitive-restart.c
> index b79fddd..108e19b 100644
> --- a/tests/general/primitive-restart.c
> +++ b/tests/general/primitive-restart.c
> @@ -281,15 +281,15 @@ test_draw_by_index(GLboolean one_by_one, GLboolean use_vbo,
>  
>     switch (indexType) {
>     case GL_UNSIGNED_BYTE:
> -      restart_index = 255;
> +      restart_index = use_vbo ? 0xff : 100;
>        typeStr = "GL_UNSIGNED_BYTE";
>        break;
>     case GL_UNSIGNED_SHORT:
> -      restart_index = 1000;
> +      restart_index = one_by_one ? 1000 : 0xffff;
>        typeStr = "GL_UNSIGNED_SHORT";
>        break;
>     case GL_UNSIGNED_INT:
> -      restart_index = 1000 * 1000;
> +      restart_index = use_vbo ? 0xffffffff : 1000 * 1000;
>        typeStr = "GL_UNSIGNED_INT";
>        break;
>     default:

This looks strange to me to key which index off of some unrelated test
parameter.  I think you should probably test both paths both ways.  For
example, the driver's software fallback code is going to have different
codepaths hit based on vbos or not, so you wouldn't want to never hit
the sw fallback because you always have the nice cut index when vbos are
used.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20120514/5604283c/attachment.pgp>


More information about the Piglit mailing list