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
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)
33 typedef struct _D3D10_EFFECT_TYPE_DESC
36 D3D10_SHADER_VARIABLE_CLASS Class;
37 D3D10_SHADER_VARIABLE_TYPE Type;
45 } D3D10_EFFECT_TYPE_DESC;
47 typedef struct _D3D10_EFFECT_VARIABLE_DESC
54 UINT ExplicitBindPoint;
55 } D3D10_EFFECT_VARIABLE_DESC;
57 typedef struct _D3D10_TECHNIQUE_DESC
62 } D3D10_TECHNIQUE_DESC;
64 typedef struct _D3D10_STATE_BLOCK_MASK
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)];
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)];
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)];
81 BYTE IAPrimitiveTopology;
83 BYTE OMDepthStencilState;
87 BYTE RSRasterizerState;
90 } D3D10_STATE_BLOCK_MASK;
92 typedef struct _D3D10_EFFECT_DESC
96 UINT SharedConstantBuffers;
98 UINT SharedGlobalVariables;
102 DEFINE_GUID(IID_ID3D10EffectType, 0x4e9e1ddc, 0xcd9d, 0x4772, 0xa8, 0x37, 0x00, 0x18, 0x0b, 0x9b, 0x88, 0xfd);
104 #define INTERFACE ID3D10EffectType
105 DECLARE_INTERFACE(ID3D10EffectType)
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;
117 DEFINE_GUID(IID_ID3D10EffectVariable, 0xae897105, 0x00e6, 0x45bf, 0xbb, 0x8e, 0x28, 0x1d, 0xd6, 0xdb, 0x8e, 0x1b);
119 #define INTERFACE ID3D10EffectVariable
120 DECLARE_INTERFACE(ID3D10EffectVariable)
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;
150 DEFINE_GUID(IID_ID3D10EffectConstantBuffer, 0x56648f4d, 0xcc8b, 0x4444, 0xa5, 0xad, 0xb5, 0xa3, 0xd7, 0x6e, 0x91, 0xb3);
152 #define INTERFACE ID3D10EffectConstantBuffer
153 DECLARE_INTERFACE_(ID3D10EffectConstantBuffer, ID3D10EffectVariable)
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;
189 DEFINE_GUID(IID_ID3D10EffectTechnique, 0xdb122ce8, 0xd1c9, 0x4292, 0xb2, 0x37, 0x24, 0xed, 0x3d, 0xe8, 0xb1, 0x75);
191 #define INTERFACE ID3D10EffectTechnique
192 DECLARE_INTERFACE(ID3D10EffectTechnique)
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;
204 DEFINE_GUID(IID_ID3D10Effect, 0x51b0ca8b, 0xec0b, 0x4519, 0x87, 0x0d, 0x8e, 0xe1, 0xcb, 0x50, 0x17, 0xc7);
206 #define INTERFACE ID3D10Effect
207 DECLARE_INTERFACE_(ID3D10Effect, IUnknown)
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;
230 DEFINE_GUID(IID_ID3D10EffectPool, 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
232 #define INTERFACE ID3D10EffectPool
233 DECLARE_INTERFACE_(ID3D10EffectPool, IUnknown)
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;
244 #endif /* __WINE_D3D10EFFECT_H */