net: Update Portuguese (Brazilian) translation.
[wine] / dlls / d3d10 / d3d10_private.h
1 /*
2  * Copyright 2008-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 #ifndef __WINE_D3D10_PRIVATE_H
20 #define __WINE_D3D10_PRIVATE_H
21
22 #include "wine/debug.h"
23 #include "wine/rbtree.h"
24
25 #define COBJMACROS
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "objbase.h"
29
30 #include "d3d10.h"
31
32 /*
33  * This doesn't belong here, but for some functions it is possible to return that value,
34  * see http://msdn.microsoft.com/en-us/library/bb205278%28v=VS.85%29.aspx
35  * The original definition is in D3DX10core.h.
36  */
37 #define D3DERR_INVALIDCALL 0x8876086c
38
39 /* TRACE helper functions */
40 const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type) DECLSPEC_HIDDEN;
41 const char *debug_d3d10_shader_variable_class(D3D10_SHADER_VARIABLE_CLASS c) DECLSPEC_HIDDEN;
42 const char *debug_d3d10_shader_variable_type(D3D10_SHADER_VARIABLE_TYPE t) DECLSPEC_HIDDEN;
43
44 void *d3d10_rb_alloc(size_t size) DECLSPEC_HIDDEN;
45 void *d3d10_rb_realloc(void *ptr, size_t size) DECLSPEC_HIDDEN;
46 void d3d10_rb_free(void *ptr) DECLSPEC_HIDDEN;
47
48 enum d3d10_effect_object_type
49 {
50     D3D10_EOT_VERTEXSHADER = 6,
51     D3D10_EOT_PIXELSHADER = 7,
52     D3D10_EOT_GEOMETRYSHADER = 8,
53 };
54
55 enum d3d10_effect_object_operation
56 {
57     D3D10_EOO_VALUE = 1,
58     D3D10_EOO_PARSED_OBJECT = 2,
59     D3D10_EOO_PARSED_OBJECT_INDEX = 3,
60     D3D10_EOO_ANONYMOUS_SHADER = 7,
61 };
62
63 struct d3d10_effect_object
64 {
65     struct d3d10_effect_pass *pass;
66     enum d3d10_effect_object_type type;
67     DWORD idx_offset;
68     DWORD index;
69     void *data;
70 };
71
72 struct d3d10_effect_shader_signature
73 {
74     char *signature;
75     UINT signature_size;
76     UINT element_count;
77     D3D10_SIGNATURE_PARAMETER_DESC *elements;
78 };
79
80 struct d3d10_effect_shader_variable
81 {
82     struct d3d10_effect_shader_signature input_signature;
83     struct d3d10_effect_shader_signature output_signature;
84     union
85     {
86         ID3D10VertexShader *vs;
87         ID3D10PixelShader *ps;
88         ID3D10GeometryShader *gs;
89     } shader;
90 };
91
92 /* ID3D10EffectType */
93 struct d3d10_effect_type
94 {
95     const struct ID3D10EffectTypeVtbl *vtbl;
96
97     char *name;
98     D3D10_SHADER_VARIABLE_TYPE basetype;
99     D3D10_SHADER_VARIABLE_CLASS type_class;
100
101     DWORD id;
102     struct wine_rb_entry entry;
103     struct d3d10_effect *effect;
104
105     DWORD element_count;
106     DWORD size_unpacked;
107     DWORD stride;
108     DWORD size_packed;
109     DWORD member_count;
110     DWORD column_count;
111     DWORD row_count;
112     struct d3d10_effect_type *elementtype;
113     struct d3d10_effect_type_member *members;
114 };
115
116 struct d3d10_effect_type_member
117 {
118     char *name;
119     char *semantic;
120     DWORD buffer_offset;
121     struct d3d10_effect_type *type;
122 };
123
124 /* ID3D10EffectVariable */
125 struct d3d10_effect_variable
126 {
127     const struct ID3D10EffectVariableVtbl *vtbl;
128
129     struct d3d10_effect_variable *buffer;
130     struct d3d10_effect_type *type;
131
132     void *data;
133     char *name;
134     char *semantic;
135     DWORD buffer_offset;
136     DWORD annotation_count;
137     DWORD flag;
138     DWORD data_size;
139     struct d3d10_effect *effect;
140     struct d3d10_effect_variable *elements;
141     struct d3d10_effect_variable *members;
142     struct d3d10_effect_variable *annotations;
143 };
144
145 /* ID3D10EffectPass */
146 struct d3d10_effect_pass
147 {
148     const struct ID3D10EffectPassVtbl *vtbl;
149
150     struct d3d10_effect_technique *technique;
151     char *name;
152     DWORD start;
153     DWORD object_count;
154     DWORD annotation_count;
155     struct d3d10_effect_object *objects;
156     struct d3d10_effect_variable *annotations;
157 };
158
159 /* ID3D10EffectTechnique */
160 struct d3d10_effect_technique
161 {
162     const struct ID3D10EffectTechniqueVtbl *vtbl;
163
164     struct d3d10_effect *effect;
165     char *name;
166     DWORD pass_count;
167     DWORD annotation_count;
168     struct d3d10_effect_pass *passes;
169     struct d3d10_effect_variable *annotations;
170 };
171
172 struct d3d10_effect_anonymous_shader
173 {
174     struct d3d10_effect_variable shader;
175     struct d3d10_effect_type type;
176 };
177
178 /* ID3D10Effect */
179 extern const struct ID3D10EffectVtbl d3d10_effect_vtbl DECLSPEC_HIDDEN;
180 struct d3d10_effect
181 {
182     const struct ID3D10EffectVtbl *vtbl;
183     LONG refcount;
184
185     ID3D10Device *device;
186     DWORD version;
187     DWORD local_buffer_count;
188     DWORD variable_count;
189     DWORD local_variable_count;
190     DWORD sharedbuffers_count;
191     DWORD sharedobjects_count;
192     DWORD technique_count;
193     DWORD index_offset;
194     DWORD texture_count;
195     DWORD dephstencilstate_count;
196     DWORD blendstate_count;
197     DWORD rasterizerstate_count;
198     DWORD samplerstate_count;
199     DWORD rendertargetview_count;
200     DWORD depthstencilview_count;
201     DWORD used_shader_count;
202     DWORD anonymous_shader_count;
203
204     DWORD used_shader_current;
205     DWORD anonymous_shader_current;
206
207     struct wine_rb_tree types;
208     struct d3d10_effect_variable *local_buffers;
209     struct d3d10_effect_variable *local_variables;
210     struct d3d10_effect_anonymous_shader *anonymous_shaders;
211     struct d3d10_effect_variable **used_shaders;
212     struct d3d10_effect_technique *techniques;
213 };
214
215 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size) DECLSPEC_HIDDEN;
216
217 /* D3D10Core */
218 HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter,
219         UINT flags, void *unknown0, ID3D10Device **device);
220
221 #endif /* __WINE_D3D10_PRIVATE_H */