[PATCH] d3d9/tests: Add more tests for shader validator.

Paul Gofman pgofman at codeweavers.com
Mon Jan 11 12:02:35 CST 2021


On 1/11/21 20:53, Henri Verbeet wrote:
> On Fri, 8 Jan 2021 at 15:14, Paul Gofman <pgofman at codeweavers.com> wrote:
>> +    static const struct instruction_test
>> +    {
>> +        unsigned int shader_version;
>> +        const unsigned int *instruction;
>> +        unsigned int instruction_length;
>> +        DWORD_PTR message_id;
>> +        const unsigned int *decl;
>> +        unsigned int decl_length;
>> +    }
>> +    instruction_tests[] =
>> +    {
>> +        {0xffff0300, dcl_texcoord_9_9, ARRAY_SIZE(dcl_texcoord_9_9)},
>> +        {0xffff0300, dcl_texcoord_9_10, ARRAY_SIZE(dcl_texcoord_9_10), 0x12c},
>> +        {0xffff0300, dcl_texcoord_10_9, ARRAY_SIZE(dcl_texcoord_10_9)},
>> +        {0xffff0300, mov_r2_v9, ARRAY_SIZE(mov_r2_v9), 0, dcl_texcoord_9_9, ARRAY_SIZE(dcl_texcoord_9_9)},
>> +        {0xffff0300, mov_r2_v10, ARRAY_SIZE(mov_r2_v10), 0x167},
>> +    };
> D3DPS_VERSION(3, 0) instead of 0xffff0300, I'd say.
>
> As an aside, I'm not sure how much thought you've already given to the
> implementation of the shader validator, but we'll probably want most
> of that to live in vkd3d-shader. Perhaps that can be part of
> vkd3d_shader_scan(), although in its current form that requires
> complete shaders.

As soon as there is just one game known so far which happens to depend
on this validation, and we are unlikely to see more of such, I thought
of implementing only the minimum checks required in place (based on how
that is done in d3dx9 for, e. g., D3DX9GetShaderSemantics()). I've
attached some draft patches to the bug here:
https://bugs.winehq.org/attachment.cgi?id=69101. Do you think that is a
possible way to go? Or are there any plans for d3d compiler to use d3d9
shader validator, the same way as native maybe does?




More information about the wine-devel mailing list