[Piglit] [PATCH] arb_texture_barrier: use itertools.product instead of nested loops

Alejandro Piñeiro apinheiro at igalia.com
Fri Jul 22 13:06:02 UTC 2016


On 22/07/16 14:31, Ilia Mirkin wrote:
>
> What does this fix?
>

Nothing. It was just a change proposed by Dylan, and I just copied the
code he proposed.

> IMO seems way harder to read. If you're really set on using product,
> moving the array definitions out of line, with descriptive names would
> solve that. E.g
>
> RESOLUTIONS = [1,2,3]
> for resolution, ... in itertools.product():
>

Makes sense. I will send a v2 version in short.

>
> On Jul 22, 2016 2:09 AM, "Alejandro Piñeiro" <apinheiro at igalia.com
> <mailto:apinheiro at igalia.com>> wrote:
>
>     ---
>      tests/all.py | 11 ++++-------
>      1 file changed, 4 insertions(+), 7 deletions(-)
>
>     diff --git a/tests/all.py b/tests/all.py
>     index 2c78b0a..a29724e 100644
>     --- a/tests/all.py
>     +++ b/tests/all.py
>     @@ -4722,13 +4722,10 @@ with profile.group_manager(
>      with profile.group_manager(
>              PiglitGLTest,
>              grouptools.join('spec', 'arb_texture_barrier')) as g:
>     -    for resolution in ['32', '512']:
>     -        for blend_passes in ['1', '42']:
>     -            for num_textures in ['1', '8']:
>     -                for granularity in ['8', '64', '128']:
>     -                    for draw_passes in ['1', '2', '3', '4', '7',
>     '8']:
>     -                       
>     g(['arb_texture_barrier-blending-in-shader', resolution,
>     -                           blend_passes, num_textures,
>     granularity, draw_passes])
>     +    for resolution, blend_passes, num_textures, granularity,
>     draw_passes in itertools.product(
>     +            ['32', '512'], ['1', '42'], ['1', '8'], ['8', '64',
>     '128'], ['1', '2', '3', '4', '7', '8']):
>     +        g(['arb_texture_barrier-blending-in-shader', resolution,
>     +           blend_passes, num_textures, granularity, draw_passes])
>
>
>      # Group ARB_invalidate_subdata
>     --
>     2.7.4
>
>     _______________________________________________
>     Piglit mailing list
>     Piglit at lists.freedesktop.org <mailto:Piglit at lists.freedesktop.org>
>     https://lists.freedesktop.org/mailman/listinfo/piglit
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160722/2b3c8f9c/attachment.html>


More information about the Piglit mailing list