RetroArch
d3dx10mesh.h
Go to the documentation of this file.
1 //
3 // Copyright (C) Microsoft Corporation. All Rights Reserved.
4 //
5 // File: d3dx10mesh.h
6 // Content: D3DX10 mesh types and functions
7 //
9 
10 #include "d3dx10.h"
11 
12 #ifndef __D3DX10MESH_H__
13 #define __D3DX10MESH_H__
14 
15 // {7ED943DD-52E8-40b5-A8D8-76685C406330}
16 DEFINE_GUID(IID_ID3DX10BaseMesh,
17 0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30);
18 
19 // {04B0D117-1041-46b1-AA8A-3952848BA22E}
20 DEFINE_GUID(IID_ID3DX10MeshBuffer,
21 0x4b0d117, 0x1041, 0x46b1, 0xaa, 0x8a, 0x39, 0x52, 0x84, 0x8b, 0xa2, 0x2e);
22 
23 // {4020E5C2-1403-4929-883F-E2E849FAC195}
24 DEFINE_GUID(IID_ID3DX10Mesh,
25 0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95);
26 
27 // {8875769A-D579-4088-AAEB-534D1AD84E96}
28 DEFINE_GUID(IID_ID3DX10PMesh,
29 0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96);
30 
31 // {667EA4C7-F1CD-4386-B523-7C0290B83CC5}
32 DEFINE_GUID(IID_ID3DX10SPMesh,
33 0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5);
34 
35 // {3CE6CC22-DBF2-44f4-894D-F9C34A337139}
36 DEFINE_GUID(IID_ID3DX10PatchMesh,
37 0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39);
38 
39 
40 // Mesh options - lower 3 bytes only, upper byte used by _D3DX10MESHOPT option flags
42  D3DX10_MESH_32_BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices.
43  D3DX10_MESH_GS_ADJACENCY = 0x004, // If set, mesh contains GS adjacency info. Not valid on input.
44 
45 };
46 
48 {
55 
57 
59 {
65 
67 
68 typedef struct _D3DX10_WELD_EPSILONS
69 {
70  FLOAT Position; // NOTE: This does NOT replace the epsilon in GenerateAdjacency
71  // in general, it should be the same value or greater than the one passed to GeneratedAdjacency
82 
84 
85 typedef struct _D3DX10_INTERSECT_INFO
86 {
87  UINT FaceIndex; // index of face intersected
88  FLOAT U; // Barycentric Hit Coordinates
89  FLOAT V; // Barycentric Hit Coordinates
90  FLOAT Dist; // Ray-Intersection Parameter Distance
92 
93 // ID3DX10MeshBuffer is used by D3DX10Mesh vertex and index buffers
94 #undef INTERFACE
95 #define INTERFACE ID3DX10MeshBuffer
96 
97 DECLARE_INTERFACE_(ID3DX10MeshBuffer, IUnknown)
98 {
99  // IUnknown
100  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
101  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
102  STDMETHOD_(ULONG, Release)(THIS) PURE;
103 
104  // ID3DX10MeshBuffer
105  STDMETHOD(Map)(THIS_ void **ppData, SIZE_T *pSize) PURE;
106  STDMETHOD(Unmap)(THIS) PURE;
107  STDMETHOD_(SIZE_T, GetSize)(THIS) PURE;
108 };
109 
110 // D3DX10 Mesh interfaces
111 #undef INTERFACE
112 #define INTERFACE ID3DX10Mesh
113 
114 DECLARE_INTERFACE_(ID3DX10Mesh, IUnknown)
115 {
116  // IUnknown
117  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
118  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
119  STDMETHOD_(ULONG, Release)(THIS) PURE;
120 
121  // ID3DX10Mesh
122  STDMETHOD_(UINT, GetFaceCount)(THIS) PURE;
123  STDMETHOD_(UINT, GetVertexCount)(THIS) PURE;
124  STDMETHOD_(UINT, GetVertexBufferCount)(THIS) PURE;
125  STDMETHOD_(UINT, GetFlags)(THIS) PURE;
126  STDMETHOD(GetVertexDescription)(THIS_ CONST D3D10_INPUT_ELEMENT_DESC **ppDesc, UINT *pDeclCount) PURE;
127 
128  STDMETHOD(SetVertexData)(THIS_ UINT iBuffer, CONST void *pData) PURE;
129  STDMETHOD(GetVertexBuffer)(THIS_ UINT iBuffer, ID3DX10MeshBuffer **ppVertexBuffer) PURE;
130 
131  STDMETHOD(SetIndexData)(THIS_ CONST void *pData, UINT cIndices) PURE;
132  STDMETHOD(GetIndexBuffer)(THIS_ ID3DX10MeshBuffer **ppIndexBuffer) PURE;
133 
134  STDMETHOD(SetAttributeData)(THIS_ CONST UINT *pData) PURE;
135  STDMETHOD(GetAttributeBuffer)(THIS_ ID3DX10MeshBuffer **ppAttributeBuffer) PURE;
136 
137  STDMETHOD(SetAttributeTable)(THIS_ CONST D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT cAttribTableSize) PURE;
138  STDMETHOD(GetAttributeTable)(THIS_ D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT *pAttribTableSize) PURE;
139 
140  STDMETHOD(GenerateAdjacencyAndPointReps)(THIS_ FLOAT Epsilon) PURE;
141  STDMETHOD(GenerateGSAdjacency)(THIS) PURE;
142 
143  STDMETHOD(SetAdjacencyData)(THIS_ CONST UINT *pAdjacency) PURE;
144  STDMETHOD(GetAdjacencyBuffer)(THIS_ ID3DX10MeshBuffer **ppAdjacency) PURE;
145 
146  STDMETHOD(SetPointRepData)(THIS_ CONST UINT *pPointReps) PURE;
147  STDMETHOD(GetPointRepBuffer)(THIS_ ID3DX10MeshBuffer **ppPointReps) PURE;
148 
149  STDMETHOD(Discard)(THIS_ D3DX10_MESH_DISCARD_FLAGS dwDiscard) PURE;
150  STDMETHOD(CloneMesh)(THIS_ UINT Flags, LPCSTR pPosSemantic, CONST D3D10_INPUT_ELEMENT_DESC *pDesc, UINT DeclCount, ID3DX10Mesh** ppCloneMesh) PURE;
151 
152  STDMETHOD(Optimize)(THIS_ UINT Flags, UINT * pFaceRemap, LPD3D10BLOB *ppVertexRemap) PURE;
153  STDMETHOD(GenerateAttributeBufferFromTable)(THIS) PURE;
154 
155  STDMETHOD(Intersect)(THIS_ D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir,
156  UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits);
157  STDMETHOD(IntersectSubset)(THIS_ UINT AttribId, D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir,
158  UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits);
159 
160  // ID3DX10Mesh - Device functions
161  STDMETHOD(CommitToDevice)(THIS) PURE;
162  STDMETHOD(DrawSubset)(THIS_ UINT AttribId) PURE;
163  STDMETHOD(DrawSubsetInstanced)(THIS_ UINT AttribId, UINT InstanceCount, UINT StartInstanceLocation) PURE;
164 
165  STDMETHOD(GetDeviceVertexBuffer)(THIS_ UINT iBuffer, ID3D10Buffer **ppVertexBuffer) PURE;
166  STDMETHOD(GetDeviceIndexBuffer)(THIS_ ID3D10Buffer **ppIndexBuffer) PURE;
167 };
168 
169 
170 // Flat API
171 #ifdef __cplusplus
172 extern "C" {
173 #endif //__cplusplus
174 
175 HRESULT WINAPI
177  ID3D10Device *pDevice,
178  CONST D3D10_INPUT_ELEMENT_DESC *pDeclaration,
179  UINT DeclCount,
180  LPCSTR pPositionSemantic,
181  UINT VertexCount,
182  UINT FaceCount,
183  UINT Options,
184  ID3DX10Mesh **ppMesh);
185 
186 #ifdef __cplusplus
187 }
188 #endif //__cplusplus
189 
190 
191 // ID3DX10Mesh::Optimize options - upper byte only, lower 3 bytes used from _D3DX10MESH option flags
197  D3DX10_MESHOPT_IGNORE_VERTS = 0x10000000, // optimize faces only, don't touch vertices
198  D3DX10_MESHOPT_DO_NOT_SPLIT = 0x20000000, // do not split vertices shared between attribute groups when attribute sorting
199  D3DX10_MESHOPT_DEVICE_INDEPENDENT = 0x00400000, // Only affects VCache. uses a static known good cache size for all cards
200 
201  // D3DX10_MESHOPT_SHAREVB has been removed, please use D3DX10MESH_VB_SHARE instead
202 
203 };
204 
205 
207 // ID3DXSkinInfo
209 
210 // {420BD604-1C76-4a34-A466-E45D0658A32C}
211 DEFINE_GUID(IID_ID3DX10SkinInfo,
212 0x420bd604, 0x1c76, 0x4a34, 0xa4, 0x66, 0xe4, 0x5d, 0x6, 0x58, 0xa3, 0x2c);
213 
214 // scaling modes for ID3DX10SkinInfo::Compact() & ID3DX10SkinInfo::UpdateMesh()
215 #define D3DX10_SKININFO_NO_SCALING 0
216 #define D3DX10_SKININFO_SCALE_TO_1 1
217 #define D3DX10_SKININFO_SCALE_TO_TOTAL 2
218 
220 {
225 
226 #undef INTERFACE
227 #define INTERFACE ID3DX10SkinInfo
228 
229 typedef struct ID3DX10SkinInfo *LPD3DX10SKININFO;
230 
231 DECLARE_INTERFACE_(ID3DX10SkinInfo, IUnknown)
232 {
233  // IUnknown
234  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
235  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
236  STDMETHOD_(ULONG, Release)(THIS) PURE;
237 
238  STDMETHOD_(UINT , GetNumVertices)(THIS) PURE;
239  STDMETHOD_(UINT , GetNumBones)(THIS) PURE;
240  STDMETHOD_(UINT , GetMaxBoneInfluences)(THIS) PURE;
241 
242  STDMETHOD(AddVertices)(THIS_ UINT Count) PURE;
243  STDMETHOD(RemapVertices)(THIS_ UINT NewVertexCount, UINT *pVertexRemap) PURE;
244 
245  STDMETHOD(AddBones)(THIS_ UINT Count) PURE;
246  STDMETHOD(RemoveBone)(THIS_ UINT Index) PURE;
247  STDMETHOD(RemapBones)(THIS_ UINT NewBoneCount, UINT *pBoneRemap) PURE;
248 
249  STDMETHOD(AddBoneInfluences)(THIS_ UINT BoneIndex, UINT InfluenceCount, UINT *pIndices, float *pWeights) PURE;
250  STDMETHOD(ClearBoneInfluences)(THIS_ UINT BoneIndex) PURE;
251  STDMETHOD_(UINT , GetBoneInfluenceCount)(THIS_ UINT BoneIndex) PURE;
252  STDMETHOD(GetBoneInfluences)(THIS_ UINT BoneIndex, UINT Offset, UINT Count, UINT *pDestIndices, float *pDestWeights) PURE;
253  STDMETHOD(FindBoneInfluenceIndex)(THIS_ UINT BoneIndex, UINT VertexIndex, UINT *pInfluenceIndex) PURE;
254  STDMETHOD(SetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float Weight) PURE;
255  STDMETHOD(GetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float *pWeight) PURE;
256 
257  STDMETHOD(Compact)(THIS_ UINT MaxPerVertexInfluences, UINT ScaleMode, float MinWeight) PURE;
258  STDMETHOD(DoSoftwareSkinning)(UINT StartVertex, UINT VertexCount, void *pSrcVertices, UINT SrcStride, void *pDestVertices, UINT DestStride, D3DXMATRIX *pBoneMatrices, D3DXMATRIX *pInverseTransposeBoneMatrices, D3DX10_SKINNING_CHANNEL *pChannelDescs, UINT NumChannels) PURE;
259 };
260 
261 #ifdef __cplusplus
262 extern "C" {
263 #endif //__cplusplus
264 
265 HRESULT WINAPI
267 
268 #ifdef __cplusplus
269 }
270 #endif //__cplusplus
271 
273 {
283 
284 #endif //__D3DX10MESH_H__
285 
286 
Definition: d3dx10mesh.h:195
struct _D3DX10_SKINNING_CHANNEL D3DX10_SKINNING_CHANNEL
Definition: d3dx10mesh.h:62
UINT VertexStart
Definition: d3dx10mesh.h:52
FLOAT Normal
Definition: d3dx10mesh.h:73
Definition: d3d8types.h:77
struct _D3DX10_WELD_EPSILONS D3DX10_WELD_EPSILONS
Definition: d3d8types.h:48
Definition: glslang_tab.cpp:129
Definition: d3dx10mesh.h:198
FLOAT TessFactor
Definition: d3dx10mesh.h:80
FLOAT Dist
Definition: d3dx10mesh.h:90
FLOAT Position
Definition: d3dx10mesh.h:70
FLOAT U
Definition: d3dx10mesh.h:88
GLfixed GLfixed x2
Definition: glsym_gl.h:1051
FLOAT Texcoord[8]
Definition: d3dx10mesh.h:77
Definition: d3dx10mesh.h:63
FLOAT Specular
Definition: d3dx10mesh.h:75
_D3DX10_MESHOPT
Definition: d3dx10mesh.h:192
UINT VertexCount
Definition: d3dx10mesh.h:53
interface ID3D10Buffer ID3D10Buffer
Definition: d3d10.h:84
HRESULT WINAPI D3DX10CreateSkinInfo(LPD3DX10SKININFO *ppSkinInfo)
typedef HRESULT(WINAPI *PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(_In_ const D3D12_ROOT_SIGNATURE_DESC *pRootSignature
FLOAT PSize
Definition: d3dx10mesh.h:74
interface ID3D10Blob ID3D10Blob
Definition: d3dcommon.h:44
UINT FaceIndex
Definition: d3dx10mesh.h:87
UINT DestOffset
Definition: d3dx10mesh.h:222
Definition: d3dx10mesh.h:43
Definition: d3dx10mesh.h:68
FLOAT Diffuse
Definition: d3dx10mesh.h:76
_D3DX10_MESH_DISCARD_FLAGS
Definition: d3dx10mesh.h:58
Definition: d3dx10mesh.h:193
struct _D3DX10_INTERSECT_INFO D3DX10_INTERSECT_INFO
DECLARE_INTERFACE_(ID3DX10MeshBuffer, IUnknown)
Definition: d3dx10mesh.h:97
HRESULT WINAPI D3DX10CreateMesh(ID3D10Device *pDevice, CONST D3D10_INPUT_ELEMENT_DESC *pDeclaration, UINT DeclCount, LPCSTR pPositionSemantic, UINT VertexCount, UINT FaceCount, UINT Options, ID3DX10Mesh **ppMesh)
Definition: d3dx10mesh.h:42
Definition: d3dx10mesh.h:196
struct _D3DX10_ATTRIBUTE_WEIGHTS D3DX10_ATTRIBUTE_WEIGHTS
Definition: d3dx10mesh.h:197
FLOAT Position
Definition: d3dx10mesh.h:274
FLOAT Specular
Definition: d3dx10mesh.h:278
Definition: d3dx10mesh.h:194
FLOAT Normal
Definition: d3dx10mesh.h:276
Definition: d3dx10mesh.h:64
struct _D3DX10_INTERSECT_INFO * LPD3DX10_INTERSECT_INFO
UINT AttribId
Definition: d3dx10mesh.h:49
Definition: d3d10.h:644
struct _D3DX10_ATTRIBUTE_RANGE D3DX10_ATTRIBUTE_RANGE
Definition: d3dx10mesh.h:219
FLOAT Tangent
Definition: d3dx10mesh.h:78
Definition: d3dx10mesh.h:47
interface ID3D10Device ID3D10Device
Definition: d3d10.h:203
struct ID3DX10SkinInfo * LPD3DX10SKININFO
Definition: d3dx10mesh.h:229
static INLINE ULONG Release(void *object)
Definition: dxgi_common.h:253
Definition: d3dx10mesh.h:199
unsigned int BOOL
Definition: gctypes.h:51
FLOAT Binormal
Definition: d3dx10mesh.h:79
Definition: d3dx10mesh.h:61
UINT FaceStart
Definition: d3dx10mesh.h:50
Definition: d3dx10mesh.h:85
FLOAT V
Definition: d3dx10mesh.h:89
Definition: glslang_tab.cpp:136
BOOL IsNormal
Definition: d3dx10mesh.h:223
Definition: glslang_tab.cpp:133
UINT FaceCount
Definition: d3dx10mesh.h:51
interface ID3D10Blob * LPD3D10BLOB
Definition: d3dcommon.h:410
FLOAT Diffuse
Definition: d3dx10mesh.h:277
Definition: d3dx10mesh.h:272
D3DX10_WELD_EPSILONS * LPD3DX10_WELD_EPSILONS
Definition: d3dx10mesh.h:83
Definition: d3dx10mesh.h:60
FLOAT Binormal
Definition: d3dx10mesh.h:281
FLOAT Texcoord[8]
Definition: d3dx10mesh.h:279
UINT SrcOffset
Definition: d3dx10mesh.h:221
FLOAT BlendWeights
Definition: d3dx10mesh.h:72
enum _D3DX10_MESH_DISCARD_FLAGS D3DX10_MESH_DISCARD_FLAGS
int Options
Definition: StandAlone.cpp:153
_D3DX10_MESH
Definition: d3dx10mesh.h:41
D3DX10_ATTRIBUTE_RANGE * LPD3DX10_ATTRIBUTE_RANGE
Definition: d3dx10mesh.h:56
DEFINE_GUID(IID_ID3DX10BaseMesh, 0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30)
FLOAT Tangent
Definition: d3dx10mesh.h:280
FLOAT Boundary
Definition: d3dx10mesh.h:275
struct _D3DX10_ATTRIBUTE_WEIGHTS * LPD3DX10_ATTRIBUTE_WEIGHTS