On 1/11/21 20:53, Henri Verbeet wrote:
On Fri, 8 Jan 2021 at 15:14, Paul Gofman pgofman@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?