RetroArch
d3dx9shader.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) Microsoft Corporation. All rights reserved.
4  *
5  * File: d3dx9shader.h
6  * Content: D3DX Shader APIs
7  *
8  */
9 
10 #include "d3dx9.h"
11 
12 #ifndef __D3DX9SHADER_H__
13 #define __D3DX9SHADER_H__
14 
15 #define D3DXTX_VERSION(_Major,_Minor) (('T' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor))
16 
17 #define D3DXSHADER_DEBUG (1 << 0)
18 #define D3DXSHADER_SKIPVALIDATION (1 << 1)
19 #define D3DXSHADER_SKIPOPTIMIZATION (1 << 2)
20 #define D3DXSHADER_PACKMATRIX_ROWMAJOR (1 << 3)
21 #define D3DXSHADER_PACKMATRIX_COLUMNMAJOR (1 << 4)
22 #define D3DXSHADER_PARTIALPRECISION (1 << 5)
23 #define D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT (1 << 6)
24 #define D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT (1 << 7)
25 #define D3DXSHADER_NO_PRESHADER (1 << 8)
26 #define D3DXSHADER_AVOID_FLOW_CONTROL (1 << 9)
27 #define D3DXSHADER_PREFER_FLOW_CONTROL (1 << 10)
28 #define D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
29 #define D3DXSHADER_IEEE_STRICTNESS (1 << 13)
30 #define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL (1 << 16)
31 
32 /* optimization level flags */
33 #define D3DXSHADER_OPTIMIZATION_LEVEL0 (1 << 14)
34 #define D3DXSHADER_OPTIMIZATION_LEVEL1 0
35 #define D3DXSHADER_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))
36 #define D3DXSHADER_OPTIMIZATION_LEVEL3 (1 << 15)
37 
38 /*
39  * D3DXCONSTTABLE flags:
40  */
41 
42 #define D3DXCONSTTABLE_LARGEADDRESSAWARE (1 << 17)
43 
44 #ifndef D3DXFX_LARGEADDRESS_HANDLE
45 typedef LPCSTR D3DXHANDLE;
46 #else
47 typedef UINT_PTR D3DXHANDLE;
48 #endif
50 
51 typedef struct _D3DXMACRO
52 {
53  LPCSTR Name;
54  LPCSTR Definition;
55 
57 
58 
59 /*
60  * D3DXSEMANTIC:
61  */
62 
63 typedef struct _D3DXSEMANTIC
64 {
67 
69 
70 
71 
72 /*
73  * D3DXREGISTER_SET:
74  */
75 
76 typedef enum _D3DXREGISTER_SET
77 {
82 
83  /* force 32-bit size enum */
84  D3DXRS_FORCE_DWORD = 0x7fffffff
85 
87 
88 
89 /*
90  * D3DXPARAMETER_CLASS:
91  */
92 
94 {
101 
102  /* force 32-bit size enum */
103  D3DXPC_FORCE_DWORD = 0x7fffffff
104 
106 
107 
108 /*
109  * D3DXPARAMETER_TYPE:
110  */
111 
113 {
134 
135  /* force 32-bit size enum */
136  D3DXPT_FORCE_DWORD = 0x7fffffff
137 
139 
140 
141 /*
142  * D3DXCONSTANTTABLE_DESC:
143  */
144 
146 {
147  LPCSTR Creator; /* Creator string */
148  DWORD Version; /* Shader version */
149  UINT Constants; /* Number of constants */
150 
152 
153 
154 /*
155  * D3DXCONSTANT_DESC:
156  */
157 
158 typedef struct _D3DXCONSTANT_DESC
159 {
160  LPCSTR Name; /* Constant name */
161 
162  D3DXREGISTER_SET RegisterSet; /* Register set */
163  UINT RegisterIndex; /* Register index */
164  UINT RegisterCount; /* Number of registers occupied */
165 
167  D3DXPARAMETER_TYPE Type; /* Component type */
168 
169  UINT Rows; /* Number of rows */
170  UINT Columns; /* Number of columns */
171  UINT Elements; /* Number of array elements */
172  UINT StructMembers; /* Number of structure member sub-parameters */
173 
174  UINT Bytes; /* Data size, in bytes */
175  LPCVOID DefaultValue; /* Pointer to default value */
176 
178 
179 
180 
181 /*
182  * ID3DXConstantTable:
183  */
184 
187 
188 /* {AB3C758F-093E-4356-B762-4DB18F1B3A01} */
189 DEFINE_GUID(IID_ID3DXConstantTable,
190 0xab3c758f, 0x93e, 0x4356, 0xb7, 0x62, 0x4d, 0xb1, 0x8f, 0x1b, 0x3a, 0x1);
191 
192 
193 #undef INTERFACE
194 #define INTERFACE ID3DXConstantTable
195 
197 {
198  /* IUnknown */
199  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
200  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
201  STDMETHOD_(ULONG, Release)(THIS) PURE;
202 
203  /* Buffer */
204  STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
205  STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
206 
207  /* Descs */
208  STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE;
209  STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE;
210  STDMETHOD_(UINT, GetSamplerIndex)(THIS_ D3DXHANDLE hConstant) PURE;
211 
212  /* Handle operations */
213  STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
214  STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE;
215  STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
216 
217  /* Set Constants */
218  STDMETHOD(SetDefaults)(THIS_ LPDIRECT3DDEVICE9 pDevice) PURE;
219  STDMETHOD(SetValue)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, LPCVOID pData, UINT Bytes) PURE;
220  STDMETHOD(SetBool)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, BOOL b) PURE;
221  STDMETHOD(SetBoolArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST BOOL* pb, UINT Count) PURE;
222  STDMETHOD(SetInt)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, INT n) PURE;
223  STDMETHOD(SetIntArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST INT* pn, UINT Count) PURE;
224  STDMETHOD(SetFloat)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, FLOAT f) PURE;
225  STDMETHOD(SetFloatArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST FLOAT* pf, UINT Count) PURE;
226  STDMETHOD(SetVector)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector) PURE;
227  STDMETHOD(SetVectorArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
228  STDMETHOD(SetMatrix)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE;
229  STDMETHOD(SetMatrixArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
230  STDMETHOD(SetMatrixPointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
231  STDMETHOD(SetMatrixTranspose)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE;
232  STDMETHOD(SetMatrixTransposeArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
233  STDMETHOD(SetMatrixTransposePointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
234 };
235 
236 /*
237  * ID3DXTextureShader:
238  */
239 
240 typedef interface ID3DXTextureShader ID3DXTextureShader;
242 
243 /* {3E3D67F8-AA7A-405d-A857-BA01D4758426} */
244 DEFINE_GUID(IID_ID3DXTextureShader,
245 0x3e3d67f8, 0xaa7a, 0x405d, 0xa8, 0x57, 0xba, 0x1, 0xd4, 0x75, 0x84, 0x26);
246 
247 #undef INTERFACE
248 #define INTERFACE ID3DXTextureShader
249 
251 {
252  /* IUnknown */
253  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
254  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
255  STDMETHOD_(ULONG, Release)(THIS) PURE;
256 
257  /* Gets */
258  STDMETHOD(GetFunction)(THIS_ LPD3DXBUFFER *ppFunction) PURE;
259  STDMETHOD(GetConstantBuffer)(THIS_ LPD3DXBUFFER *ppConstantBuffer) PURE;
260 
261  /* Descs */
262  STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE;
263  STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE;
264 
265  /* Handle operations */
266  STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
267  STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE;
268  STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
269 
270  /* Set Constants */
271  STDMETHOD(SetDefaults)(THIS) PURE;
272  STDMETHOD(SetValue)(THIS_ D3DXHANDLE hConstant, LPCVOID pData, UINT Bytes) PURE;
273  STDMETHOD(SetBool)(THIS_ D3DXHANDLE hConstant, BOOL b) PURE;
274  STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hConstant, CONST BOOL* pb, UINT Count) PURE;
275  STDMETHOD(SetInt)(THIS_ D3DXHANDLE hConstant, INT n) PURE;
276  STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hConstant, CONST INT* pn, UINT Count) PURE;
277  STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hConstant, FLOAT f) PURE;
278  STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hConstant, CONST FLOAT* pf, UINT Count) PURE;
279  STDMETHOD(SetVector)(THIS_ D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector) PURE;
280  STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
281  STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE;
282  STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
283  STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
284  STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE;
285  STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
286  STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
287 };
288 
289 typedef enum _D3DXINCLUDE_TYPE
290 {
293 
294  /* force 32-bit size enum */
295  D3DXINC_FORCE_DWORD = 0x7fffffff
296 
298 
299 typedef interface ID3DXInclude ID3DXInclude;
300 typedef interface ID3DXInclude *LPD3DXINCLUDE;
301 
302 #undef INTERFACE
303 #define INTERFACE ID3DXInclude
304 
306 {
307  STDMETHOD(Open)(THIS_ D3DXINCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE;
308  STDMETHOD(Close)(THIS_ LPCVOID pData) PURE;
309 };
310 
311 
312 /*
313  * APIs
314  */
315 
316 #ifdef __cplusplus
317 extern "C" {
318 #endif
319 
320 HRESULT WINAPI
322  LPCSTR pSrcFile,
323  CONST D3DXMACRO* pDefines,
324  LPD3DXINCLUDE pInclude,
325  DWORD Flags,
326  LPD3DXBUFFER* ppShader,
327  LPD3DXBUFFER* ppErrorMsgs);
328 
329 HRESULT WINAPI
331  LPCWSTR pSrcFile,
332  CONST D3DXMACRO* pDefines,
333  LPD3DXINCLUDE pInclude,
334  DWORD Flags,
335  LPD3DXBUFFER* ppShader,
336  LPD3DXBUFFER* ppErrorMsgs);
337 
338 #ifdef UNICODE
339 #define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileW
340 #else
341 #define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileA
342 #endif
343 
344 
345 HRESULT WINAPI
347  HMODULE hSrcModule,
348  LPCSTR pSrcResource,
349  CONST D3DXMACRO* pDefines,
350  LPD3DXINCLUDE pInclude,
351  DWORD Flags,
352  LPD3DXBUFFER* ppShader,
353  LPD3DXBUFFER* ppErrorMsgs);
354 
355 HRESULT WINAPI
357  HMODULE hSrcModule,
358  LPCWSTR pSrcResource,
359  CONST D3DXMACRO* pDefines,
360  LPD3DXINCLUDE pInclude,
361  DWORD Flags,
362  LPD3DXBUFFER* ppShader,
363  LPD3DXBUFFER* ppErrorMsgs);
364 
365 #ifdef UNICODE
366 #define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceW
367 #else
368 #define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceA
369 #endif
370 
371 
372 HRESULT WINAPI
374  LPCSTR pSrcData,
375  UINT SrcDataLen,
376  CONST D3DXMACRO* pDefines,
377  LPD3DXINCLUDE pInclude,
378  DWORD Flags,
379  LPD3DXBUFFER* ppShader,
380  LPD3DXBUFFER* ppErrorMsgs);
381 
382 HRESULT WINAPI
384  LPCSTR pSrcFile,
385  CONST D3DXMACRO* pDefines,
386  LPD3DXINCLUDE pInclude,
387  LPCSTR pFunctionName,
388  LPCSTR pProfile,
389  DWORD Flags,
390  LPD3DXBUFFER* ppShader,
391  LPD3DXBUFFER* ppErrorMsgs,
392  LPD3DXCONSTANTTABLE* ppConstantTable);
393 
394 HRESULT WINAPI
396  LPCWSTR pSrcFile,
397  CONST D3DXMACRO* pDefines,
398  LPD3DXINCLUDE pInclude,
399  LPCSTR pFunctionName,
400  LPCSTR pProfile,
401  DWORD Flags,
402  LPD3DXBUFFER* ppShader,
403  LPD3DXBUFFER* ppErrorMsgs,
404  LPD3DXCONSTANTTABLE* ppConstantTable);
405 
406 #ifdef UNICODE
407 #define D3DXCompileShaderFromFile D3DXCompileShaderFromFileW
408 #else
409 #define D3DXCompileShaderFromFile D3DXCompileShaderFromFileA
410 #endif
411 
412 
413 HRESULT WINAPI
415  HMODULE hSrcModule,
416  LPCSTR pSrcResource,
417  CONST D3DXMACRO* pDefines,
418  LPD3DXINCLUDE pInclude,
419  LPCSTR pFunctionName,
420  LPCSTR pProfile,
421  DWORD Flags,
422  LPD3DXBUFFER* ppShader,
423  LPD3DXBUFFER* ppErrorMsgs,
424  LPD3DXCONSTANTTABLE* ppConstantTable);
425 
426 HRESULT WINAPI
428  HMODULE hSrcModule,
429  LPCWSTR pSrcResource,
430  CONST D3DXMACRO* pDefines,
431  LPD3DXINCLUDE pInclude,
432  LPCSTR pFunctionName,
433  LPCSTR pProfile,
434  DWORD Flags,
435  LPD3DXBUFFER* ppShader,
436  LPD3DXBUFFER* ppErrorMsgs,
437  LPD3DXCONSTANTTABLE* ppConstantTable);
438 
439 #ifdef UNICODE
440 #define D3DXCompileShaderFromResource D3DXCompileShaderFromResourceW
441 #else
442 #define D3DXCompileShaderFromResource D3DXCompileShaderFromResourceA
443 #endif
444 
445 
446 HRESULT WINAPI
448  LPCSTR pSrcData,
449  UINT SrcDataLen,
450  CONST D3DXMACRO* pDefines,
451  LPD3DXINCLUDE pInclude,
452  LPCSTR pFunctionName,
453  LPCSTR pProfile,
454  DWORD Flags,
455  LPD3DXBUFFER* ppShader,
456  LPD3DXBUFFER* ppErrorMsgs,
457  LPD3DXCONSTANTTABLE* ppConstantTable);
458 
459 HRESULT WINAPI
461  CONST DWORD* pShader,
462  BOOL EnableColorCode,
463  LPCSTR pComments,
464  LPD3DXBUFFER* ppDisassembly);
465 
466 LPCSTR WINAPI
468  LPDIRECT3DDEVICE9 pDevice);
469 
470 LPCSTR WINAPI
472  LPDIRECT3DDEVICE9 pDevice);
473 
474 HRESULT WINAPI
476  CONST DWORD* pFunction,
477  DWORD FourCC,
478  LPCVOID* ppData,
479  UINT* pSizeInBytes);
480 
481 UINT WINAPI
483  CONST DWORD* pFunction);
484 
485 DWORD WINAPI
487  CONST DWORD* pFunction);
488 
489 HRESULT WINAPI
491  CONST DWORD* pFunction,
492  D3DXSEMANTIC* pSemantics,
493  UINT* pCount);
494 
495 HRESULT WINAPI
497  CONST DWORD* pFunction,
498  D3DXSEMANTIC* pSemantics,
499  UINT* pCount);
500 
501 HRESULT WINAPI
503  CONST DWORD* pFunction,
504  LPCSTR* pSamplers,
505  UINT* pCount);
506 
507 HRESULT WINAPI
509  CONST DWORD* pFunction,
510  LPD3DXCONSTANTTABLE* ppConstantTable);
511 
512 HRESULT WINAPI
514  CONST DWORD* pFunction,
515  DWORD Flags,
516  LPD3DXCONSTANTTABLE* ppConstantTable);
517 
518 HRESULT WINAPI
520  CONST DWORD* pFunction,
521  LPD3DXTEXTURESHADER* ppTextureShader);
522 
523 HRESULT WINAPI
525  LPCSTR pSrcFile,
526  CONST D3DXMACRO* pDefines,
527  LPD3DXINCLUDE pInclude,
528  LPD3DXBUFFER* ppShaderText,
529  LPD3DXBUFFER* ppErrorMsgs);
530 
531 HRESULT WINAPI
533  LPCWSTR pSrcFile,
534  CONST D3DXMACRO* pDefines,
535  LPD3DXINCLUDE pInclude,
536  LPD3DXBUFFER* ppShaderText,
537  LPD3DXBUFFER* ppErrorMsgs);
538 
539 #ifdef UNICODE
540 #define D3DXPreprocessShaderFromFile D3DXPreprocessShaderFromFileW
541 #else
542 #define D3DXPreprocessShaderFromFile D3DXPreprocessShaderFromFileA
543 #endif
544 
545 HRESULT WINAPI
547  HMODULE hSrcModule,
548  LPCSTR pSrcResource,
549  CONST D3DXMACRO* pDefines,
550  LPD3DXINCLUDE pInclude,
551  LPD3DXBUFFER* ppShaderText,
552  LPD3DXBUFFER* ppErrorMsgs);
553 
554 HRESULT WINAPI
556  HMODULE hSrcModule,
557  LPCWSTR pSrcResource,
558  CONST D3DXMACRO* pDefines,
559  LPD3DXINCLUDE pInclude,
560  LPD3DXBUFFER* ppShaderText,
561  LPD3DXBUFFER* ppErrorMsgs);
562 
563 #ifdef UNICODE
564 #define D3DXPreprocessShaderFromResource D3DXPreprocessShaderFromResourceW
565 #else
566 #define D3DXPreprocessShaderFromResource D3DXPreprocessShaderFromResourceA
567 #endif
568 
569 HRESULT WINAPI
571  LPCSTR pSrcData,
572  UINT SrcDataSize,
573  CONST D3DXMACRO* pDefines,
574  LPD3DXINCLUDE pInclude,
575  LPD3DXBUFFER* ppShaderText,
576  LPD3DXBUFFER* ppErrorMsgs);
577 
578 
579 #ifdef __cplusplus
580 }
581 #endif
582 
583 
584 /*
585  * Shader comment block layouts
586  */
587 
588 /*
589  * D3DXSHADER_CONSTANTTABLE:
590  * -------------------------
591  * Shader constant information; included as an CTAB comment block inside
592  * shaders. All offsets are BYTE offsets from start of CONSTANTTABLE struct.
593  * Entries in the table are sorted by Name in ascending order.
594  */
595 
597 {
598  DWORD Size; /* sizeof(D3DXSHADER_CONSTANTTABLE) */
599  DWORD Creator; /* LPCSTR offset */
600  DWORD Version; /* shader version */
601  DWORD Constants; /* number of constants */
602  DWORD ConstantInfo; /* D3DXSHADER_CONSTANTINFO[Constants] offset */
603  DWORD Flags; /* flags shader was compiled with */
604  DWORD Target; /* LPCSTR offset */
605 
607 
608 
610 {
611  DWORD Name; /* LPCSTR offset */
612  WORD RegisterSet; /* D3DXREGISTER_SET */
613  WORD RegisterIndex; /* register number */
614  WORD RegisterCount; /* number of registers */
615  WORD Reserved; /* reserved */
616  DWORD TypeInfo; /* D3DXSHADER_TYPEINFO offset */
617  DWORD DefaultValue; /* offset of default value */
618 
620 
621 
622 typedef struct _D3DXSHADER_TYPEINFO
623 {
624  WORD Class; /* D3DXPARAMETER_CLASS */
625  WORD Type; /* D3DXPARAMETER_TYPE */
626  WORD Rows; /* number of rows (matrices) */
627  WORD Columns; /* number of columns (vectors and matrices) */
628  WORD Elements; /* array dimension */
629  WORD StructMembers; /* number of struct members */
630  DWORD StructMemberInfo; /* D3DXSHADER_STRUCTMEMBERINFO[Members] offset */
631 
633 
634 
636 {
637  DWORD Name; /* LPCSTR offset */
638  DWORD TypeInfo; /* D3DXSHADER_TYPEINFO offset */
639 
641 
642 
643 
644 #endif /* __D3DX9SHADER_H__ */
Definition: d3dx9shader.h:119
Definition: d3dx9shader.h:121
Definition: d3dx9shader.h:100
struct _D3DXSHADER_CONSTANTINFO D3DXSHADER_CONSTANTINFO
enum _D3DXINCLUDE_TYPE D3DXINCLUDE_TYPE
HRESULT WINAPI D3DXAssembleShaderFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER *ppShader, LPD3DXBUFFER *ppErrorMsgs)
D3DXPARAMETER_CLASS Class
Definition: d3dx9shader.h:166
interface ID3DXConstantTable * LPD3DXCONSTANTTABLE
Definition: d3dx9shader.h:186
DWORD ConstantInfo
Definition: d3dx9shader.h:602
Definition: d3d8types.h:77
struct _D3DXCONSTANTTABLE_DESC D3DXCONSTANTTABLE_DESC
Definition: d3dx9shader.h:609
Definition: d3dx9shader.h:122
Definition: d3dx9shader.h:127
HRESULT WINAPI D3DXAssembleShader(LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER *ppShader, LPD3DXBUFFER *ppErrorMsgs)
Definition: d3dx9shader.h:129
interface ID3DXTextureShader ID3DXTextureShader
Definition: d3dx9shader.h:234
Definition: d3dx9shader.h:116
Definition: d3dx9shader.h:145
Definition: glslang_tab.cpp:129
struct _D3DXMACRO * LPD3DXMACRO
UINT RegisterIndex
Definition: d3dx9shader.h:163
enum _D3DXPARAMETER_CLASS D3DXPARAMETER_CLASS
Definition: d3dx9shader.h:95
HRESULT WINAPI D3DXGetShaderConstantTable(CONST DWORD *pFunction, LPD3DXCONSTANTTABLE *ppConstantTable)
HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD *pFunction, DWORD Flags, LPD3DXCONSTANTTABLE *ppConstantTable)
DWORD Creator
Definition: d3dx9shader.h:599
Definition: d3dx9shader.h:120
Definition: d3dx9shader.h:136
interface ID3DXTextureShader * LPD3DXTEXTURESHADER
Definition: d3dx9shader.h:241
Definition: d3dx9shader.h:125
HRESULT WINAPI D3DXPreprocessShaderFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, LPD3DXBUFFER *ppShaderText, LPD3DXBUFFER *ppErrorMsgs)
Definition: d3dx9shader.h:635
Definition: d3dx9shader.h:132
DECLARE_INTERFACE(ID3DXInclude)
Definition: d3dx9shader.h:305
GLfloat f
Definition: glext.h:8207
WORD Columns
Definition: d3dx9shader.h:627
struct _D3DXCONSTANT_DESC * LPD3DXCONSTANT_DESC
struct _D3DXMACRO D3DXMACRO
UINT UsageIndex
Definition: d3dx9shader.h:66
enum _D3DXPARAMETER_CLASS * LPD3DXPARAMETER_CLASS
struct _D3DXSHADER_TYPEINFO D3DXSHADER_TYPEINFO
LPCSTR Definition
Definition: d3dx9shader.h:54
typedef HRESULT(WINAPI *PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(_In_ const D3D12_ROOT_SIGNATURE_DESC *pRootSignature
HRESULT WINAPI D3DXAssembleShaderFromFileW(LPCWSTR pSrcFile, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER *ppShader, LPD3DXBUFFER *ppErrorMsgs)
interface ID3DXInclude ID3DXInclude
Definition: d3dx9shader.h:299
struct _D3DXSHADER_CONSTANTTABLE * LPD3DXSHADER_CONSTANTTABLE
D3DXHANDLE * LPD3DXHANDLE
Definition: d3dx9shader.h:49
HRESULT WINAPI D3DXAssembleShaderFromFileA(LPCSTR pSrcFile, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER *ppShader, LPD3DXBUFFER *ppErrorMsgs)
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
Definition: d3dx9shader.h:124
Definition: d3dx9shader.h:78
enum _D3DXPARAMETER_TYPE D3DXPARAMETER_TYPE
HRESULT WINAPI D3DXGetShaderOutputSemantics(CONST DWORD *pFunction, D3DXSEMANTIC *pSemantics, UINT *pCount)
DECLARE_INTERFACE_(ID3DXConstantTable, IUnknown)
Definition: d3dx9shader.h:196
Definition: d3dx9shader.h:128
struct _D3DXSHADER_CONSTANTINFO * LPD3DXSHADER_CONSTANTINFO
DWORD Name
Definition: d3dx9shader.h:637
UINT Constants
Definition: d3dx9shader.h:149
Definition: d3dx8math.h:127
UINT Columns
Definition: d3dx9shader.h:170
struct _D3DXSHADER_STRUCTMEMBERINFO D3DXSHADER_STRUCTMEMBERINFO
Definition: d3dx9shader.h:123
Definition: d3dx9shader.h:292
LPCSTR Creator
Definition: d3dx9shader.h:147
HRESULT WINAPI D3DXCreateTextureShader(CONST DWORD *pFunction, LPD3DXTEXTURESHADER *ppTextureShader)
Definition: d3dx9shader.h:81
Definition: d3dx9shader.h:295
Definition: d3dx9shader.h:117
UINT Bytes
Definition: d3dx9shader.h:174
struct _D3DXCONSTANT_DESC D3DXCONSTANT_DESC
Definition: d3dx9shader.h:79
struct _D3DXSEMANTIC D3DXSEMANTIC
#define UINT_PTR
Definition: Common.h:66
DWORD Version
Definition: d3dx9shader.h:148
HRESULT WINAPI D3DXDisassembleShader(CONST DWORD *pShader, BOOL EnableColorCode, LPCSTR pComments, LPD3DXBUFFER *ppDisassembly)
HRESULT WINAPI D3DXPreprocessShaderFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, LPD3DXBUFFER *ppShaderText, LPD3DXBUFFER *ppErrorMsgs)
DWORD TypeInfo
Definition: d3dx9shader.h:638
DWORD StructMemberInfo
Definition: d3dx9shader.h:630
Definition: d3dx9shader.h:115
LPCSTR Name
Definition: d3dx9shader.h:53
DWORD DefaultValue
Definition: d3dx9shader.h:617
static bool Open(FileStreamType &fs, const char *filename)
Definition: istreamwrappertest.cpp:106
HRESULT WINAPI D3DXPreprocessShaderFromFileW(LPCWSTR pSrcFile, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, LPD3DXBUFFER *ppShaderText, LPD3DXBUFFER *ppErrorMsgs)
HRESULT WINAPI D3DXCompileShaderFromFileW(LPCWSTR pSrcFile, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER *ppShader, LPD3DXBUFFER *ppErrorMsgs, LPD3DXCONSTANTTABLE *ppConstantTable)
DWORD Constants
Definition: d3dx9shader.h:601
Definition: d3dx9shader.h:97
Definition: d3dx9shader.h:84
WORD Reserved
Definition: d3dx9shader.h:615
interface ID3DXInclude * LPD3DXINCLUDE
Definition: d3dx9shader.h:300
LPCSTR D3DXHANDLE
Definition: d3dx9shader.h:45
Definition: d3dx9shader.h:131
DEFINE_GUID(IID_ID3DXConstantTable, 0xab3c758f, 0x93e, 0x4356, 0xb7, 0x62, 0x4d, 0xb1, 0x8f, 0x1b, 0x3a, 0x1)
Definition: d3dx9shader.h:126
HRESULT WINAPI D3DXFindShaderComment(CONST DWORD *pFunction, DWORD FourCC, LPCVOID *ppData, UINT *pSizeInBytes)
UINT StructMembers
Definition: d3dx9shader.h:172
UINT Usage
Definition: d3dx9shader.h:65
WORD Rows
Definition: d3dx9shader.h:626
HRESULT WINAPI D3DXPreprocessShader(LPCSTR pSrcData, UINT SrcDataSize, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, LPD3DXBUFFER *ppShaderText, LPD3DXBUFFER *ppErrorMsgs)
HRESULT WINAPI D3DXAssembleShaderFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER *ppShader, LPD3DXBUFFER *ppErrorMsgs)
enum _D3DXINCLUDE_TYPE * LPD3DXINCLUDE_TYPE
HRESULT WINAPI D3DXGetShaderInputSemantics(CONST DWORD *pFunction, D3DXSEMANTIC *pSemantics, UINT *pCount)
Definition: d3dx9shader.h:130
DWORD Size
Definition: d3dx9shader.h:598
D3DXREGISTER_SET RegisterSet
Definition: d3dx9shader.h:162
HRESULT WINAPI D3DXCompileShader(LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER *ppShader, LPD3DXBUFFER *ppErrorMsgs, LPD3DXCONSTANTTABLE *ppConstantTable)
Definition: d3dx9shader.h:99
Definition: d3dx9shader.h:96
HRESULT WINAPI D3DXCompileShaderFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER *ppShader, LPD3DXBUFFER *ppErrorMsgs, LPD3DXCONSTANTTABLE *ppConstantTable)
WORD RegisterIndex
Definition: d3dx9shader.h:613
struct _D3DXSHADER_CONSTANTTABLE D3DXSHADER_CONSTANTTABLE
static INLINE ULONG Release(void *object)
Definition: dxgi_common.h:253
Definition: d3dx9shader.h:596
struct _D3DXSEMANTIC * LPD3DXSEMANTIC
DWORD TypeInfo
Definition: d3dx9shader.h:616
unsigned int BOOL
Definition: gctypes.h:51
WORD StructMembers
Definition: d3dx9shader.h:629
HRESULT WINAPI D3DXCompileShaderFromFileA(LPCSTR pSrcFile, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER *ppShader, LPD3DXBUFFER *ppErrorMsgs, LPD3DXCONSTANTTABLE *ppConstantTable)
struct IDirect3DDevice9 * LPDIRECT3DDEVICE9
Definition: d3d9.h:442
const char * pBytes
Definition: jsonsax_full.h:735
_D3DXINCLUDE_TYPE
Definition: d3dx9shader.h:289
HRESULT WINAPI D3DXPreprocessShaderFromFileA(LPCSTR pSrcFile, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, LPD3DXBUFFER *ppShaderText, LPD3DXBUFFER *ppErrorMsgs)
Definition: d3dx9shader.h:118
LPCSTR WINAPI D3DXGetVertexShaderProfile(LPDIRECT3DDEVICE9 pDevice)
interface ID3DXBuffer * LPD3DXBUFFER
Definition: d3dx8core.h:29
struct _D3DXCONSTANTTABLE_DESC * LPD3DXCONSTANTTABLE_DESC
Definition: d3dx9shader.h:291
UINT WINAPI D3DXGetShaderSize(CONST DWORD *pFunction)
Definition: glslang_tab.cpp:135
WORD RegisterCount
Definition: d3dx9shader.h:614
WORD Class
Definition: d3dx9shader.h:624
Definition: glslang_tab.cpp:136
WORD RegisterSet
Definition: d3dx9shader.h:612
UINT Rows
Definition: d3dx9shader.h:169
D3DXPARAMETER_TYPE Type
Definition: d3dx9shader.h:167
_D3DXPARAMETER_TYPE
Definition: d3dx9shader.h:112
enum _D3DXREGISTER_SET * LPD3DXREGISTER_SET
UINT RegisterCount
Definition: d3dx9shader.h:164
LPCSTR WINAPI D3DXGetPixelShaderProfile(LPDIRECT3DDEVICE9 pDevice)
Definition: glslang_tab.cpp:133
enum _D3DXREGISTER_SET D3DXREGISTER_SET
_D3DXPARAMETER_CLASS
Definition: d3dx9shader.h:93
DWORD Name
Definition: d3dx9shader.h:611
HRESULT WINAPI D3DXCompileShaderFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, CONST D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER *ppShader, LPD3DXBUFFER *ppErrorMsgs, LPD3DXCONSTANTTABLE *ppConstantTable)
struct _D3DXSHADER_TYPEINFO * LPD3DXSHADER_TYPEINFO
WORD Type
Definition: d3dx9shader.h:625
DWORD Target
Definition: d3dx9shader.h:604
interface ID3DXConstantTable ID3DXConstantTable
Definition: d3dx9shader.h:185
Definition: d3dx9shader.h:63
DWORD Flags
Definition: d3dx9shader.h:603
Definition: d3dx9shader.h:114
DWORD WINAPI D3DXGetShaderVersion(CONST DWORD *pFunction)
WORD Elements
Definition: d3dx9shader.h:628
struct _D3DXSHADER_STRUCTMEMBERINFO * LPD3DXSHADER_STRUCTMEMBERINFO
HRESULT WINAPI D3DXGetShaderSamplers(CONST DWORD *pFunction, LPCSTR *pSamplers, UINT *pCount)
enum _D3DXPARAMETER_TYPE * LPD3DXPARAMETER_TYPE
Definition: d3dx9shader.h:80
GLdouble n
Definition: glext.h:8396
Definition: d3dx9shader.h:133
Definition: d3dx9shader.h:98
Definition: d3dx9shader.h:622
Definition: d3dx9shader.h:103
DWORD Version
Definition: d3dx9shader.h:600
Definition: d3dx9shader.h:158
LPCVOID DefaultValue
Definition: d3dx9shader.h:175
UINT Elements
Definition: d3dx9shader.h:171
LPCSTR Name
Definition: d3dx9shader.h:160
Definition: d3dx9shader.h:51
_D3DXREGISTER_SET
Definition: d3dx9shader.h:76