include: Add missing declarations and definitions to wincon.h.
[wine/hramrach.git] / include / d3d10effect.h
blobb9c5c0861cbb248a82ea7e07cc8026ac3dba7ac5
1 /*
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_D3D10EFFECT_H
21 #define __WINE_D3D10EFFECT_H
23 #include "d3d10.h"
25 #define D3D10_EFFECT_VARIABLE_POOLED 0x1
26 #define D3D10_EFFECT_VARIABLE_ANNOTATION 0x2
27 #define D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT 0x4
29 #ifndef D3D10_BYTES_FROM_BITS
30 #define D3D10_BYTES_FROM_BITS(x) (((x) + 7) >> 3)
31 #endif
33 typedef struct _D3D10_EFFECT_TYPE_DESC
35 LPCSTR TypeName;
36 D3D10_SHADER_VARIABLE_CLASS Class;
37 D3D10_SHADER_VARIABLE_TYPE Type;
38 UINT Elements;
39 UINT Members;
40 UINT Rows;
41 UINT Columns;
42 UINT PackedSize;
43 UINT UnpackedSize;
44 UINT Stride;
45 } D3D10_EFFECT_TYPE_DESC;
47 typedef struct _D3D10_EFFECT_VARIABLE_DESC
49 LPCSTR Name;
50 LPCSTR Semantic;
51 UINT Flags;
52 UINT Annotations;
53 UINT BufferOffset;
54 UINT ExplicitBindPoint;
55 } D3D10_EFFECT_VARIABLE_DESC;
57 typedef struct _D3D10_TECHNIQUE_DESC
59 LPCSTR Name;
60 UINT Passes;
61 UINT Annotations;
62 } D3D10_TECHNIQUE_DESC;
64 typedef struct _D3D10_STATE_BLOCK_MASK
66 BYTE VS;
67 BYTE VSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)];
68 BYTE VSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
69 BYTE VSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
70 BYTE GS;
71 BYTE GSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)];
72 BYTE GSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
73 BYTE GSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
74 BYTE PS;
75 BYTE PSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)];
76 BYTE PSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
77 BYTE PSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
78 BYTE IAVertexBuffers[D3D10_BYTES_FROM_BITS(D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT)];
79 BYTE IAIndexBuffer;
80 BYTE IAInputLayout;
81 BYTE IAPrimitiveTopology;
82 BYTE OMRenderTargets;
83 BYTE OMDepthStencilState;
84 BYTE OMBlendState;
85 BYTE RSViewports;
86 BYTE RSScissorRects;
87 BYTE RSRasterizerState;
88 BYTE SOBuffers;
89 BYTE Predication;
90 } D3D10_STATE_BLOCK_MASK;
92 typedef struct _D3D10_EFFECT_DESC
94 BOOL IsChildEffect;
95 UINT ConstantBuffers;
96 UINT SharedConstantBuffers;
97 UINT GlobalVariables;
98 UINT SharedGlobalVariables;
99 UINT Techniques;
100 } D3D10_EFFECT_DESC;
102 typedef struct _D3D10_PASS_DESC
104 LPCSTR Name;
105 UINT Annotations;
106 BYTE *pIAInputSignature;
107 SIZE_T IAInputSignatureSize;
108 UINT StencilRef;
109 UINT SampleMask;
110 FLOAT BlendFactor[4];
111 } D3D10_PASS_DESC;
113 typedef struct _D3D10_PASS_SHADER_DESC
115 struct ID3D10EffectShaderVariable *pShaderVariable;
116 UINT ShaderIndex;
117 } D3D10_PASS_SHADER_DESC;
119 DEFINE_GUID(IID_ID3D10EffectType, 0x4e9e1ddc, 0xcd9d, 0x4772, 0xa8, 0x37, 0x00, 0x18, 0x0b, 0x9b, 0x88, 0xfd);
121 #define INTERFACE ID3D10EffectType
122 DECLARE_INTERFACE(ID3D10EffectType)
124 STDMETHOD_(BOOL, IsValid)(THIS) PURE;
125 STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_TYPE_DESC *desc) PURE;
126 STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE;
127 STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeByName)(THIS_ LPCSTR name) PURE;
128 STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeBySemantic)(THIS_ LPCSTR semantic) PURE;
129 STDMETHOD_(LPCSTR, GetMemberName)(THIS_ UINT index) PURE;
130 STDMETHOD_(LPCSTR, GetMemberSemantic)(THIS_ UINT index) PURE;
132 #undef INTERFACE
134 DEFINE_GUID(IID_ID3D10EffectVariable, 0xae897105, 0x00e6, 0x45bf, 0xbb, 0x8e, 0x28, 0x1d, 0xd6, 0xdb, 0x8e, 0x1b);
136 #define INTERFACE ID3D10EffectVariable
137 DECLARE_INTERFACE(ID3D10EffectVariable)
139 STDMETHOD_(BOOL, IsValid)(THIS) PURE;
140 STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
141 STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
142 STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
143 STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
144 STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
145 STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
146 STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
147 STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
148 STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
149 STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
150 STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
151 STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
152 STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
153 STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
154 STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
155 STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
156 STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
157 STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
158 STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
159 STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
160 STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
161 STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
162 STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
163 STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
165 #undef INTERFACE
167 DEFINE_GUID(IID_ID3D10EffectConstantBuffer, 0x56648f4d, 0xcc8b, 0x4444, 0xa5, 0xad, 0xb5, 0xa3, 0xd7, 0x6e, 0x91, 0xb3);
169 #define INTERFACE ID3D10EffectConstantBuffer
170 DECLARE_INTERFACE_(ID3D10EffectConstantBuffer, ID3D10EffectVariable)
172 /* ID3D10EffectVariable methods */
173 STDMETHOD_(BOOL, IsValid)(THIS) PURE;
174 STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
175 STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
176 STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
177 STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
178 STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
179 STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
180 STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
181 STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
182 STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
183 STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
184 STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
185 STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
186 STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
187 STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
188 STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
189 STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
190 STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
191 STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
192 STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
193 STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
194 STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
195 STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
196 STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
197 STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
198 /* ID3D10EffectConstantBuffer methods */
199 STDMETHOD(SetConstantBuffer)(THIS_ ID3D10Buffer *buffer) PURE;
200 STDMETHOD(GetConstantBuffer)(THIS_ ID3D10Buffer **buffer) PURE;
201 STDMETHOD(SetTextureBuffer)(THIS_ ID3D10ShaderResourceView *view) PURE;
202 STDMETHOD(GetTextureBuffer)(THIS_ ID3D10ShaderResourceView **view) PURE;
204 #undef INTERFACE
206 DEFINE_GUID(IID_ID3D10EffectMatrixVariable, 0x50666c24, 0xb82f, 0x4eed, 0xa1, 0x72, 0x5b, 0x6e, 0x7e, 0x85, 0x22, 0xe0);
208 #define INTERFACE ID3D10EffectMatrixVariable
209 DECLARE_INTERFACE_(ID3D10EffectMatrixVariable, ID3D10EffectVariable)
211 /* ID3D10EffectVariable methods */
212 STDMETHOD_(BOOL, IsValid)(THIS) PURE;
213 STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
214 STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
215 STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
216 STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
217 STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
218 STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
219 STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
220 STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
221 STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
222 STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
223 STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
224 STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
225 STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
226 STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
227 STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
228 STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
229 STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
230 STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
231 STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
232 STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
233 STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
234 STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
235 STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
236 STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
237 /* ID3D10EffectMatrixVariable methods */
238 STDMETHOD(SetMatrix)(THIS_ float *data) PURE;
239 STDMETHOD(GetMatrix)(THIS_ float *data) PURE;
240 STDMETHOD(SetMatrixArray)(THIS_ float *data, UINT offset, UINT count) PURE;
241 STDMETHOD(GetMatrixArray)(THIS_ float *data, UINT offset, UINT count) PURE;
242 STDMETHOD(SetMatrixTranspose)(THIS_ float *data) PURE;
243 STDMETHOD(GetMatrixTranspose)(THIS_ float *data) PURE;
244 STDMETHOD(SetMatrixTransposeArray)(THIS_ float *data, UINT offset, UINT count) PURE;
245 STDMETHOD(GetMatrixTransposeArray)(THIS_ float *data, UINT offset, UINT count) PURE;
247 #undef INTERFACE
249 DEFINE_GUID(IID_ID3D10EffectTechnique, 0xdb122ce8, 0xd1c9, 0x4292, 0xb2, 0x37, 0x24, 0xed, 0x3d, 0xe8, 0xb1, 0x75);
251 #define INTERFACE ID3D10EffectTechnique
252 DECLARE_INTERFACE(ID3D10EffectTechnique)
254 STDMETHOD_(BOOL, IsValid)(THIS) PURE;
255 STDMETHOD(GetDesc)(THIS_ D3D10_TECHNIQUE_DESC *desc) PURE;
256 STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
257 STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
258 STDMETHOD_(struct ID3D10EffectPass *, GetPassByIndex)(THIS_ UINT index) PURE;
259 STDMETHOD_(struct ID3D10EffectPass *, GetPassByName)(THIS_ LPCSTR name) PURE;
260 STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *mask) PURE;
262 #undef INTERFACE
264 DEFINE_GUID(IID_ID3D10Effect, 0x51b0ca8b, 0xec0b, 0x4519, 0x87, 0x0d, 0x8e, 0xe1, 0xcb, 0x50, 0x17, 0xc7);
266 #define INTERFACE ID3D10Effect
267 DECLARE_INTERFACE_(ID3D10Effect, IUnknown)
269 /* IUnknown methods */
270 STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
271 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
272 STDMETHOD_(ULONG, Release)(THIS) PURE;
273 /* ID3D10Effect methods */
274 STDMETHOD_(BOOL, IsValid)(THIS) PURE;
275 STDMETHOD_(BOOL, IsPool)(THIS) PURE;
276 STDMETHOD(GetDevice)(THIS_ ID3D10Device **device) PURE;
277 STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_DESC *desc) PURE;
278 STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE;
279 STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetConstantBufferByName)(THIS_ LPCSTR name) PURE;
280 STDMETHOD_(struct ID3D10EffectVariable *, GetVariableByIndex)(THIS_ UINT index) PURE;
281 STDMETHOD_(struct ID3D10EffectVariable *, GetVariableByName)(THIS_ LPCSTR name) PURE;
282 STDMETHOD_(struct ID3D10EffectVariable *, GetVariableBySemantic)(THIS_ LPCSTR semantic) PURE;
283 STDMETHOD_(struct ID3D10EffectTechnique *, GetTechniqueByIndex)(THIS_ UINT index) PURE;
284 STDMETHOD_(struct ID3D10EffectTechnique *, GetTechniqueByName)(THIS_ LPCSTR name) PURE;
285 STDMETHOD(Optimize)(THIS) PURE;
286 STDMETHOD_(BOOL, IsOptimized)(THIS) PURE;
288 #undef INTERFACE
290 DEFINE_GUID(IID_ID3D10EffectPool, 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
292 #define INTERFACE ID3D10EffectPool
293 DECLARE_INTERFACE_(ID3D10EffectPool, IUnknown)
295 /* IUnknown methods */
296 STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
297 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
298 STDMETHOD_(ULONG, Release)(THIS) PURE;
299 /* ID3D10EffectPool methods */
300 STDMETHOD_(struct ID3D10Effect *, AsEffect)(THIS) PURE;
302 #undef INTERFACE
304 DEFINE_GUID(IID_ID3D10EffectPass, 0x5cfbeb89, 0x1a06, 0x46e0, 0xb2, 0x82, 0xe3, 0xf9, 0xbf, 0xa3, 0x6a, 0x54);
306 #define INTERFACE ID3D10EffectPass
307 DECLARE_INTERFACE(ID3D10EffectPass)
309 STDMETHOD_(BOOL, IsValid)(THIS) PURE;
310 STDMETHOD(GetDesc)(THIS_ D3D10_PASS_DESC *desc) PURE;
311 STDMETHOD(GetVertexShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *desc) PURE;
312 STDMETHOD(GetGeometryShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *desc) PURE;
313 STDMETHOD(GetPixelShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *desc) PURE;
314 STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
315 STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
316 STDMETHOD(Apply)(THIS_ UINT flags) PURE;
317 STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *mask) PURE;
319 #undef INTERFACE
321 #ifdef __cplusplus
322 extern "C" {
323 #endif
325 HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT flags,
326 ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3D10Effect **effect);
328 #ifdef __cplusplus
330 #endif
332 #endif /* __WINE_D3D10EFFECT_H */