jscript: Added Object function invocation implementation.
[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 /* TRACE helper functions */
33 const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type);
34 const char *debug_d3d10_shader_variable_class(D3D10_SHADER_VARIABLE_CLASS c);
35 const char *debug_d3d10_shader_variable_type(D3D10_SHADER_VARIABLE_TYPE t);
36
37 void *d3d10_rb_alloc(size_t size);
38 void *d3d10_rb_realloc(void *ptr, size_t size);
39 void d3d10_rb_free(void *ptr);
40
41 enum d3d10_effect_object_type
42 {
43     D3D10_EOT_VERTEXSHADER = 6,
44     D3D10_EOT_PIXELSHADER = 7,
45     D3D10_EOT_GEOMETRYSHADER = 8,
46 };
47
48 struct d3d10_effect_object
49 {
50     struct d3d10_effect_pass *pass;
51     enum d3d10_effect_object_type type;
52     DWORD idx_offset;
53     void *data;
54 };
55
56 struct d3d10_effect_shader_variable
57 {
58     char *input_signature;
59     UINT input_signature_size;
60     union
61     {
62         ID3D10VertexShader *vs;
63         ID3D10PixelShader *ps;
64         ID3D10GeometryShader *gs;
65     } shader;
66 };
67
68 /* ID3D10EffectType */
69 struct d3d10_effect_type
70 {
71     const struct ID3D10EffectTypeVtbl *vtbl;
72
73     DWORD id;
74     struct wine_rb_entry entry;
75
76     char *name;
77     DWORD element_count;
78     DWORD size_unpacked;
79     DWORD stride;
80     DWORD size_packed;
81     DWORD member_count;
82     DWORD column_count;
83     DWORD row_count;
84     D3D10_SHADER_VARIABLE_TYPE basetype;
85     D3D10_SHADER_VARIABLE_CLASS type_class;
86 };
87
88 /* ID3D10EffectVariable */
89 struct d3d10_effect_variable
90 {
91     const struct ID3D10EffectVariableVtbl *vtbl;
92
93     struct d3d10_effect_local_buffer *buffer;
94     struct d3d10_effect *effect;
95
96     char *name;
97     char *semantic;
98     DWORD buffer_offset;
99     DWORD annotation_count;
100     DWORD flag;
101     struct d3d10_effect_type *type;
102     struct d3d10_effect_variable *annotations;
103 };
104
105 struct d3d10_effect_local_buffer
106 {
107     const struct ID3D10EffectConstantBufferVtbl *vtbl;
108
109     struct d3d10_effect *effect;
110     char *name;
111     DWORD data_size;
112     DWORD variable_count;
113     DWORD annotation_count;
114     struct d3d10_effect_variable *variables;
115     struct d3d10_effect_variable *annotations;
116 };
117
118 /* ID3D10EffectPass */
119 struct d3d10_effect_pass
120 {
121     const struct ID3D10EffectPassVtbl *vtbl;
122
123     struct d3d10_effect_technique *technique;
124     char *name;
125     DWORD start;
126     DWORD object_count;
127     DWORD annotation_count;
128     struct d3d10_effect_object *objects;
129     struct d3d10_effect_variable *annotations;
130 };
131
132 /* ID3D10EffectTechnique */
133 struct d3d10_effect_technique
134 {
135     const struct ID3D10EffectTechniqueVtbl *vtbl;
136
137     struct d3d10_effect *effect;
138     char *name;
139     DWORD pass_count;
140     DWORD annotation_count;
141     struct d3d10_effect_pass *passes;
142     struct d3d10_effect_variable *annotations;
143 };
144
145 /* ID3D10Effect */
146 extern const struct ID3D10EffectVtbl d3d10_effect_vtbl;
147 struct d3d10_effect
148 {
149     const struct ID3D10EffectVtbl *vtbl;
150     LONG refcount;
151
152     ID3D10Device *device;
153     DWORD version;
154     DWORD local_buffer_count;
155     DWORD variable_count;
156     DWORD object_count;
157     DWORD sharedbuffers_count;
158     DWORD sharedobjects_count;
159     DWORD technique_count;
160     DWORD index_offset;
161     DWORD texture_count;
162     DWORD dephstencilstate_count;
163     DWORD blendstate_count;
164     DWORD rasterizerstate_count;
165     DWORD samplerstate_count;
166     DWORD rendertargetview_count;
167     DWORD depthstencilview_count;
168     DWORD shader_call_count;
169     DWORD shader_compile_count;
170
171     struct wine_rb_tree types;
172     struct d3d10_effect_local_buffer *local_buffers;
173     struct d3d10_effect_technique *techniques;
174 };
175
176 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size);
177
178 /* D3D10Core */
179 HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter,
180         UINT flags, DWORD unknown0, ID3D10Device **device);
181
182 #endif /* __WINE_D3D10_PRIVATE_H */