Re: GSoC-2011: Implement Missing Mesh Functions in Wine’s D3DX9

Michael Mc Donnell michael at mcdonnell.dk
Thu May 26 03:33:11 CDT 2011


On Wed, May 25, 2011 at 9:53 AM, Michael Mc Donnell
<michael at mcdonnell.dk> wrote:
> On Tue, May 24, 2011 at 8:32 PM, Stefan Dösinger <stefandoesinger at gmx.at> wrote:
>> On Tuesday 24 May 2011 19:56:06 Michael Mc Donnell wrote:
>>> > *) In your first test you forgot to check the HeapAlloc result.
>>>
>>> Ok, I'll return E_OUTOFMEMORY in that case.
>> I guess the callers will only abort the tests if NewTestContext fails, so I
>> think the NULL / non-NULL return value was better.

I've reverted those changes, so it's back to NULL / non-NULL. I've
also moved it near the top of the file, so that other tests will be
able to re-use the test context creation.

>>> Should I try to make some more invalid
>>> D3DVERTEXELEMENT9 arrays to see if I can provoke an error?
>> I was thinking about something that would make CreateVertexDeclaration fail,
>> e.g. declaring a usage+usage index twice or using an undefined type.
>> dlls/d3d9/vertexdeclaration.c and dlls/wined3d/vertexdeclaration.c check for a
>> few error conditions in their vertexdeclaration_init functions. Just pick one
>> of them(no need to check all of them)
>> But watch out that you don't open a can of worms here. Our
>> CreateVertexDeclaration probably doesn't catch all error conditions. I
>> recommend that you pick one it does catch, otherwise you'll have to fix
>> d3d9.dll and wined3d.dll too for a small test.
>
> Ok thanks I'll do that.

I've added some more tests to see if I could make it fail. Microsoft's
UpdateSemantics is not very picky. I can't get it to return anything
but D3D_OK except for when I pass a null pointer. My implementation
follows this behavior except for two cases: it returns E_FAIL when
passing an undefined type and when the offset is not 4 byte aligned.
This is because the values are checked inside vertexdeclaration_init.
So Wine is stricter. I don't think that it is necessarily a problem
because applications that pass bogus declarations like those will
likely not work anyway. My own tests with a small interactive demo
show that in those cases the application will crash with an access
violation when it tries to re-draw the scene.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-d3dx9-test-Added-UpdateSemanticsTest.patch
Type: text/x-patch
Size: 10646 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20110526/273fc189/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-d3dx9-Implemented-UpdateSemantics-mesh-method.patch
Type: text/x-patch
Size: 4305 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20110526/273fc189/attachment-0003.bin>


More information about the wine-devel mailing list