VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/d3dx9shader.h@ 28475

Last change on this file since 28475 was 28475, checked in by vboxsync, 15 years ago

crOpenGL: update to wine 1.1.43

  • Property svn:eol-style set to native
File size: 16.7 KB
Line 
1/*
2 * Copyright 2008 Luis Busquets
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19/*
20 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
21 * other than GPL or LGPL is available it will apply instead, Sun elects to use only
22 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
23 * a choice of LGPL license versions is made available with the language indicating
24 * that LGPLv2 or any later version may be used, or where a choice of which version
25 * of the LGPL is applied is otherwise unspecified.
26 */
27
28#include "d3dx9.h"
29
30#ifndef __D3DX9SHADER_H__
31#define __D3DX9SHADER_H__
32
33#define D3DXSHADER_DEBUG 0x1
34#define D3DXSHADER_SKIPVALIDATION 0x2
35#define D3DXSHADER_SKIPOPTIMIZATION 0x4
36#define D3DXSHADER_PACKMATRIX_ROWMAJOR 0x8
37#define D3DXSHADER_PACKMATRIX_COLUMNMAJOR 0x10
38#define D3DXSHADER_PARTIALPRECISION 0x20
39#define D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT 0x40
40#define D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT 0x80
41#define D3DXSHADER_NO_PRESHADER 0x100
42#define D3DXSHADER_AVOID_FLOW_CONTROL 0x200
43#define D3DXSHADER_PREFER_FLOW_CONTROL 0x400
44#define D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY 0x1000
45#define D3DXSHADER_IEEE_STRICTNESS 0x2000
46
47#define D3DXSHADER_OPTIMIZATION_LEVEL0 0x4000
48#define D3DXSHADER_OPTIMIZATION_LEVEL1 0x0
49#define D3DXSHADER_OPTIMIZATION_LEVEL2 0xC000
50#define D3DXSHADER_OPTIMIZATION_LEVEL3 0x8000
51
52#define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL 0x10000
53
54typedef LPCSTR D3DXHANDLE;
55
56typedef enum _D3DXREGISTER_SET
57{
58 D3DXRS_BOOL,
59 D3DXRS_INT4,
60 D3DXRS_FLOAT4,
61 D3DXRS_SAMPLER,
62 D3DXRS_FORCE_DWORD = 0x7fffffff
63} D3DXREGISTER_SET, *LPD3DXREGISTER_SET;
64
65typedef enum D3DXPARAMETER_CLASS
66{
67 D3DXPC_SCALAR,
68 D3DXPC_VECTOR,
69 D3DXPC_MATRIX_ROWS,
70 D3DXPC_MATRIX_COLUMNS,
71 D3DXPC_OBJECT,
72 D3DXPC_STRUCT,
73 D3DXPC_FORCE_DWORD = 0x7fffffff,
74} D3DXPARAMETER_CLASS, *LPD3DXPARAMETER_CLASS;
75
76typedef enum D3DXPARAMETER_TYPE
77{
78 D3DXPT_VOID,
79 D3DXPT_BOOL,
80 D3DXPT_INT,
81 D3DXPT_FLOAT,
82 D3DXPT_STRING,
83 D3DXPT_TEXTURE,
84 D3DXPT_TEXTURE1D,
85 D3DXPT_TEXTURE2D,
86 D3DXPT_TEXTURE3D,
87 D3DXPT_TEXTURECUBE,
88 D3DXPT_SAMPLER,
89 D3DXPT_SAMPLER1D,
90 D3DXPT_SAMPLER2D,
91 D3DXPT_SAMPLER3D,
92 D3DXPT_SAMPLERCUBE,
93 D3DXPT_PIXELSHADER,
94 D3DXPT_VERTEXSHADER,
95 D3DXPT_PIXELFRAGMENT,
96 D3DXPT_VERTEXFRAGMENT,
97 D3DXPT_UNSUPPORTED,
98 D3DXPT_FORCE_DWORD = 0x7fffffff,
99} D3DXPARAMETER_TYPE, *LPD3DXPARAMETER_TYPE;
100
101typedef struct _D3DXCONSTANTTABLE_DESC
102{
103 LPCSTR Creator;
104 DWORD Version;
105 UINT Constants;
106} D3DXCONSTANTTABLE_DESC, *LPD3DXCONSTANTTABLE_DESC;
107
108typedef struct _D3DXCONSTANT_DESC
109{
110 LPCSTR Name;
111 D3DXREGISTER_SET RegisterSet;
112 UINT RegisterIndex;
113 UINT RegisterCount;
114 D3DXPARAMETER_CLASS Class;
115 D3DXPARAMETER_TYPE Type;
116 UINT Rows;
117 UINT Columns;
118 UINT Elements;
119 UINT StructMembers;
120 UINT Bytes;
121 LPCVOID DefaultValue;
122} D3DXCONSTANT_DESC, *LPD3DXCONSTANT_DESC;
123
124DEFINE_GUID(IID_ID3DXConstantTable, 0x9dca3190, 0x38b9, 0x4fc3, 0x92, 0xe3, 0x39, 0xc6, 0xdd, 0xfb, 0x35, 0x8b);
125
126#undef INTERFACE
127#define INTERFACE ID3DXConstantTable
128
129DECLARE_INTERFACE_(ID3DXConstantTable, ID3DXBuffer)
130{
131 /*** IUnknown methods ***/
132 STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
133 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
134 STDMETHOD_(ULONG, Release)(THIS) PURE;
135 /*** ID3DXBuffer methods ***/
136 STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
137 STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
138 /*** ID3DXConstantTable methods ***/
139 STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE;
140 STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE;
141 STDMETHOD_(UINT, GetSamplerIndex)(THIS_ D3DXHANDLE hConstant) PURE;
142 STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
143 STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE;
144 STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
145 STDMETHOD(SetDefaults)(THIS_ LPDIRECT3DDEVICE9 pDevice) PURE;
146 STDMETHOD(SetValue)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, LPCVOID pData, UINT Bytes) PURE;
147 STDMETHOD(SetBool)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, BOOL b) PURE;
148 STDMETHOD(SetBoolArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST BOOL* pb, UINT Count) PURE;
149 STDMETHOD(SetInt)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, INT n) PURE;
150 STDMETHOD(SetIntArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST INT* pn, UINT Count) PURE;
151 STDMETHOD(SetFloat)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, FLOAT f) PURE;
152 STDMETHOD(SetFloatArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST FLOAT* pf, UINT Count) PURE;
153 STDMETHOD(SetVector)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector) PURE;
154 STDMETHOD(SetVectorArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
155 STDMETHOD(SetMatrix)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE;
156 STDMETHOD(SetMatrixArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
157 STDMETHOD(SetMatrixPointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
158 STDMETHOD(SetMatrixTranspose)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE;
159 STDMETHOD(SetMatrixTransposeArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
160 STDMETHOD(SetMatrixTransposePointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
161};
162
163#if !defined(__cplusplus) || defined(CINTERFACE)
164/*** IUnknown methods ***/
165#define ID3DXConstantTable_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
166#define ID3DXConstantTable_AddRef(p) (p)->lpVtbl->AddRef(p)
167#define ID3DXConstantTable_Release(p) (p)->lpVtbl->Release(p)
168/*** ID3DXBuffer methods ***/
169#define ID3DXConstantTable_GetBufferPointer(p) (p)->lpVtbl->GetBufferPointer(p)
170#define ID3DXConstantTable_GetBufferSize(p) (p)->lpVtbl->GetBufferSize(p)
171/*** ID3DXConstantTable methods ***/
172#define ID3DXConstantTable_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a)
173#define ID3DXConstantTable_GetConstantDesc(p,a,b,c) (p)->lpVtbl->GetConstantDesc(p,a,b,c)
174#define ID3DXConstantTable_GetSamplerIndex(p,a) (p)->lpVtbl->GetSamplerIndex(p,a)
175#define ID3DXConstantTable_GetConstant(p,a,b) (p)->lpVtbl->GetConstant(p,a,b)
176#define ID3DXConstantTable_GetConstantByName(p,a,b) (p)->lpVtbl->GetConstantByName(p,a,b)
177#define ID3DXConstantTable_GetConstantElement(p,a,b) (p)->lpVtbl->GetConstantElement(p,a,b)
178#define ID3DXConstantTable_SetDefaults(p,a) (p)->lpVtbl->SetDefaults(p,a)
179#define ID3DXConstantTable_SetValue(p,a,b,c,d) (p)->lpVtbl->SetValue(p,a,b,c,d)
180#define ID3DXConstantTable_SetBool(p,a,b,c) (p)->lpVtbl->SetBool(p,a,b,c)
181#define ID3DXConstantTable_SetBoolArray(p,a,b,c,d) (p)->lpVtbl->SetBoolArray(p,a,b,c,d)
182#define ID3DXConstantTable_SetInt(p,a,b,c) (p)->lpVtbl->SetInt(p,a,b,c)
183#define ID3DXConstantTable_SetIntArray(p,a,b,c,d) (p)->lpVtbl->SetIntArray(p,a,b,c,d)
184#define ID3DXConstantTable_SetFloat(p,a,b,c) (p)->lpVtbl->SetFloat(p,a,b,c)
185#define ID3DXConstantTable_SetFloatArray(p,a,b,c,d) (p)->lpVtbl->SetFloatArray(p,a,b,c,d)
186#define ID3DXConstantTable_SetVector(p,a,b,c) (p)->lpVtbl->SetVector(p,a,b,c)
187#define ID3DXConstantTable_SetVectorArray(p,a,b,c,d) (p)->lpVtbl->SetVectorArray(p,a,b,c,d)
188#define ID3DXConstantTable_SetMatrix(p,a,b,c) (p)->lpVtbl->SetMatrix(p,a,b,c)
189#define ID3DXConstantTable_SetMatrixArray(p,a,b,c,d) (p)->lpVtbl->SetMatrixArray(p,a,b,c,d)
190#define ID3DXConstantTable_SetMatrixPointerArray(p,a,b,c,d) (p)->lpVtbl->SetMatrixPointerArray(p,a,b,c,d)
191#define ID3DXConstantTable_SetMatrixTranspose(p,a,b,c) (p)->lpVtbl->SetMatrixTranspose(p,a,b,c)
192#define ID3DXConstantTable_SetMatrixTransposeArray(p,a,b,c,d) (p)->lpVtbl->SetMatrixTransposeArray(p,a,b,c,d)
193#define ID3DXConstantTable_SetMatrixTransposePointerArray(p,a,b,c,d) (p)->lpVtbl->SetMatrixTransposePointerArray(p,a,b,c,d)
194#else
195/*** IUnknown methods ***/
196#define ID3DXConstantTable_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
197#define ID3DXConstantTable_AddRef(p) (p)->AddRef()
198#define ID3DXConstantTable_Release(p) (p)->Release()
199/*** ID3DXBuffer methods ***/
200#define ID3DXConstantTable_GetBufferPointer(p) (p)->GetBufferPointer()
201#define ID3DXConstantTable_GetBufferSize(p) (p)->GetBufferSize()
202/*** ID3DXConstantTable methods ***/
203#define ID3DXConstantTable_GetDesc(p,a) (p)->GetDesc(a)
204#define ID3DXConstantTable_GetConstantDesc(p,a,b,c) (p)->GetConstantDesc(a,b,c)
205#define ID3DXConstantTable_GetSamplerIndex(p,a) (p)->GetConstantDesc(a)
206#define ID3DXConstantTable_GetConstant(p,a,b) (p)->GetConstant(a,b)
207#define ID3DXConstantTable_GetConstantByName(p,a,b) (p)->GetConstantByName(a,b)
208#define ID3DXConstantTable_GetConstantElement(p,a,b) (p)->GetConstantElement(a,b)
209#define ID3DXConstantTable_SetDefaults(p,a) (p)->SetDefaults(a)
210#define ID3DXConstantTable_SetValue(p,a,b,c,d) (p)->SetValue(a,b,c,d)
211#define ID3DXConstantTable_SetBool(p,a,b,c) (p)->SetBool(a,b,c)
212#define ID3DXConstantTable_SetBoolArray(p,a,b,c,d) (p)->SetBoolArray(a,b,c,d)
213#define ID3DXConstantTable_SetInt(p,a,b,c) (p)->SetInt(a,b,c)
214#define ID3DXConstantTable_SetIntArray(p,a,b,c,d) (p)->SetIntArray(a,b,c,d)
215#define ID3DXConstantTable_SetFloat(p,a,b,c) (p)->SetFloat(a,b,c)
216#define ID3DXConstantTable_SetFloatArray(p,a,b,c,d) (p)->SetFloatArray(a,b,c,d)
217#define ID3DXConstantTable_SetVector(p,a,b,c) (p)->SetVector(a,b,c)
218#define ID3DXConstantTable_SetVectorArray(p,a,b,c,d) (p)->SetVectorArray(a,b,c,d)
219#define ID3DXConstantTable_SetMatrix(p,a,b,c) (p)->SetMatrix(a,b,c)
220#define ID3DXConstantTable_SetMatrixArray(p,a,b,c,d) (p)->SetMatrixArray(a,b,c,d)
221#define ID3DXConstantTable_SetMatrixPointerArray(p,a,b,c,d) (p)->SetMatrixPointerArray(a,b,c,d)
222#define ID3DXConstantTable_SetMatrixTranspose(p,a,b,c) (p)->SetMatrixTranspose(a,b,c)
223#define ID3DXConstantTable_SetMatrixTransposeArray(p,a,b,c,d) (p)->SetMatrixTransposeArray(a,b,c,d)
224#define ID3DXConstantTable_SetMatrixTransposePointerArray(p,a,b,c,d) (p)->SetMatrixTransposePointerArray(a,b,c,d)
225#endif
226
227typedef struct ID3DXConstantTable *LPD3DXCONSTANTTABLE;
228
229typedef struct _D3DXMACRO {
230 LPCSTR Name;
231 LPCSTR Definition;
232} D3DXMACRO, *LPD3DXMACRO;
233
234typedef struct _D3DXSEMANTIC {
235 UINT Usage;
236 UINT UsageIndex;
237} D3DXSEMANTIC, *LPD3DXSEMANTIC;
238
239typedef enum _D3DXINCLUDE_TYPE
240{
241 D3DXINC_LOCAL,
242 D3DXINC_SYSTEM,
243 D3DXINC_FORCE_DWORD = 0x7fffffff,
244} D3DXINCLUDE_TYPE, *LPD3DXINCLUDE_TYPE;
245
246#undef INTERFACE
247#define INTERFACE ID3DXInclude
248
249DECLARE_INTERFACE(ID3DXInclude)
250{
251 STDMETHOD(Open)(THIS_ D3DXINCLUDE_TYPE include_type, LPCSTR filename, LPCVOID parent_data, LPCVOID *data, UINT *bytes) PURE;
252 STDMETHOD(Close)(THIS_ LPCVOID data) PURE;
253};
254
255#define ID3DXInclude_Open(p,a,b,c,d,e) (p)->lpVtbl->Open(p,a,b,c,d,e)
256#define ID3DXInclude_Close(p,a) (p)->lpVtbl->Close(p,a)
257
258typedef struct ID3DXInclude *LPD3DXINCLUDE;
259
260#ifdef __cplusplus
261extern "C" {
262#endif
263
264LPCSTR WINAPI D3DXGetPixelShaderProfile(LPDIRECT3DDEVICE9 device);
265UINT WINAPI D3DXGetShaderSize(const DWORD *byte_code);
266DWORD WINAPI D3DXGetShaderVersion(const DWORD *byte_code);
267LPCSTR WINAPI D3DXGetVertexShaderProfile(LPDIRECT3DDEVICE9 device);
268HRESULT WINAPI D3DXFindShaderComment(CONST DWORD* byte_code, DWORD fourcc, LPCVOID* data, UINT* size);
269
270HRESULT WINAPI D3DXAssembleShaderFromFileA(LPCSTR filename,
271 CONST D3DXMACRO* defines,
272 LPD3DXINCLUDE include,
273 DWORD flags,
274 LPD3DXBUFFER* shader,
275 LPD3DXBUFFER* error_messages);
276
277HRESULT WINAPI D3DXAssembleShaderFromFileW(LPCWSTR filename,
278 CONST D3DXMACRO* defines,
279 LPD3DXINCLUDE include,
280 DWORD flags,
281 LPD3DXBUFFER* shader,
282 LPD3DXBUFFER* error_messages);
283
284HRESULT WINAPI D3DXAssembleShaderFromResourceA(HMODULE module,
285 LPCSTR resource,
286 CONST D3DXMACRO* defines,
287 LPD3DXINCLUDE include,
288 DWORD flags,
289 LPD3DXBUFFER* shader,
290 LPD3DXBUFFER* error_messages);
291
292HRESULT WINAPI D3DXAssembleShaderFromResourceW(HMODULE module,
293 LPCWSTR resource,
294 CONST D3DXMACRO* defines,
295 LPD3DXINCLUDE include,
296 DWORD flags,
297 LPD3DXBUFFER* shader,
298 LPD3DXBUFFER* error_messages);
299
300HRESULT WINAPI D3DXAssembleShader(LPCSTR data,
301 UINT data_len,
302 CONST D3DXMACRO* defines,
303 LPD3DXINCLUDE include,
304 DWORD flags,
305 LPD3DXBUFFER* shader,
306 LPD3DXBUFFER* error_messages);
307
308HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD* byte_code,
309 DWORD flags,
310 LPD3DXCONSTANTTABLE* constant_table);
311
312HRESULT WINAPI D3DXGetShaderConstantTable(CONST DWORD* byte_code,
313 LPD3DXCONSTANTTABLE* constant_table);
314
315#ifdef __cplusplus
316}
317#endif
318
319typedef struct _D3DXSHADER_CONSTANTTABLE
320{
321 DWORD Size;
322 DWORD Creator;
323 DWORD Version;
324 DWORD Constants;
325 DWORD ConstantInfo;
326 DWORD Flags;
327 DWORD Target;
328} D3DXSHADER_CONSTANTTABLE, *LPD3DXSHADER_CONSTANTTABLE;
329
330typedef struct _D3DXSHADER_CONSTANTINFO
331{
332 DWORD Name;
333 WORD RegisterSet;
334 WORD RegisterIndex;
335 WORD RegisterCount;
336 WORD Reserved;
337 DWORD TypeInfo;
338 DWORD DefaultValue;
339} D3DXSHADER_CONSTANTINFO, *LPD3DXSHADER_CONSTANTINFO;
340
341typedef struct _D3DXSHADER_TYPEINFO
342{
343 WORD Class;
344 WORD Type;
345 WORD Rows;
346 WORD Columns;
347 WORD Elements;
348 WORD StructMembers;
349 DWORD StructMemberInfo;
350} D3DXSHADER_TYPEINFO, *LPD3DXSHADER_TYPEINFO;
351
352typedef struct _D3DXSHADER_STRUCTMEMBERINFO
353{
354 DWORD Name;
355 DWORD TypeInfo;
356} D3DXSHADER_STRUCTMEMBERINFO, *LPD3DXSHADER_STRUCTMEMBERINFO;
357
358#endif /* __D3DX9SHADER_H__ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette