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

Dylan Smith dylan.ah.smith at
Mon Apr 25 23:34:26 CDT 2011

On Sun, Mar 20, 2011 at 1:09 PM, Michael Mc Donnell
<michael at> wrote:
> I would like implement some of the missing mesh functions in Wine's
> D3DX9 for Google Summer of Code 2011. I would like to implement the
> following functions:
>  - CloneMesh
>  - CloneMeshFVF
>  - ConvertPointRepsToAdjacency
>  - ConvertAdjacencyToPointReps
>  - GenerateAdjacency

Hi Michael,

Sorry for not noticing your before, but it seems as if some work that
I have been doing as some overlap with your proposed Google Summer of
Code project.  I have implemented GenerateAdjacency, and partially
implemented CloneMesh{,FVF} for the basic case where the vertex
formats are exactly the same, but I am still trying to incrementally
submit my work to wine-patches.

I have actually been working on the D3DXLoadMeshFromX and
D3DXLoadMeshHierarchyFromX functions. However,
D3DXLoadMeshHierarchyFromX is given a set of callbacks that is called
with the adjacency for the mesh
(ID3DXAllocateMeshHierarchy::CreateMeshContainer).  It is for this
reason that I implemented GenerateAdjacency, since it wasn't possible
to detect whether the adjacency information would be used by the user
provided callback in order to create a partial implementation.

I also provided a partial implementation of Optimize{,Inplace} since
it seemed like the load mesh functions were sorting the faces by the
attribute values (i.e. D3DXMESHOPT_ATTRSORT). I had Optimize use
CloneMesh with the same vertex format in order to call
OptimizeInplace, which does the actual optimization work.

The relevant patches are in my development repository
( in the loadmesh branch.  I am trying to
send in my patches, but currently I am waiting on the review of my
latest patch to generate rmxftmpl.h, which is a re-requisite for load
mesh patches.  I'll try to avoid stepping on your toes in future.

Summary of ID3DXMesh methods I have implemented:
- LockAttributeBuffer
- UnlockAttributeBuffer
- GetAttributeTable
- SetAttributeTable
- DrawSubset
- GenerateAdjacency

Partially implemented:
OptimizeInplace: unimplemented support for D3DXMESHOPT_VERTEXCACHE,
CloneMesh: unimplemented support for vertex buffer conversion

Completely unimplemented:
- ConvertPointRepsToAdjacency
- ConvertAdjacencyToPointReps
- UpdateSemantics

There are also plenty of other functions. Just try `grep stub
d3dx9_36.spec | grep Mesh` for Mesh related functions.  There are also
some unimplemented functions to create meshes for certain shapes (e.g.
D3DXCreateTorus, D3DXCreatePolygon).

More information about the wine-devel mailing list