d3d10: Parse effect shaders as anonymous shaders.
[wine/wine-gecko.git] / dlls / d3d10 / d3d10_private.h
blob85618f5dcc4350e0c87fd9a20f9f86b4bcbf77d1
1 /*
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
22 #include "wine/debug.h"
23 #include "wine/rbtree.h"
25 #define COBJMACROS
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "objbase.h"
30 #include "d3d10.h"
32 /* TRACE helper functions */
33 const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type) DECLSPEC_HIDDEN;
34 const char *debug_d3d10_shader_variable_class(D3D10_SHADER_VARIABLE_CLASS c) DECLSPEC_HIDDEN;
35 const char *debug_d3d10_shader_variable_type(D3D10_SHADER_VARIABLE_TYPE t) DECLSPEC_HIDDEN;
37 void *d3d10_rb_alloc(size_t size) DECLSPEC_HIDDEN;
38 void *d3d10_rb_realloc(void *ptr, size_t size) DECLSPEC_HIDDEN;
39 void d3d10_rb_free(void *ptr) DECLSPEC_HIDDEN;
41 enum d3d10_effect_object_type
43 D3D10_EOT_VERTEXSHADER = 6,
44 D3D10_EOT_PIXELSHADER = 7,
45 D3D10_EOT_GEOMETRYSHADER = 8,
48 enum d3d10_effect_object_operation
50 D3D10_EOO_VALUE = 1,
51 D3D10_EOO_ANONYMOUS_SHADER = 7,
54 struct d3d10_effect_object
56 struct d3d10_effect_pass *pass;
57 enum d3d10_effect_object_type type;
58 DWORD idx_offset;
59 void *data;
62 struct d3d10_effect_shader_variable
64 char *input_signature;
65 UINT input_signature_size;
66 union
68 ID3D10VertexShader *vs;
69 ID3D10PixelShader *ps;
70 ID3D10GeometryShader *gs;
71 } shader;
74 /* ID3D10EffectType */
75 struct d3d10_effect_type
77 const struct ID3D10EffectTypeVtbl *vtbl;
79 DWORD id;
80 struct wine_rb_entry entry;
81 struct d3d10_effect *effect;
83 char *name;
84 DWORD element_count;
85 DWORD size_unpacked;
86 DWORD stride;
87 DWORD size_packed;
88 DWORD member_count;
89 DWORD column_count;
90 DWORD row_count;
91 D3D10_SHADER_VARIABLE_TYPE basetype;
92 D3D10_SHADER_VARIABLE_CLASS type_class;
93 struct d3d10_effect_type *elementtype;
94 struct d3d10_effect_type_member *members;
97 struct d3d10_effect_type_member
99 char *name;
100 char *semantic;
101 DWORD buffer_offset;
102 struct d3d10_effect_type *type;
105 /* ID3D10EffectVariable */
106 struct d3d10_effect_variable
108 const struct ID3D10EffectVariableVtbl *vtbl;
110 struct d3d10_effect_variable *buffer;
111 struct d3d10_effect_type *type;
112 struct d3d10_effect *effect;
114 void *data;
115 char *name;
116 char *semantic;
117 DWORD buffer_offset;
118 DWORD annotation_count;
119 DWORD flag;
120 DWORD data_size;
121 struct d3d10_effect_variable *elements;
122 struct d3d10_effect_variable *members;
123 struct d3d10_effect_variable *annotations;
126 /* ID3D10EffectPass */
127 struct d3d10_effect_pass
129 const struct ID3D10EffectPassVtbl *vtbl;
131 struct d3d10_effect_technique *technique;
132 char *name;
133 DWORD start;
134 DWORD object_count;
135 DWORD annotation_count;
136 struct d3d10_effect_object *objects;
137 struct d3d10_effect_variable *annotations;
140 /* ID3D10EffectTechnique */
141 struct d3d10_effect_technique
143 const struct ID3D10EffectTechniqueVtbl *vtbl;
145 struct d3d10_effect *effect;
146 char *name;
147 DWORD pass_count;
148 DWORD annotation_count;
149 struct d3d10_effect_pass *passes;
150 struct d3d10_effect_variable *annotations;
153 struct d3d10_effect_anonymous_shader
155 struct d3d10_effect_variable shader;
156 struct d3d10_effect_type type;
159 /* ID3D10Effect */
160 extern const struct ID3D10EffectVtbl d3d10_effect_vtbl DECLSPEC_HIDDEN;
161 struct d3d10_effect
163 const struct ID3D10EffectVtbl *vtbl;
164 LONG refcount;
166 ID3D10Device *device;
167 DWORD version;
168 DWORD local_buffer_count;
169 DWORD variable_count;
170 DWORD local_variable_count;
171 DWORD sharedbuffers_count;
172 DWORD sharedobjects_count;
173 DWORD technique_count;
174 DWORD index_offset;
175 DWORD texture_count;
176 DWORD dephstencilstate_count;
177 DWORD blendstate_count;
178 DWORD rasterizerstate_count;
179 DWORD samplerstate_count;
180 DWORD rendertargetview_count;
181 DWORD depthstencilview_count;
182 DWORD shader_call_count;
183 DWORD anonymous_shader_count;
185 DWORD anonymous_shader_current;
187 struct wine_rb_tree types;
188 struct d3d10_effect_variable *local_buffers;
189 struct d3d10_effect_variable *local_variables;
190 struct d3d10_effect_anonymous_shader *anonymous_shaders;
191 struct d3d10_effect_technique *techniques;
194 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size) DECLSPEC_HIDDEN;
196 /* D3D10Core */
197 HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter,
198 UINT flags, void *unknown0, ID3D10Device **device);
200 #endif /* __WINE_D3D10_PRIVATE_H */