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
25 #include "wine/debug.h"
26 #include "wine/rbtree.h"
34 #include "d3dcompiler.h"
38 * This doesn't belong here, but for some functions it is possible to return that value,
39 * see http://msdn.microsoft.com/en-us/library/bb205278%28v=VS.85%29.aspx
40 * The original definition is in D3DX10core.h.
42 #define D3DERR_INVALIDCALL 0x8876086c
44 enum d3d10_effect_object_type_flags
46 D3D10_EOT_FLAG_GS_SO
= 0x1,
49 enum d3d10_effect_object_operation
53 D3D10_EOO_CONST_INDEX
= 3,
54 D3D10_EOO_VAR_INDEX
= 4,
55 D3D10_EOO_INDEX_EXPRESSION
= 5,
56 D3D10_EOO_VALUE_EXPRESSION
= 6,
57 D3D10_EOO_ANONYMOUS_SHADER
= 7,
65 struct d3d10_effect_shader_resource
67 D3D10_SHADER_INPUT_TYPE in_type
;
68 unsigned int bind_point
;
69 unsigned int bind_count
;
71 struct d3d10_effect_variable
*variable
;
74 struct d3d10_effect_shader_signature
77 unsigned int signature_size
;
78 unsigned int element_count
;
79 D3D10_SIGNATURE_PARAMETER_DESC
*elements
;
82 struct d3d10_effect_shader_variable
84 ID3D10ShaderReflection
*reflection
;
85 ID3D10Blob
*input_signature
;
89 ID3D10VertexShader
*vs
;
90 ID3D10PixelShader
*ps
;
91 ID3D10GeometryShader
*gs
;
95 unsigned int resource_count
;
96 struct d3d10_effect_shader_resource
*resources
;
97 char *stream_output_declaration
;
98 unsigned int isinline
: 1;
101 struct d3d10_effect_prop_dependencies
103 struct d3d10_effect_prop_dependency
*entries
;
108 struct d3d10_effect_sampler_desc
110 D3D10_SAMPLER_DESC desc
;
111 struct d3d10_effect_variable
*texture
;
114 struct d3d10_effect_state_object_variable
118 D3D10_RASTERIZER_DESC rasterizer
;
119 D3D10_DEPTH_STENCIL_DESC depth_stencil
;
120 D3D10_BLEND_DESC blend
;
121 struct d3d10_effect_sampler_desc sampler
;
125 ID3D10RasterizerState
*rasterizer
;
126 ID3D10DepthStencilState
*depth_stencil
;
127 ID3D10BlendState
*blend
;
128 ID3D10SamplerState
*sampler
;
132 struct d3d10_effect_prop_dependencies dependencies
;
135 struct d3d10_effect_resource_variable
137 ID3D10ShaderResourceView
**srv
;
141 struct d3d10_effect_buffer_variable
143 ID3D10Buffer
*buffer
;
144 ID3D10ShaderResourceView
*resource_view
;
150 /* ID3D10EffectType */
151 struct d3d10_effect_type
153 ID3D10EffectType ID3D10EffectType_iface
;
156 D3D10_SHADER_VARIABLE_TYPE basetype
;
157 D3D10_SHADER_VARIABLE_CLASS type_class
;
161 struct wine_rb_entry entry
;
162 struct d3d10_effect
*effect
;
164 unsigned int element_count
;
165 unsigned int size_unpacked
;
167 unsigned int size_packed
;
168 unsigned int member_count
;
169 unsigned int column_count
;
170 unsigned int row_count
;
171 struct d3d10_effect_type
*elementtype
;
172 struct d3d10_effect_type_member
*members
;
175 struct d3d10_effect_type_member
179 uint32_t buffer_offset
;
180 struct d3d10_effect_type
*type
;
183 struct d3d10_effect_annotations
185 struct d3d10_effect_variable
*elements
;
189 /* ID3D10EffectVariable */
190 struct d3d10_effect_variable
192 ID3D10EffectVariable ID3D10EffectVariable_iface
;
194 struct d3d10_effect_variable
*buffer
;
195 struct d3d10_effect_type
*type
;
199 uint32_t buffer_offset
;
202 unsigned int explicit_bind_point
;
203 struct d3d10_effect
*effect
;
204 struct d3d10_effect_variable
*elements
;
205 struct d3d10_effect_variable
*members
;
206 struct d3d10_effect_annotations annotations
;
210 struct d3d10_effect_state_object_variable state
;
211 struct d3d10_effect_shader_variable shader
;
212 struct d3d10_effect_buffer_variable buffer
;
213 struct d3d10_effect_resource_variable resource
;
217 struct d3d10_effect_pass_shader_desc
219 struct d3d10_effect_variable
*shader
;
223 /* ID3D10EffectPass */
224 struct d3d10_effect_pass
226 ID3D10EffectPass ID3D10EffectPass_iface
;
228 struct d3d10_effect_technique
*technique
;
230 struct d3d10_effect_annotations annotations
;
232 struct d3d10_effect_prop_dependencies dependencies
;
233 struct d3d10_effect_pass_shader_desc vs
;
234 struct d3d10_effect_pass_shader_desc ps
;
235 struct d3d10_effect_pass_shader_desc gs
;
236 struct d3d10_effect_variable
*rasterizer
;
237 struct d3d10_effect_variable
*depth_stencil
;
238 struct d3d10_effect_variable
*blend
;
241 float blend_factor
[4];
244 /* ID3D10EffectTechnique */
245 struct d3d10_effect_technique
247 ID3D10EffectTechnique ID3D10EffectTechnique_iface
;
249 struct d3d10_effect
*effect
;
251 struct d3d10_effect_annotations annotations
;
252 unsigned int pass_count
;
253 struct d3d10_effect_pass
*passes
;
256 struct d3d10_effect_anonymous_shader
258 struct d3d10_effect_variable shader
;
259 struct d3d10_effect_type type
;
262 enum d3d10_effect_flags
264 D3D10_EFFECT_OPTIMIZED
= 0x1,
265 D3D10_EFFECT_IS_POOL
= 0x2,
268 struct d3d10_effect_var_array
270 struct d3d10_effect_variable
**v
;
271 unsigned int current
;
278 ID3D10Effect ID3D10Effect_iface
;
279 ID3D10EffectPool ID3D10EffectPool_iface
;
282 ID3D10Device
*device
;
283 struct d3d10_effect
*pool
;
285 unsigned int local_buffer_count
;
286 unsigned int variable_count
;
287 unsigned int local_variable_count
;
288 unsigned int shared_buffer_count
;
289 unsigned int shared_object_count
;
290 unsigned int technique_count
;
291 uint32_t index_offset
;
292 unsigned int texture_count
;
293 unsigned int anonymous_shader_count
;
296 unsigned int anonymous_shader_current
;
298 struct wine_rb_tree types
;
299 struct d3d10_effect_variable
*local_buffers
;
300 struct d3d10_effect_variable
*local_variables
;
301 struct d3d10_effect_anonymous_shader
*anonymous_shaders
;
302 struct d3d10_effect_var_array shaders
;
303 struct d3d10_effect_var_array samplers
;
304 struct d3d10_effect_var_array rtvs
;
305 struct d3d10_effect_var_array dsvs
;
306 struct d3d10_effect_var_array blend_states
;
307 struct d3d10_effect_var_array ds_states
;
308 struct d3d10_effect_var_array rs_states
;
309 struct d3d10_effect_technique
*techniques
;
312 HRESULT
d3d10_effect_parse(struct d3d10_effect
*effect
, const void *data
, SIZE_T data_size
) DECLSPEC_HIDDEN
;
315 HRESULT WINAPI
D3D10CoreCreateDevice(IDXGIFactory
*factory
, IDXGIAdapter
*adapter
,
316 unsigned int flags
, D3D_FEATURE_LEVEL feature_level
, ID3D10Device
**device
);
318 #endif /* __WINE_D3D10_PRIVATE_H */