[PATCH 2/2] d3dcompiler/tests: Fix parameter desc test on d3d10.

Matteo Bruni matteo.mystral at gmail.com
Fri Nov 29 13:10:43 CST 2019

On Fri, Nov 29, 2019 at 2:07 PM Matteo Bruni <matteo.mystral at gmail.com> wrote:
> On Fri, Nov 29, 2019, 13:05 Sven Baars <sven.wine at gmail.com> wrote:
> >
> > On 29-11-2019 11:57, Matteo Bruni wrote:
> > > +        else
> > > +            ok(!desc.Stream,·"(%u):·got·unexpected·Stream·%u.\n",·i,·desc.Stream);
> > >
> >
> > Hi Matteo,
> >
> > This is not true according to the tests:
> >
> > https://test.winehq.org/data/tests/d3d10:reflection.html
> Oh indeed, there is something weird going on (e.g.
> https://test.winehq.org/data/ec9eddf86b144cc0fcf975a9cc864cf08ba84eaf/win10_cw-gtx560-1507-64/d3d10:reflection.html).
> That suggests that somehow the "missing" field is changed by the
> implementation? AFAICS the local variable is supposed to be completely
> initialized to 0 by the test. Also of note, it looks like only the
> 64-bit tests are affected.

Okay, as it turns out on 64-bit sizeof(D3D10_SIGNATURE_PARAMETER_DESC)
== sizeof(D3D11_SIGNATURE_PARAMETER_DESC) == 32 i.e. the structs have
actually the same size, the d3d10 version has just more padding at the
end. I thought that the d3d10 version would always end before the
offset of the Stream field in the d3d11 structure so testing that the
implementation (especially our implementation) doesn't write out of
the struct would be a useful test. But that's clearly not the case and
checking the contents of the padding isn't a particularly sensible
thing to do. I'll drop those checks from the d3d10 tests; Sven, thanks
again for the patch and keep looking after the fix in case I still
miss something :D

P.S.: It's mildly annoying that pahole doesn't work with PE files, it
would have been useful in this case.

More information about the wine-devel mailing list