[PATCH 1/5] d3dcompiler_43/tests: Added HLSL test suite

Henri Verbeet hverbeet at gmail.com
Wed Sep 29 08:53:42 CDT 2010

On 29 September 2010 08:21, Travis Athougies <iammisc at gmail.com> wrote:
>> The problem with your current setup is that you do the readback after
>> doing a Present(). Present() invalidates the contents of the
>> backbuffer.
>>> +        ok(data[0] == D3DCOLOR_ARGB(0, 0, 255, 255),
>>> +                "swizzle_test: Got color %08x (should be 0x0000FFFF)\n", data[0]);
>> While I doubt you're going to care a lot for this specific test, I
>> think it makes sense to integrate something like color_match() from
>> the d3d9 tests right from the start. In fact, I think the way you want
>> to do this is to keep the actual testing inside
>> compile_pixel_shader9(). E.g., you could pass it an array with things
>> like probe locations, expected values, allowed deviations and failure
>> messages.
> I'm wondering... Inside compile_pixel_shader9? or compute_pixel_shader9? I'm
> thinking that this might make the argument list of
> compile_pixel_shader9 really really
> ugly. I'm unsure of exactly what you're telling me here? Could you be
> more explicit?
Sorry, in compute_pixel_shader9(). You'd do something like this:

struct test_data
    UINT x, y;
    D3DCOLOR color;
    UINT max_dev;
    const char *message;

struct test_data test_data[] =
    {320, 240, D3DCOLOR_ARGB(0x00, 0xff, 0xff, 0x00), 1, "Some failure

Then pass the test data array to compute_pixel_shader9() which would
loop through it and do the actual tests. You'd probably also want to
pass __LINE__. Note that this specific structure would be a problem
for floating point data though; you'll probably want to use floating
point values for your expected data everywhere, and just convert
D3DCOLOR result data to floating point inside compute_pixel_shader9().

More information about the wine-devel mailing list