2 * Copyright 2008-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
19 #ifndef __WINE_D3D10_PRIVATE_H
20 #define __WINE_D3D10_PRIVATE_H
24 #include "wine/debug.h"
25 #include "wine/rbtree.h"
26 #include "wine/heap.h"
34 #include "d3dcompiler.h"
37 * This doesn't belong here, but for some functions it is possible to return that value,
38 * see http://msdn.microsoft.com/en-us/library/bb205278%28v=VS.85%29.aspx
39 * The original definition is in D3DX10core.h.
41 #define D3DERR_INVALIDCALL 0x8876086c
43 enum d3d10_effect_object_type
45 D3D10_EOT_RASTERIZER_STATE
= 0x0,
46 D3D10_EOT_DEPTH_STENCIL_STATE
= 0x1,
47 D3D10_EOT_BLEND_STATE
= 0x2,
48 D3D10_EOT_VERTEXSHADER
= 0x6,
49 D3D10_EOT_PIXELSHADER
= 0x7,
50 D3D10_EOT_GEOMETRYSHADER
= 0x8,
51 D3D10_EOT_STENCIL_REF
= 0x9,
52 D3D10_EOT_BLEND_FACTOR
= 0xa,
53 D3D10_EOT_SAMPLE_MASK
= 0xb,
56 enum d3d10_effect_object_operation
59 D3D10_EOO_PARSED_OBJECT
= 2,
60 D3D10_EOO_PARSED_OBJECT_INDEX
= 3,
61 D3D10_EOO_ANONYMOUS_SHADER
= 7,
69 struct d3d10_effect_object
71 struct d3d10_effect_pass
*pass
;
72 enum d3d10_effect_object_type type
;
75 ID3D10RasterizerState
*rs
;
76 ID3D10DepthStencilState
*ds
;
78 ID3D10VertexShader
*vs
;
79 ID3D10PixelShader
*ps
;
80 ID3D10GeometryShader
*gs
;
84 struct d3d10_effect_shader_resource
86 D3D10_SHADER_INPUT_TYPE in_type
;
87 unsigned int bind_point
;
88 unsigned int bind_count
;
90 struct d3d10_effect_variable
*variable
;
93 struct d3d10_effect_shader_signature
98 D3D10_SIGNATURE_PARAMETER_DESC
*elements
;
101 struct d3d10_effect_shader_variable
103 struct d3d10_effect_shader_signature input_signature
;
104 struct d3d10_effect_shader_signature output_signature
;
107 ID3D10VertexShader
*vs
;
108 ID3D10PixelShader
*ps
;
109 ID3D10GeometryShader
*gs
;
112 unsigned int resource_count
;
113 struct d3d10_effect_shader_resource
*resources
;
116 struct d3d10_effect_state_object_variable
120 D3D10_RASTERIZER_DESC rasterizer
;
121 D3D10_DEPTH_STENCIL_DESC depth_stencil
;
122 D3D10_BLEND_DESC blend
;
123 D3D10_SAMPLER_DESC sampler
;
127 ID3D10RasterizerState
*rasterizer
;
128 ID3D10DepthStencilState
*depth_stencil
;
129 ID3D10BlendState
*blend
;
130 ID3D10SamplerState
*sampler
;
134 struct d3d10_effect_resource_variable
136 ID3D10ShaderResourceView
**srv
;
140 struct d3d10_effect_buffer_variable
142 ID3D10Buffer
*buffer
;
143 ID3D10ShaderResourceView
*resource_view
;
149 /* ID3D10EffectType */
150 struct d3d10_effect_type
152 ID3D10EffectType ID3D10EffectType_iface
;
155 D3D10_SHADER_VARIABLE_TYPE basetype
;
156 D3D10_SHADER_VARIABLE_CLASS type_class
;
159 struct wine_rb_entry entry
;
160 struct d3d10_effect
*effect
;
169 struct d3d10_effect_type
*elementtype
;
170 struct d3d10_effect_type_member
*members
;
173 struct d3d10_effect_type_member
178 struct d3d10_effect_type
*type
;
181 /* ID3D10EffectVariable */
182 struct d3d10_effect_variable
184 ID3D10EffectVariable ID3D10EffectVariable_iface
;
186 struct d3d10_effect_variable
*buffer
;
187 struct d3d10_effect_type
*type
;
192 DWORD annotation_count
;
195 struct d3d10_effect
*effect
;
196 struct d3d10_effect_variable
*elements
;
197 struct d3d10_effect_variable
*members
;
198 struct d3d10_effect_variable
*annotations
;
202 struct d3d10_effect_state_object_variable state
;
203 struct d3d10_effect_shader_variable shader
;
204 struct d3d10_effect_buffer_variable buffer
;
205 struct d3d10_effect_resource_variable resource
;
209 /* ID3D10EffectPass */
210 struct d3d10_effect_pass
212 ID3D10EffectPass ID3D10EffectPass_iface
;
214 struct d3d10_effect_technique
*technique
;
218 DWORD annotation_count
;
219 struct d3d10_effect_object
*objects
;
220 struct d3d10_effect_variable
*annotations
;
222 D3D10_PASS_SHADER_DESC vs
;
223 D3D10_PASS_SHADER_DESC ps
;
224 D3D10_PASS_SHADER_DESC gs
;
227 float blend_factor
[4];
230 /* ID3D10EffectTechnique */
231 struct d3d10_effect_technique
233 ID3D10EffectTechnique ID3D10EffectTechnique_iface
;
235 struct d3d10_effect
*effect
;
238 DWORD annotation_count
;
239 struct d3d10_effect_pass
*passes
;
240 struct d3d10_effect_variable
*annotations
;
243 struct d3d10_effect_anonymous_shader
245 struct d3d10_effect_variable shader
;
246 struct d3d10_effect_type type
;
250 extern const struct ID3D10EffectVtbl d3d10_effect_vtbl DECLSPEC_HIDDEN
;
253 ID3D10Effect ID3D10Effect_iface
;
256 ID3D10Device
*device
;
258 DWORD local_buffer_count
;
259 DWORD variable_count
;
260 DWORD local_variable_count
;
261 DWORD sharedbuffers_count
;
262 DWORD sharedobjects_count
;
263 DWORD technique_count
;
266 DWORD depthstencilstate_count
;
267 DWORD blendstate_count
;
268 DWORD rasterizerstate_count
;
269 DWORD samplerstate_count
;
270 DWORD rendertargetview_count
;
271 DWORD depthstencilview_count
;
272 DWORD used_shader_count
;
273 DWORD anonymous_shader_count
;
275 DWORD used_shader_current
;
276 DWORD anonymous_shader_current
;
278 struct wine_rb_tree types
;
279 struct d3d10_effect_variable
*local_buffers
;
280 struct d3d10_effect_variable
*local_variables
;
281 struct d3d10_effect_anonymous_shader
*anonymous_shaders
;
282 struct d3d10_effect_variable
**used_shaders
;
283 struct d3d10_effect_technique
*techniques
;
286 HRESULT
d3d10_effect_parse(struct d3d10_effect
*This
, const void *data
, SIZE_T data_size
) DECLSPEC_HIDDEN
;
289 HRESULT WINAPI
D3D10CoreCreateDevice(IDXGIFactory
*factory
, IDXGIAdapter
*adapter
,
290 unsigned int flags
, D3D_FEATURE_LEVEL feature_level
, ID3D10Device
**device
);
292 #endif /* __WINE_D3D10_PRIVATE_H */