2 * Copyright 2009 Henri Verbeet for CodeWeavers
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.
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.
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
20 #ifndef __WINE_D3D10SHADER_H
21 #define __WINE_D3D10SHADER_H
25 #define D3D10_SHADER_DEBUG 0x0001
26 #define D3D10_SHADER_SKIP_VALIDATION 0x0002
27 #define D3D10_SHADER_SKIP_OPTIMIZATION 0x0004
28 #define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR 0x0008
29 #define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR 0x0010
30 #define D3D10_SHADER_PARTIAL_PRECISION 0x0020
31 #define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT 0x0040
32 #define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT 0x0080
33 #define D3D10_SHADER_NO_PRESHADER 0x0100
34 #define D3D10_SHADER_AVOID_FLOW_CONTROL 0x0200
35 #define D3D10_SHADER_PREFER_FLOW_CONTROL 0x0400
36 #define D3D10_SHADER_ENABLE_STRICTNESS 0x0800
37 #define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY 0x1000
38 #define D3D10_SHADER_IEEE_STRICTNESS 0x2000
39 #define D3D10_SHADER_WARNINGS_ARE_ERRORS 0x40000
41 #define D3D10_SHADER_OPTIMIZATION_LEVEL0 0x4000
42 #define D3D10_SHADER_OPTIMIZATION_LEVEL1 0x0000
43 #define D3D10_SHADER_OPTIMIZATION_LEVEL2 0xC000
44 #define D3D10_SHADER_OPTIMIZATION_LEVEL3 0x8000
46 typedef enum _D3D10_SHADER_VARIABLE_TYPE
53 D3D10_SVT_TEXTURE
= 5,
54 D3D10_SVT_TEXTURE1D
= 6,
55 D3D10_SVT_TEXTURE2D
= 7,
56 D3D10_SVT_TEXTURE3D
= 8,
57 D3D10_SVT_TEXTURECUBE
= 9,
58 D3D10_SVT_SAMPLER
= 10,
59 D3D10_SVT_PIXELSHADER
= 15,
60 D3D10_SVT_VERTEXSHADER
= 16,
63 D3D10_SVT_GEOMETRYSHADER
= 21,
64 D3D10_SVT_RASTERIZER
= 22,
65 D3D10_SVT_DEPTHSTENCIL
= 23,
67 D3D10_SVT_BUFFER
= 25,
68 D3D10_SVT_CBUFFER
= 26,
69 D3D10_SVT_TBUFFER
= 27,
70 D3D10_SVT_TEXTURE1DARRAY
= 28,
71 D3D10_SVT_TEXTURE2DARRAY
= 29,
72 D3D10_SVT_RENDERTARGETVIEW
= 30,
73 D3D10_SVT_DEPTHSTENCILVIEW
= 31,
74 D3D10_SVT_TEXTURE2DMS
= 32,
75 D3D10_SVT_TEXTURE2DMSARRAY
= 33,
76 D3D10_SVT_TEXTURECUBEARRAY
= 34,
77 D3D10_SVT_FORCE_DWORD
= 0x7fffffff
78 } D3D10_SHADER_VARIABLE_TYPE
, *LPD3D10_SHADER_VARIABLE_TYPE
;
80 typedef enum _D3D10_SHADER_INPUT_TYPE
82 D3D10_SIT_CBUFFER
= 0,
83 D3D10_SIT_TBUFFER
= 1,
84 D3D10_SIT_TEXTURE
= 2,
86 } D3D10_SHADER_INPUT_TYPE
, *LPD3D10_SHADER_INPUT_TYPE
;
88 typedef enum D3D10_NAME
90 D3D10_NAME_UNDEFINED
= 0,
91 D3D10_NAME_POSITION
= 1,
92 D3D10_NAME_CLIP_DISTANCE
= 2,
93 D3D10_NAME_CULL_DISTANCE
= 3,
94 D3D10_NAME_RENDER_TARGET_ARRAY_INDEX
= 4,
95 D3D10_NAME_VIEWPORT_ARRAY_INDEX
= 5,
96 D3D10_NAME_VERTEX_ID
= 6,
97 D3D10_NAME_PRIMITIVE_ID
= 7,
98 D3D10_NAME_INSTANCE_ID
= 8,
99 D3D10_NAME_IS_FRONT_FACE
= 9,
100 D3D10_NAME_SAMPLE_INDEX
= 10,
101 D3D10_NAME_TARGET
= 64,
102 D3D10_NAME_DEPTH
= 65,
105 /* These are defined as version-neutral in d3dcommon.h */
106 typedef D3D_SHADER_MACRO D3D10_SHADER_MACRO
;
107 typedef D3D_SHADER_MACRO
*LPD3D10_SHADER_MACRO
;
109 typedef D3D_SHADER_VARIABLE_CLASS D3D10_SHADER_VARIABLE_CLASS
;
110 typedef D3D_SHADER_VARIABLE_CLASS
*LPD3D10_SHADER_VARIABLE_CLASS
;
112 typedef D3D_CBUFFER_TYPE D3D10_CBUFFER_TYPE
;
113 typedef D3D_CBUFFER_TYPE
*LPD3D10_CBUFFER_TYPE
;
115 typedef D3D_REGISTER_COMPONENT_TYPE D3D10_REGISTER_COMPONENT_TYPE
;
117 typedef D3D_INCLUDE_TYPE D3D10_INCLUDE_TYPE
;
118 typedef ID3DInclude ID3D10Include
;
119 typedef ID3DInclude
*LPD3D10INCLUDE
;
120 #define IID_ID3D10Include IID_ID3DInclude
122 typedef enum D3D10_RESOURCE_RETURN_TYPE
124 D3D10_RETURN_TYPE_UNORM
= 1,
125 D3D10_RETURN_TYPE_SNORM
= 2,
126 D3D10_RETURN_TYPE_SINT
= 3,
127 D3D10_RETURN_TYPE_UINT
= 4,
128 D3D10_RETURN_TYPE_FLOAT
= 5,
129 D3D10_RETURN_TYPE_MIXED
= 6
130 } D3D10_RESOURCE_RETURN_TYPE
;
132 typedef struct _D3D10_SHADER_INPUT_BIND_DESC
135 D3D10_SHADER_INPUT_TYPE Type
;
139 D3D10_RESOURCE_RETURN_TYPE ReturnType
;
140 D3D10_SRV_DIMENSION Dimension
;
142 } D3D10_SHADER_INPUT_BIND_DESC
;
144 typedef struct _D3D10_SIGNATURE_PARAMETER_DESC
149 D3D10_NAME SystemValueType
;
150 D3D10_REGISTER_COMPONENT_TYPE ComponentType
;
153 } D3D10_SIGNATURE_PARAMETER_DESC
;
155 typedef struct _D3D10_SHADER_DESC
160 UINT ConstantBuffers
;
162 UINT InputParameters
;
163 UINT OutputParameters
;
164 UINT InstructionCount
;
165 UINT TempRegisterCount
;
169 UINT TextureNormalInstructions
;
170 UINT TextureLoadInstructions
;
171 UINT TextureCompInstructions
;
172 UINT TextureBiasInstructions
;
173 UINT TextureGradientInstructions
;
174 UINT FloatInstructionCount
;
175 UINT IntInstructionCount
;
176 UINT UintInstructionCount
;
177 UINT StaticFlowControlCount
;
178 UINT DynamicFlowControlCount
;
179 UINT MacroInstructionCount
;
180 UINT ArrayInstructionCount
;
181 UINT CutInstructionCount
;
182 UINT EmitInstructionCount
;
183 D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology
;
184 UINT GSMaxOutputVertexCount
;
187 typedef struct _D3D10_SHADER_BUFFER_DESC
190 D3D10_CBUFFER_TYPE Type
;
194 } D3D10_SHADER_BUFFER_DESC
;
196 typedef struct _D3D10_SHADER_VARIABLE_DESC
203 } D3D10_SHADER_VARIABLE_DESC
;
205 typedef struct _D3D10_SHADER_TYPE_DESC
207 D3D10_SHADER_VARIABLE_CLASS Class
;
208 D3D10_SHADER_VARIABLE_TYPE Type
;
214 } D3D10_SHADER_TYPE_DESC
;
216 DEFINE_GUID(IID_ID3D10ShaderReflectionType
, 0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd);
218 #define INTERFACE ID3D10ShaderReflectionType
219 DECLARE_INTERFACE(ID3D10ShaderReflectionType
)
221 STDMETHOD(GetDesc
)(THIS_ D3D10_SHADER_TYPE_DESC
*desc
) PURE
;
222 STDMETHOD_(struct ID3D10ShaderReflectionType
*, GetMemberTypeByIndex
)(THIS_ UINT index
) PURE
;
223 STDMETHOD_(struct ID3D10ShaderReflectionType
*, GetMemberTypeByName
)(THIS_ LPCSTR name
) PURE
;
224 STDMETHOD_(LPCSTR
, GetMemberTypeName
)(THIS_ UINT index
) PURE
;
228 DEFINE_GUID(IID_ID3D10ShaderReflectionVariable
, 0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1);
230 #define INTERFACE ID3D10ShaderReflectionVariable
231 DECLARE_INTERFACE(ID3D10ShaderReflectionVariable
)
233 STDMETHOD(GetDesc
)(THIS_ D3D10_SHADER_VARIABLE_DESC
*desc
) PURE
;
234 STDMETHOD_(struct ID3D10ShaderReflectionType
*, GetType
)(THIS
) PURE
;
238 DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer
, 0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0);
240 #define INTERFACE ID3D10ShaderReflectionConstantBuffer
241 DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer
)
243 STDMETHOD(GetDesc
)(THIS_ D3D10_SHADER_BUFFER_DESC
*desc
) PURE
;
244 STDMETHOD_(struct ID3D10ShaderReflectionVariable
*, GetVariableByIndex
)(THIS_ UINT index
) PURE
;
245 STDMETHOD_(struct ID3D10ShaderReflectionVariable
*, GetVariableByName
)(THIS_ LPCSTR name
) PURE
;
249 DEFINE_GUID(IID_ID3D10ShaderReflection
, 0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa);
251 #define INTERFACE ID3D10ShaderReflection
252 DECLARE_INTERFACE_(ID3D10ShaderReflection
, IUnknown
)
254 /* IUnknown methods */
255 STDMETHOD(QueryInterface
)(THIS_ REFIID riid
, LPVOID
*object
) PURE
;
256 STDMETHOD_(ULONG
, AddRef
)(THIS
) PURE
;
257 STDMETHOD_(ULONG
, Release
)(THIS
) PURE
;
258 /* ID3D10ShaderReflection methods */
259 STDMETHOD(GetDesc
)(THIS_ D3D10_SHADER_DESC
*desc
) PURE
;
260 STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer
*, GetConstantBufferByIndex
)(THIS_ UINT index
) PURE
;
261 STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer
*, GetConstantBufferByName
)(THIS_ LPCSTR name
) PURE
;
262 STDMETHOD(GetResourceBindingDesc
)(THIS_ UINT index
, D3D10_SHADER_INPUT_BIND_DESC
*desc
) PURE
;
263 STDMETHOD(GetInputParameterDesc
)(THIS_ UINT index
, D3D10_SIGNATURE_PARAMETER_DESC
*desc
) PURE
;
264 STDMETHOD(GetOutputParameterDesc
)(THIS_ UINT index
, D3D10_SIGNATURE_PARAMETER_DESC
*desc
) PURE
;
268 HRESULT WINAPI
D3D10CompileShader(LPCSTR data
, SIZE_T data_size
, LPCSTR filename
,
269 const D3D10_SHADER_MACRO
*defines
, ID3D10Include
*include
, LPCSTR entrypoint
,
270 LPCSTR profile
, UINT flags
, ID3D10Blob
**shader
, ID3D10Blob
**error_messages
);
271 LPCSTR WINAPI
D3D10GetVertexShaderProfile(ID3D10Device
*device
);
272 LPCSTR WINAPI
D3D10GetGeometryShaderProfile(ID3D10Device
*device
);
273 LPCSTR WINAPI
D3D10GetPixelShaderProfile(ID3D10Device
*device
);
275 HRESULT WINAPI
D3D10ReflectShader(const void *data
, SIZE_T data_size
, ID3D10ShaderReflection
**reflector
);
276 HRESULT WINAPI
D3D10GetInputSignatureBlob(const void *data
, SIZE_T data_size
, ID3D10Blob
**blob
);
277 HRESULT WINAPI
D3D10GetOutputSignatureBlob(const void *data
, SIZE_T data_size
, ID3D10Blob
**blob
);
278 HRESULT WINAPI
D3D10GetInputAndOutputSignatureBlob(const void *data
, SIZE_T data_size
, ID3D10Blob
**blob
);
279 HRESULT WINAPI
D3D10GetShaderDebugInfo(const void *data
, SIZE_T data_size
, ID3D10Blob
**blob
);
281 #endif /* __WINE_D3D10SHADER_H */