d3d10: Add the ID3D10EffectPool interface.
[wine] / include / d3d10effect.h
1 /*
2  * Copyright 2009 Henri Verbeet for CodeWeavers
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 #ifndef __WINE_D3D10EFFECT_H
21 #define __WINE_D3D10EFFECT_H
22
23 #include "d3d10.h"
24
25 #define D3D10_EFFECT_VARIABLE_POOLED                0x1
26 #define D3D10_EFFECT_VARIABLE_ANNOTATION            0x2
27 #define D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT   0x4
28
29 #ifndef D3D10_BYTES_FROM_BITS
30 #define D3D10_BYTES_FROM_BITS(x) (((x) + 7) >> 3)
31 #endif
32
33 typedef struct _D3D10_EFFECT_TYPE_DESC
34 {
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;
46
47 typedef struct _D3D10_EFFECT_VARIABLE_DESC
48 {
49     LPCSTR Name;
50     LPCSTR Semantic;
51     UINT Flags;
52     UINT Annotations;
53     UINT BufferOffset;
54     UINT ExplicitBindPoint;
55 } D3D10_EFFECT_VARIABLE_DESC;
56
57 typedef struct _D3D10_TECHNIQUE_DESC
58 {
59     LPCSTR Name;
60     UINT Passes;
61     UINT Annotations;
62 } D3D10_TECHNIQUE_DESC;
63
64 typedef struct _D3D10_STATE_BLOCK_MASK
65 {
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;
91
92 typedef struct _D3D10_EFFECT_DESC
93 {
94     BOOL IsChildEffect;
95     UINT ConstantBuffers;
96     UINT SharedConstantBuffers;
97     UINT GlobalVariables;
98     UINT SharedGlobalVariables;
99     UINT Techniques;
100 } D3D10_EFFECT_DESC;
101
102 DEFINE_GUID(IID_ID3D10EffectType, 0x4e9e1ddc, 0xcd9d, 0x4772, 0xa8, 0x37, 0x00, 0x18, 0x0b, 0x9b, 0x88, 0xfd);
103
104 #define INTERFACE ID3D10EffectType
105 DECLARE_INTERFACE(ID3D10EffectType)
106 {
107     STDMETHOD_(BOOL, IsValid)(THIS) PURE;
108     STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_TYPE_DESC *desc) PURE;
109     STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE;
110     STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeByName)(THIS_ LPCSTR name) PURE;
111     STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeBySemantic)(THIS_ LPCSTR semantic) PURE;
112     STDMETHOD_(LPCSTR, GetMemberName)(THIS_ UINT index) PURE;
113     STDMETHOD_(LPCSTR, GetMemberSemantic)(THIS_ UINT index) PURE;
114 };
115 #undef INTERFACE
116
117 DEFINE_GUID(IID_ID3D10EffectVariable, 0xae897105, 0x00e6, 0x45bf, 0xbb, 0x8e, 0x28, 0x1d, 0xd6, 0xdb, 0x8e, 0x1b);
118
119 #define INTERFACE ID3D10EffectVariable
120 DECLARE_INTERFACE(ID3D10EffectVariable)
121 {
122     STDMETHOD_(BOOL, IsValid)(THIS) PURE;
123     STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
124     STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
125     STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
126     STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
127     STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
128     STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
129     STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
130     STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
131     STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
132     STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
133     STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
134     STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
135     STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
136     STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
137     STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
138     STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
139     STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
140     STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
141     STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
142     STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
143     STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
144     STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
145     STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
146     STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
147 };
148 #undef INTERFACE
149
150 DEFINE_GUID(IID_ID3D10EffectConstantBuffer, 0x56648f4d, 0xcc8b, 0x4444, 0xa5, 0xad, 0xb5, 0xa3, 0xd7, 0x6e, 0x91, 0xb3);
151
152 #define INTERFACE ID3D10EffectConstantBuffer
153 DECLARE_INTERFACE_(ID3D10EffectConstantBuffer, ID3D10EffectVariable)
154 {
155     /* ID3D10EffectVariable methods */
156     STDMETHOD_(BOOL, IsValid)(THIS) PURE;
157     STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
158     STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
159     STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
160     STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
161     STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
162     STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
163     STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
164     STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
165     STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
166     STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
167     STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
168     STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
169     STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
170     STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
171     STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
172     STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
173     STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
174     STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
175     STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
176     STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
177     STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
178     STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
179     STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
180     STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
181     /* ID3D10EffectConstantBuffer methods */
182     STDMETHOD(SetConstantBuffer)(THIS_ ID3D10Buffer *buffer) PURE;
183     STDMETHOD(GetConstantBuffer)(THIS_ ID3D10Buffer **buffer) PURE;
184     STDMETHOD(SetTextureBuffer)(THIS_ ID3D10ShaderResourceView *view) PURE;
185     STDMETHOD(GetTextureBuffer)(THIS_ ID3D10ShaderResourceView **view) PURE;
186 };
187 #undef INTERFACE
188
189 DEFINE_GUID(IID_ID3D10EffectTechnique, 0xdb122ce8, 0xd1c9, 0x4292, 0xb2, 0x37, 0x24, 0xed, 0x3d, 0xe8, 0xb1, 0x75);
190
191 #define INTERFACE ID3D10EffectTechnique
192 DECLARE_INTERFACE(ID3D10EffectTechnique)
193 {
194     STDMETHOD_(BOOL, IsValid)(THIS) PURE;
195     STDMETHOD(GetDesc)(THIS_ D3D10_TECHNIQUE_DESC *desc) PURE;
196     STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
197     STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
198     STDMETHOD_(struct ID3D10EffectPass *, GetPassByIndex)(THIS_ UINT index) PURE;
199     STDMETHOD_(struct ID3D10EffectPass *, GetPassByName)(THIS_ LPCSTR name) PURE;
200     STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *mask) PURE;
201 };
202 #undef INTERFACE
203
204 DEFINE_GUID(IID_ID3D10Effect, 0x51b0ca8b, 0xec0b, 0x4519, 0x87, 0x0d, 0x8e, 0xe1, 0xcb, 0x50, 0x17, 0xc7);
205
206 #define INTERFACE ID3D10Effect
207 DECLARE_INTERFACE_(ID3D10Effect, IUnknown)
208 {
209     /* IUnknown methods */
210     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
211     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
212     STDMETHOD_(ULONG, Release)(THIS) PURE;
213     /* ID3D10Effect methods */
214     STDMETHOD_(BOOL, IsValid)(THIS) PURE;
215     STDMETHOD_(BOOL, IsPool)(THIS) PURE;
216     STDMETHOD(GetDevice)(THIS_ ID3D10Device **device) PURE;
217     STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_DESC *desc) PURE;
218     STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE;
219     STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetConstantBufferByName)(THIS_ LPCSTR name) PURE;
220     STDMETHOD_(struct ID3D10EffectVariable *, GetVariableByIndex)(THIS_ UINT index) PURE;
221     STDMETHOD_(struct ID3D10EffectVariable *, GetVariableByName)(THIS_ LPCSTR name) PURE;
222     STDMETHOD_(struct ID3D10EffectVariable *, GetVariableBySemantic)(THIS_ LPCSTR semantic) PURE;
223     STDMETHOD_(struct ID3D10EffectTechnique *, GetTechniqueByIndex)(THIS_ UINT index) PURE;
224     STDMETHOD_(struct ID3D10EffectTechnique *, GetTechniqueByName)(THIS_ LPCSTR name) PURE;
225     STDMETHOD(Optimize)(THIS) PURE;
226     STDMETHOD_(BOOL, IsOptimized)(THIS) PURE;
227 };
228 #undef INTERFACE
229
230 DEFINE_GUID(IID_ID3D10EffectPool, 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
231
232 #define INTERFACE ID3D10EffectPool
233 DECLARE_INTERFACE_(ID3D10EffectPool, IUnknown)
234 {
235     /* IUnknown methods */
236     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
237     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
238     STDMETHOD_(ULONG, Release)(THIS) PURE;
239     /* ID3D10EffectPool methods */
240     STDMETHOD_(struct ID3D10Effect *, AsEffect)(THIS) PURE;
241 };
242 #undef INTERFACE
243
244 #endif /* __WINE_D3D10EFFECT_H */