[PATCH 5/8] d3dx9/tests: Factor out test_effect_preshader_compare_pbool_consts() function.

Matteo Bruni matteo.mystral at gmail.com
Mon Jun 5 11:55:32 CDT 2017


2017-06-02 11:58 GMT+02:00 Paul Gofman <gofmanp at gmail.com>:

> +    if (!const_updated_mask)
> +    {
> +        for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
> +        {
> +            ok_(__FILE__, line)(!bdata[i] == !test_effect_preshader_bconsts[i],
> +                    "Pixel shader boolean constants do not match, expected %#x, got %#x, i %u.\n",
> +                    test_effect_preshader_bconsts[i], bdata[i], i);
> +        }
> +    }
> +    else
> +    {
> +        for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
> +        {
> +            if (const_updated_mask[i / TEST_EFFECT_BITMASK_BLOCK_SIZE]
> +                    & (1u << (i % TEST_EFFECT_BITMASK_BLOCK_SIZE)))
> +            {
> +                ok_(__FILE__, line)(!bdata[i] == !test_effect_preshader_bconsts[i],
> +                        "Pixel shader boolean constants do not match, expected %#x, got %#x, i %u, parameter %s.\n",
> +                        test_effect_preshader_bconsts[i], bdata[i], i, updated_param);
> +            }
> +            else
> +            {
> +                ok_(__FILE__, line)(!bdata[i],
> +                        "Pixel shader boolean constants updated unexpectedly, parameter %s.\n", updated_param);
> +            }
> +        }
> +    }

Minor simplification possibility: in the (!const_updated_mask) case
you could use a default "all ones" mask and use what's now the 'else'
branch, getting rid of the 'if' branch altogether.



More information about the wine-devel mailing list