msvcr90/tests: Make some tests fail if invalid_parameter_handler was not invoked.
[wine] / dlls / d3d10 / effect.c
1 /*
2  * Copyright 2009 Henri Verbeet for CodeWeavers
3  * Copyright 2009 Rico Schüller
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  *
19  */
20
21 #include "config.h"
22 #include "wine/port.h"
23
24 #include "d3d10_private.h"
25
26 WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
27
28 #define D3D10_FX10_TYPE_COLUMN_SHIFT    11
29 #define D3D10_FX10_TYPE_COLUMN_MASK     (0x7 << D3D10_FX10_TYPE_COLUMN_SHIFT)
30
31 #define D3D10_FX10_TYPE_ROW_SHIFT       8
32 #define D3D10_FX10_TYPE_ROW_MASK        (0x7 << D3D10_FX10_TYPE_ROW_SHIFT)
33
34 #define D3D10_FX10_TYPE_BASETYPE_SHIFT  3
35 #define D3D10_FX10_TYPE_BASETYPE_MASK   (0x1f << D3D10_FX10_TYPE_BASETYPE_SHIFT)
36
37 #define D3D10_FX10_TYPE_CLASS_SHIFT     0
38 #define D3D10_FX10_TYPE_CLASS_MASK      (0x7 << D3D10_FX10_TYPE_CLASS_SHIFT)
39
40 #define D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK 0x4000
41
42 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl;
43 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl;
44 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl;
45 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl;
46 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl;
47 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl;
48 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl;
49 static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl;
50 static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl;
51 static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl;
52 static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl;
53 static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl;
54 static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl;
55 static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl;
56 static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl;
57 static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl;
58 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl;
59
60 /* null objects - needed for invalid calls */
61 static struct d3d10_effect_technique null_technique = {&d3d10_effect_technique_vtbl};
62 static struct d3d10_effect_pass null_pass = {&d3d10_effect_pass_vtbl};
63 static struct d3d10_effect_type null_type = {&d3d10_effect_type_vtbl};
64 static struct d3d10_effect_variable null_local_buffer = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl,
65         &null_local_buffer, &null_type};
66 static struct d3d10_effect_variable null_variable = {&d3d10_effect_variable_vtbl,
67         &null_local_buffer, &null_type};
68 static struct d3d10_effect_variable null_scalar_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl,
69         &null_local_buffer, &null_type};
70 static struct d3d10_effect_variable null_vector_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl,
71         &null_local_buffer, &null_type};
72 static struct d3d10_effect_variable null_matrix_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl,
73         &null_local_buffer, &null_type};
74 static struct d3d10_effect_variable null_string_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl,
75         &null_local_buffer, &null_type};
76 static struct d3d10_effect_variable null_shader_resource_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl,
77         &null_local_buffer, &null_type};
78 static struct d3d10_effect_variable null_render_target_view_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl,
79         &null_local_buffer, &null_type};
80 static struct d3d10_effect_variable null_depth_stencil_view_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl,
81         &null_local_buffer, &null_type};
82 static struct d3d10_effect_variable null_shader_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl,
83         &null_local_buffer, &null_type};
84 static struct d3d10_effect_variable null_blend_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl,
85         &null_local_buffer, &null_type};
86 static struct d3d10_effect_variable null_depth_stencil_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl,
87         &null_local_buffer, &null_type};
88 static struct d3d10_effect_variable null_rasterizer_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl,
89         &null_local_buffer, &null_type};
90 static struct d3d10_effect_variable null_sampler_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl,
91         &null_local_buffer, &null_type};
92
93 /* anonymous_shader_type and anonymous_shader */
94 static char anonymous_name[] = "$Anonymous";
95 static char anonymous_vertexshader_name[] = "vertexshader";
96 static char anonymous_pixelshader_name[] = "pixelshader";
97 static char anonymous_geometryshader_name[] = "geometryshader";
98 static struct d3d10_effect_type anonymous_vs_type = {&d3d10_effect_type_vtbl, anonymous_vertexshader_name,
99         D3D10_SVT_VERTEXSHADER, D3D10_SVC_OBJECT};
100 static struct d3d10_effect_type anonymous_ps_type = {&d3d10_effect_type_vtbl, anonymous_pixelshader_name,
101         D3D10_SVT_PIXELSHADER, D3D10_SVC_OBJECT};
102 static struct d3d10_effect_type anonymous_gs_type = {&d3d10_effect_type_vtbl, anonymous_geometryshader_name,
103         D3D10_SVT_GEOMETRYSHADER, D3D10_SVC_OBJECT};
104 static struct d3d10_effect_variable anonymous_vs = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl,
105         &null_local_buffer, &anonymous_vs_type, &null_shader_variable, anonymous_name};
106 static struct d3d10_effect_variable anonymous_ps = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl,
107         &null_local_buffer, &anonymous_ps_type, &null_shader_variable, anonymous_name};
108 static struct d3d10_effect_variable anonymous_gs = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl,
109         &null_local_buffer, &anonymous_gs_type, &null_shader_variable, anonymous_name};
110
111 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset);
112
113 static BOOL copy_name(const char *ptr, char **name)
114 {
115     size_t name_len;
116
117     if (!ptr) return TRUE;
118
119     name_len = strlen(ptr) + 1;
120     if (name_len == 1)
121     {
122         return TRUE;
123     }
124
125     *name = HeapAlloc(GetProcessHeap(), 0, name_len);
126     if (!*name)
127     {
128         ERR("Failed to allocate name memory.\n");
129         return FALSE;
130     }
131
132     memcpy(*name, ptr, name_len);
133
134     return TRUE;
135 }
136
137 static HRESULT shader_parse_signature(const char *data, DWORD data_size, struct d3d10_effect_shader_signature *s)
138 {
139     D3D10_SIGNATURE_PARAMETER_DESC *e;
140     const char *ptr = data;
141     unsigned int i;
142     DWORD count;
143
144     read_dword(&ptr, &count);
145     TRACE("%u elements\n", count);
146
147     skip_dword_unknown(&ptr, 1);
148
149     e = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*e));
150     if (!e)
151     {
152         ERR("Failed to allocate signature memory.\n");
153         return E_OUTOFMEMORY;
154     }
155
156     for (i = 0; i < count; ++i)
157     {
158         UINT name_offset;
159         UINT mask;
160
161         read_dword(&ptr, &name_offset);
162         e[i].SemanticName = data + name_offset;
163         read_dword(&ptr, &e[i].SemanticIndex);
164         read_dword(&ptr, &e[i].SystemValueType);
165         read_dword(&ptr, &e[i].ComponentType);
166         read_dword(&ptr, &e[i].Register);
167         read_dword(&ptr, &mask);
168
169         e[i].ReadWriteMask = mask >> 8;
170         e[i].Mask = mask & 0xff;
171
172         TRACE("semantic: %s, semantic idx: %u, sysval_semantic %#x, "
173                 "type %u, register idx: %u, use_mask %#x, input_mask %#x\n",
174                 debugstr_a(e[i].SemanticName), e[i].SemanticIndex, e[i].SystemValueType,
175                 e[i].ComponentType, e[i].Register, e[i].Mask, e[i].ReadWriteMask);
176     }
177
178     s->elements = e;
179     s->element_count = count;
180
181     return S_OK;
182 }
183
184 static void shader_free_signature(struct d3d10_effect_shader_signature *s)
185 {
186     HeapFree(GetProcessHeap(), 0, s->signature);
187     HeapFree(GetProcessHeap(), 0, s->elements);
188 }
189
190 static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
191 {
192     struct d3d10_effect_shader_variable *s = ctx;
193     HRESULT hr;
194
195     TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
196
197     TRACE("chunk size: %#x\n", data_size);
198
199     switch(tag)
200     {
201         case TAG_ISGN:
202         case TAG_OSGN:
203         {
204             /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */
205             UINT size = 44 + data_size;
206             struct d3d10_effect_shader_signature *sig;
207             char *ptr;
208
209             if (tag == TAG_ISGN) sig = &s->input_signature;
210             else sig = &s->output_signature;
211
212             sig->signature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
213             if (!sig->signature)
214             {
215                 ERR("Failed to allocate input signature data\n");
216                 return E_OUTOFMEMORY;
217             }
218             sig->signature_size = size;
219
220             ptr = sig->signature;
221
222             write_dword(&ptr, TAG_DXBC);
223
224             /* signature(?) */
225             write_dword_unknown(&ptr, 0);
226             write_dword_unknown(&ptr, 0);
227             write_dword_unknown(&ptr, 0);
228             write_dword_unknown(&ptr, 0);
229
230             /* seems to be always 1 */
231             write_dword_unknown(&ptr, 1);
232
233             /* DXBC size */
234             write_dword(&ptr, size);
235
236             /* chunk count */
237             write_dword(&ptr, 1);
238
239             /* chunk index */
240             write_dword(&ptr, (ptr - sig->signature) + 4);
241
242             /* chunk */
243             write_dword(&ptr, tag);
244             write_dword(&ptr, data_size);
245             memcpy(ptr, data, data_size);
246
247             hr = shader_parse_signature(ptr, data_size, sig);
248             if (FAILED(hr))
249             {
250                 ERR("Failed to parse shader, hr %#x\n", hr);
251                 shader_free_signature(sig);
252             }
253
254             break;
255         }
256
257         default:
258             FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
259             break;
260     }
261
262     return S_OK;
263 }
264
265 static HRESULT parse_shader(struct d3d10_effect_variable *v, const char *data)
266 {
267     ID3D10Device *device = v->effect->device;
268     struct d3d10_effect_shader_variable *s;
269     const char *ptr = data;
270     DWORD dxbc_size;
271     HRESULT hr;
272
273     s = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*s));
274     if (!s)
275     {
276         ERR("Failed to allocate shader variable memory\n");
277         return E_OUTOFMEMORY;
278     }
279
280     v->data = s;
281
282     if (v->effect->used_shader_current >= v->effect->used_shader_count)
283     {
284         WARN("Invalid shader? Used shader current(%u) >= used shader count(%u)\n", v->effect->used_shader_current, v->effect->used_shader_count);
285         return E_FAIL;
286     }
287
288     v->effect->used_shaders[v->effect->used_shader_current] = v;
289     ++v->effect->used_shader_current;
290
291     if (!ptr) return S_OK;
292
293     read_dword(&ptr, &dxbc_size);
294     TRACE("dxbc size: %#x\n", dxbc_size);
295
296     /* We got a shader VertexShader vs = NULL, so it is fine to skip this. */
297     if (!dxbc_size) return S_OK;
298
299     switch (v->type->basetype)
300     {
301         case D3D10_SVT_VERTEXSHADER:
302             hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &s->shader.vs);
303             if (FAILED(hr)) return hr;
304             break;
305
306         case D3D10_SVT_PIXELSHADER:
307             hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &s->shader.ps);
308             if (FAILED(hr)) return hr;
309             break;
310
311         case D3D10_SVT_GEOMETRYSHADER:
312             hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &s->shader.gs);
313             if (FAILED(hr)) return hr;
314             break;
315
316         default:
317             ERR("This should not happen!\n");
318             return E_FAIL;
319     }
320
321     return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, s);
322 }
323
324 static D3D10_SHADER_VARIABLE_CLASS d3d10_variable_class(DWORD c, BOOL is_column_major)
325 {
326     switch (c)
327     {
328         case 1: return D3D10_SVC_SCALAR;
329         case 2: return D3D10_SVC_VECTOR;
330         case 3: if (is_column_major) return D3D10_SVC_MATRIX_COLUMNS;
331                 else return D3D10_SVC_MATRIX_ROWS;
332         default:
333             FIXME("Unknown variable class %#x.\n", c);
334             return 0;
335     }
336 }
337
338 static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(DWORD t, BOOL is_object)
339 {
340     if(is_object)
341     {
342         switch (t)
343         {
344             case 1: return D3D10_SVT_STRING;
345             case 2: return D3D10_SVT_BLEND;
346             case 3: return D3D10_SVT_DEPTHSTENCIL;
347             case 4: return D3D10_SVT_RASTERIZER;
348             case 5: return D3D10_SVT_PIXELSHADER;
349             case 6: return D3D10_SVT_VERTEXSHADER;
350             case 7: return D3D10_SVT_GEOMETRYSHADER;
351
352             case 10: return D3D10_SVT_TEXTURE1D;
353             case 11: return D3D10_SVT_TEXTURE1DARRAY;
354             case 12: return D3D10_SVT_TEXTURE2D;
355             case 13: return D3D10_SVT_TEXTURE2DARRAY;
356             case 14: return D3D10_SVT_TEXTURE2DMS;
357             case 15: return D3D10_SVT_TEXTURE2DMSARRAY;
358             case 16: return D3D10_SVT_TEXTURE3D;
359             case 17: return D3D10_SVT_TEXTURECUBE;
360
361             case 19: return D3D10_SVT_RENDERTARGETVIEW;
362             case 20: return D3D10_SVT_DEPTHSTENCILVIEW;
363             case 21: return D3D10_SVT_SAMPLER;
364             default:
365                 FIXME("Unknown variable type %#x.\n", t);
366                 return 0;
367         }
368     }
369     else
370     {
371         switch (t)
372         {
373             case 1: return D3D10_SVT_FLOAT;
374             case 2: return D3D10_SVT_INT;
375             case 3: return D3D10_SVT_UINT;
376             case 4: return D3D10_SVT_BOOL;
377             default:
378                 FIXME("Unknown variable type %#x.\n", t);
379                 return 0;
380         }
381     }
382 }
383
384 static HRESULT parse_fx10_type(struct d3d10_effect_type *t, const char *ptr, const char *data)
385 {
386     DWORD unknown0;
387     DWORD offset;
388     DWORD typeinfo;
389     unsigned int i;
390
391     read_dword(&ptr, &offset);
392     TRACE("Type name at offset %#x.\n", offset);
393
394     if (!copy_name(data + offset, &t->name))
395     {
396         ERR("Failed to copy name.\n");
397         return E_OUTOFMEMORY;
398     }
399     TRACE("Type name: %s.\n", debugstr_a(t->name));
400
401     read_dword(&ptr, &unknown0);
402     TRACE("Unknown 0: %u.\n", unknown0);
403
404     read_dword(&ptr, &t->element_count);
405     TRACE("Element count: %u.\n", t->element_count);
406
407     read_dword(&ptr, &t->size_unpacked);
408     TRACE("Unpacked size: %#x.\n", t->size_unpacked);
409
410     read_dword(&ptr, &t->stride);
411     TRACE("Stride: %#x.\n", t->stride);
412
413     read_dword(&ptr, &t->size_packed);
414     TRACE("Packed size %#x.\n", t->size_packed);
415
416     switch (unknown0)
417     {
418         case 1:
419             t->member_count = 0;
420
421             read_dword(&ptr, &typeinfo);
422             t->column_count = (typeinfo & D3D10_FX10_TYPE_COLUMN_MASK) >> D3D10_FX10_TYPE_COLUMN_SHIFT;
423             t->row_count = (typeinfo & D3D10_FX10_TYPE_ROW_MASK) >> D3D10_FX10_TYPE_ROW_SHIFT;
424             t->basetype = d3d10_variable_type((typeinfo & D3D10_FX10_TYPE_BASETYPE_MASK) >> D3D10_FX10_TYPE_BASETYPE_SHIFT, FALSE);
425             t->type_class = d3d10_variable_class((typeinfo & D3D10_FX10_TYPE_CLASS_MASK) >> D3D10_FX10_TYPE_CLASS_SHIFT, typeinfo & D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK);
426
427             TRACE("Type description: %#x.\n", typeinfo);
428             TRACE("\tcolumns: %u.\n", t->column_count);
429             TRACE("\trows: %u.\n", t->row_count);
430             TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
431             TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
432             TRACE("\tunknown bits: %#x.\n", typeinfo & ~(D3D10_FX10_TYPE_COLUMN_MASK | D3D10_FX10_TYPE_ROW_MASK
433                     | D3D10_FX10_TYPE_BASETYPE_MASK | D3D10_FX10_TYPE_CLASS_MASK | D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK));
434             break;
435
436         case 2:
437             TRACE("Type is an object.\n");
438
439             t->member_count = 0;
440             t->column_count = 0;
441             t->row_count = 0;
442             t->type_class = D3D10_SVC_OBJECT;
443
444             read_dword(&ptr, &typeinfo);
445             t->basetype = d3d10_variable_type(typeinfo, TRUE);
446
447             TRACE("Type description: %#x.\n", typeinfo);
448             TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
449             TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
450             break;
451
452          case 3:
453             TRACE("Type is a structure.\n");
454
455             read_dword(&ptr, &t->member_count);
456             TRACE("Member count: %u.\n", t->member_count);
457
458             t->column_count = 0;
459             t->row_count = 0;
460             t->basetype = 0;
461             t->type_class = D3D10_SVC_STRUCT;
462
463             t->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->member_count * sizeof(*t->members));
464             if (!t->members)
465             {
466                 ERR("Failed to allocate members memory.\n");
467                 return E_OUTOFMEMORY;
468             }
469
470             for (i = 0; i < t->member_count; ++i)
471             {
472                 struct d3d10_effect_type_member *typem = &t->members[i];
473
474                 read_dword(&ptr, &offset);
475                 TRACE("Member name at offset %#x.\n", offset);
476
477                 if (!copy_name(data + offset, &typem->name))
478                 {
479                     ERR("Failed to copy name.\n");
480                     return E_OUTOFMEMORY;
481                 }
482                 TRACE("Member name: %s.\n", debugstr_a(typem->name));
483
484                 read_dword(&ptr, &offset);
485                 TRACE("Member semantic at offset %#x.\n", offset);
486
487                 if (!copy_name(data + offset, &typem->semantic))
488                 {
489                     ERR("Failed to copy semantic.\n");
490                     return E_OUTOFMEMORY;
491                 }
492                 TRACE("Member semantic: %s.\n", debugstr_a(typem->semantic));
493
494                 read_dword(&ptr, &typem->buffer_offset);
495                 TRACE("Member offset in struct: %#x.\n", typem->buffer_offset);
496
497                 read_dword(&ptr, &offset);
498                 TRACE("Member type info at offset %#x.\n", offset);
499
500                 typem->type = get_fx10_type(t->effect, data, offset);
501                 if (!typem->type)
502                 {
503                     ERR("Failed to get variable type.\n");
504                     return E_FAIL;
505                 }
506             }
507             break;
508
509         default:
510             FIXME("Unhandled case %#x.\n", unknown0);
511             return E_FAIL;
512     }
513
514     if (t->element_count)
515     {
516         TRACE("Elementtype for type at offset: %#x\n", t->id);
517
518         /* allocate elementtype - we need only one, because all elements have the same type */
519         t->elementtype = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*t->elementtype));
520         if (!t->elementtype)
521         {
522             ERR("Failed to allocate members memory.\n");
523             return E_OUTOFMEMORY;
524         }
525
526         /* create a copy of the original type with some minor changes */
527         t->elementtype->vtbl = &d3d10_effect_type_vtbl;
528         t->elementtype->effect = t->effect;
529
530         if (!copy_name(t->name, &t->elementtype->name))
531         {
532              ERR("Failed to copy name.\n");
533              return E_OUTOFMEMORY;
534         }
535         TRACE("\tType name: %s.\n", debugstr_a(t->elementtype->name));
536
537         t->elementtype->element_count = 0;
538         TRACE("\tElement count: %u.\n", t->elementtype->element_count);
539
540         /*
541          * Not sure if this calculation is 100% correct, but a test
542          * show's that these values work.
543          */
544         t->elementtype->size_unpacked = t->size_packed / t->element_count;
545         TRACE("\tUnpacked size: %#x.\n", t->elementtype->size_unpacked);
546
547         t->elementtype->stride = t->stride;
548         TRACE("\tStride: %#x.\n", t->elementtype->stride);
549
550         t->elementtype->size_packed = t->size_packed / t->element_count;
551         TRACE("\tPacked size: %#x.\n", t->elementtype->size_packed);
552
553         t->elementtype->member_count = t->member_count;
554         TRACE("\tMember count: %u.\n", t->elementtype->member_count);
555
556         t->elementtype->column_count = t->column_count;
557         TRACE("\tColumns: %u.\n", t->elementtype->column_count);
558
559         t->elementtype->row_count = t->row_count;
560         TRACE("\tRows: %u.\n", t->elementtype->row_count);
561
562         t->elementtype->basetype = t->basetype;
563         TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(t->elementtype->basetype));
564
565         t->elementtype->type_class = t->type_class;
566         TRACE("\tClass: %s.\n", debug_d3d10_shader_variable_class(t->elementtype->type_class));
567
568         t->elementtype->members = t->members;
569     }
570
571     return S_OK;
572 }
573
574 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset)
575 {
576     struct d3d10_effect_type *type;
577     struct wine_rb_entry *entry;
578     HRESULT hr;
579
580     entry = wine_rb_get(&effect->types, &offset);
581     if (entry)
582     {
583         TRACE("Returning existing type.\n");
584         return WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
585     }
586
587     type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*type));
588     if (!type)
589     {
590         ERR("Failed to allocate type memory.\n");
591         return NULL;
592     }
593
594     type->vtbl = &d3d10_effect_type_vtbl;
595     type->id = offset;
596     type->effect = effect;
597     hr = parse_fx10_type(type, data + offset, data);
598     if (FAILED(hr))
599     {
600         ERR("Failed to parse type info, hr %#x.\n", hr);
601         HeapFree(GetProcessHeap(), 0, type);
602         return NULL;
603     }
604
605     if (wine_rb_put(&effect->types, &offset, &type->entry) == -1)
606     {
607         ERR("Failed to insert type entry.\n");
608         HeapFree(GetProcessHeap(), 0, type);
609         return NULL;
610     }
611
612     return type;
613 }
614
615 static void set_variable_vtbl(struct d3d10_effect_variable *v)
616 {
617     switch (v->type->type_class)
618     {
619         case D3D10_SVC_SCALAR:
620             v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl;
621             break;
622
623         case D3D10_SVC_VECTOR:
624             v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl;
625             break;
626
627         case D3D10_SVC_MATRIX_ROWS:
628         case D3D10_SVC_MATRIX_COLUMNS:
629             v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl;
630             break;
631
632         case D3D10_SVC_STRUCT:
633             v->vtbl = &d3d10_effect_variable_vtbl;
634             break;
635
636         case D3D10_SVC_OBJECT:
637             switch(v->type->basetype)
638             {
639                 case D3D10_SVT_STRING:
640                     v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl;
641                     break;
642
643                 case D3D10_SVT_TEXTURE1D:
644                 case D3D10_SVT_TEXTURE1DARRAY:
645                 case D3D10_SVT_TEXTURE2D:
646                 case D3D10_SVT_TEXTURE2DARRAY:
647                 case D3D10_SVT_TEXTURE2DMS:
648                 case D3D10_SVT_TEXTURE2DMSARRAY:
649                 case D3D10_SVT_TEXTURE3D:
650                 case D3D10_SVT_TEXTURECUBE:
651                     v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl;
652                     break;
653
654                 case D3D10_SVT_RENDERTARGETVIEW:
655                     v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl;
656                     break;
657
658                 case D3D10_SVT_DEPTHSTENCILVIEW:
659                     v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl;
660                     break;
661
662                 case D3D10_SVT_DEPTHSTENCIL:
663                     v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl;
664                     break;
665
666                 case D3D10_SVT_VERTEXSHADER:
667                 case D3D10_SVT_GEOMETRYSHADER:
668                 case D3D10_SVT_PIXELSHADER:
669                     v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl;
670                     break;
671
672                 case D3D10_SVT_BLEND:
673                     v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl;
674                     break;
675
676                 case D3D10_SVT_RASTERIZER:
677                     v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl;
678                     break;
679
680                 case D3D10_SVT_SAMPLER:
681                     v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl;
682                     break;
683
684                 default:
685                     FIXME("Unhandled basetype %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
686                     v->vtbl = &d3d10_effect_variable_vtbl;
687                     break;
688             }
689             break;
690
691         default:
692             FIXME("Unhandled type class %s.\n", debug_d3d10_shader_variable_class(v->type->type_class));
693             v->vtbl = &d3d10_effect_variable_vtbl;
694             break;
695     }
696 }
697
698 static HRESULT copy_variableinfo_from_type(struct d3d10_effect_variable *v)
699 {
700     unsigned int i;
701     HRESULT hr;
702
703     if (v->type->member_count)
704     {
705         v->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->member_count * sizeof(*v->members));
706         if (!v->members)
707         {
708             ERR("Failed to allocate members memory.\n");
709             return E_OUTOFMEMORY;
710         }
711
712         for (i = 0; i < v->type->member_count; ++i)
713         {
714             struct d3d10_effect_variable *var = &v->members[i];
715             struct d3d10_effect_type_member *typem = &v->type->members[i];
716
717             var->buffer = v->buffer;
718             var->effect = v->effect;
719             var->type = typem->type;
720             set_variable_vtbl(var);
721
722             if (!copy_name(typem->name, &var->name))
723             {
724                 ERR("Failed to copy name.\n");
725                 return E_OUTOFMEMORY;
726             }
727             TRACE("Variable name: %s.\n", debugstr_a(var->name));
728
729             if (!copy_name(typem->semantic, &var->semantic))
730             {
731                 ERR("Failed to copy name.\n");
732                 return E_OUTOFMEMORY;
733             }
734             TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
735
736             var->buffer_offset = v->buffer_offset + typem->buffer_offset;
737             TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
738
739             hr = copy_variableinfo_from_type(var);
740             if (FAILED(hr)) return hr;
741         }
742     }
743
744     if (v->type->element_count)
745     {
746         unsigned int bufferoffset = v->buffer_offset;
747
748         v->elements = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->element_count * sizeof(*v->elements));
749         if (!v->elements)
750         {
751             ERR("Failed to allocate elements memory.\n");
752             return E_OUTOFMEMORY;
753         }
754
755         for (i = 0; i < v->type->element_count; ++i)
756         {
757             struct d3d10_effect_variable *var = &v->elements[i];
758
759             var->buffer = v->buffer;
760             var->effect = v->effect;
761             var->type = v->type->elementtype;
762             set_variable_vtbl(var);
763
764             if (!copy_name(v->name, &var->name))
765             {
766                 ERR("Failed to copy name.\n");
767                 return E_OUTOFMEMORY;
768             }
769             TRACE("Variable name: %s.\n", debugstr_a(var->name));
770
771             if (!copy_name(v->semantic, &var->semantic))
772             {
773                 ERR("Failed to copy name.\n");
774                 return E_OUTOFMEMORY;
775             }
776             TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
777
778             if (i != 0)
779             {
780                 bufferoffset += v->type->stride;
781             }
782             var->buffer_offset = bufferoffset;
783             TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
784
785             hr = copy_variableinfo_from_type(var);
786             if (FAILED(hr)) return hr;
787         }
788     }
789
790     return S_OK;
791 }
792
793 static HRESULT parse_fx10_variable_head(struct d3d10_effect_variable *v, const char **ptr, const char *data)
794 {
795     DWORD offset;
796
797     read_dword(ptr, &offset);
798     TRACE("Variable name at offset %#x.\n", offset);
799
800     if (!copy_name(data + offset, &v->name))
801     {
802         ERR("Failed to copy name.\n");
803         return E_OUTOFMEMORY;
804     }
805     TRACE("Variable name: %s.\n", debugstr_a(v->name));
806
807     read_dword(ptr, &offset);
808     TRACE("Variable type info at offset %#x.\n", offset);
809
810     v->type = get_fx10_type(v->effect, data, offset);
811     if (!v->type)
812     {
813         ERR("Failed to get variable type.\n");
814         return E_FAIL;
815     }
816     set_variable_vtbl(v);
817
818     return copy_variableinfo_from_type(v);
819 }
820
821 static HRESULT parse_fx10_annotation(struct d3d10_effect_variable *a, const char **ptr, const char *data)
822 {
823     HRESULT hr;
824
825     hr = parse_fx10_variable_head(a, ptr, data);
826     if (FAILED(hr)) return hr;
827
828     skip_dword_unknown(ptr, 1);
829
830     /* mark the variable as annotation */
831     a->flag = D3D10_EFFECT_VARIABLE_ANNOTATION;
832
833     return S_OK;
834 }
835
836 static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, struct d3d10_effect_anonymous_shader *s,
837     enum d3d10_effect_object_type otype)
838 {
839     struct d3d10_effect_variable *v = &s->shader;
840     struct d3d10_effect_type *t = &s->type;
841     const char *shader = NULL;
842
843     switch (otype)
844     {
845         case D3D10_EOT_VERTEXSHADER:
846             shader = "vertexshader";
847             t->basetype = D3D10_SVT_VERTEXSHADER;
848             break;
849
850         case D3D10_EOT_PIXELSHADER:
851             shader = "pixelshader";
852             t->basetype = D3D10_SVT_PIXELSHADER;
853             break;
854
855         case D3D10_EOT_GEOMETRYSHADER:
856             shader = "geometryshader";
857             t->basetype = D3D10_SVT_GEOMETRYSHADER;
858             break;
859     }
860
861     if (!copy_name(shader, &t->name))
862     {
863         ERR("Failed to copy name.\n");
864         return E_OUTOFMEMORY;
865     }
866     TRACE("Type name: %s.\n", debugstr_a(t->name));
867
868     t->type_class = D3D10_SVC_OBJECT;
869
870     t->vtbl = &d3d10_effect_type_vtbl;
871
872     v->type = t;
873     v->effect = e;
874     set_variable_vtbl(v);
875
876     if (!copy_name("$Anonymous", &v->name))
877     {
878         ERR("Failed to copy semantic.\n");
879         return E_OUTOFMEMORY;
880     }
881     TRACE("Variable name: %s.\n", debugstr_a(v->name));
882
883     if (!copy_name(NULL, &v->semantic))
884     {
885         ERR("Failed to copy semantic.\n");
886         return E_OUTOFMEMORY;
887     }
888     TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
889
890     return S_OK;
891 }
892
893 static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr, const char *data)
894 {
895     const char *data_ptr = NULL;
896     DWORD offset;
897     enum d3d10_effect_object_operation operation;
898     HRESULT hr;
899     struct d3d10_effect *effect = o->pass->technique->effect;
900     ID3D10Effect *e = (ID3D10Effect *)effect;
901
902     read_dword(ptr, &o->type);
903     TRACE("Effect object is of type %#x.\n", o->type);
904
905     read_dword(ptr, &o->index);
906     TRACE("Effect object index %#x.\n", o->index);
907
908     read_dword(ptr, &operation);
909     TRACE("Effect object operation %#x.\n", operation);
910
911     read_dword(ptr, &offset);
912     TRACE("Effect object idx is at offset %#x.\n", offset);
913
914     switch(operation)
915     {
916         case D3D10_EOO_VALUE:
917             TRACE("Copy variable values\n");
918             hr = E_FAIL;
919
920             switch (o->type)
921             {
922                 case D3D10_EOT_VERTEXSHADER:
923                     TRACE("Vertex shader\n");
924                     o->data = &anonymous_vs;
925                     hr = S_OK;
926                     break;
927
928                 case D3D10_EOT_PIXELSHADER:
929                     TRACE("Pixel shader\n");
930                     o->data = &anonymous_ps;
931                     hr = S_OK;
932                     break;
933
934                 case D3D10_EOT_GEOMETRYSHADER:
935                     TRACE("Geometry shader\n");
936                     o->data = &anonymous_gs;
937                     hr = S_OK;
938                     break;
939
940                 default:
941                     FIXME("Unhandled object type %#x\n", o->type);
942                     hr = E_FAIL;
943                     break;
944             }
945             break;
946
947         case D3D10_EOO_PARSED_OBJECT:
948             /* This is a local object, we've parsed in parse_fx10_local_object. */
949             TRACE("Shader = %s.\n", data + offset);
950
951             o->data = e->lpVtbl->GetVariableByName(e, data + offset);
952             hr = S_OK;
953             break;
954
955         case D3D10_EOO_PARSED_OBJECT_INDEX:
956             /* This is a local object, we've parsed in parse_fx10_local_object, which has an array index. */
957             data_ptr = data + offset;
958             read_dword(&data_ptr, &offset);
959             read_dword(&data_ptr, &o->index);
960             TRACE("Shader = %s[%u].\n", data + offset, o->index);
961
962             o->data = e->lpVtbl->GetVariableByName(e, data + offset);
963             hr = S_OK;
964             break;
965
966         case D3D10_EOO_ANONYMOUS_SHADER:
967             TRACE("Anonymous shader\n");
968
969             /* check anonymous_shader_current for validity */
970             if (effect->anonymous_shader_current >= effect->anonymous_shader_count)
971             {
972                 ERR("Anonymous shader count is wrong!\n");
973                 return E_FAIL;
974             }
975
976             data_ptr = data + offset;
977             read_dword(&data_ptr, &offset);
978             TRACE("Effect object starts at offset %#x.\n", offset);
979
980             data_ptr = data + offset;
981
982             hr = parse_fx10_anonymous_shader(effect, &effect->anonymous_shaders[effect->anonymous_shader_current], o->type);
983             if (FAILED(hr)) return hr;
984
985             o->data = &effect->anonymous_shaders[effect->anonymous_shader_current].shader;
986             ++effect->anonymous_shader_current;
987
988             switch (o->type)
989             {
990                 case D3D10_EOT_VERTEXSHADER:
991                     TRACE("Vertex shader\n");
992                     hr = parse_shader(o->data, data_ptr);
993                     break;
994
995                 case D3D10_EOT_PIXELSHADER:
996                     TRACE("Pixel shader\n");
997                     hr = parse_shader(o->data, data_ptr);
998                     break;
999
1000                 case D3D10_EOT_GEOMETRYSHADER:
1001                     TRACE("Geometry shader\n");
1002                     hr = parse_shader(o->data, data_ptr);
1003                     break;
1004
1005                 default:
1006                     FIXME("Unhandled object type %#x\n", o->type);
1007                     hr = E_FAIL;
1008                     break;
1009             }
1010             break;
1011
1012         default:
1013             hr = E_FAIL;
1014             FIXME("Unhandled operation %#x.\n", operation);
1015             break;
1016     }
1017
1018     return hr;
1019 }
1020
1021 static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, const char *data)
1022 {
1023     HRESULT hr = S_OK;
1024     unsigned int i;
1025     DWORD offset;
1026
1027     read_dword(ptr, &offset);
1028     TRACE("Pass name at offset %#x.\n", offset);
1029
1030     if (!copy_name(data + offset, &p->name))
1031     {
1032         ERR("Failed to copy name.\n");
1033         return E_OUTOFMEMORY;
1034     }
1035     TRACE("Pass name: %s.\n", debugstr_a(p->name));
1036
1037     read_dword(ptr, &p->object_count);
1038     TRACE("Pass has %u effect objects.\n", p->object_count);
1039
1040     read_dword(ptr, &p->annotation_count);
1041     TRACE("Pass has %u annotations.\n", p->annotation_count);
1042
1043     p->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->annotation_count * sizeof(*p->annotations));
1044     if (!p->annotations)
1045     {
1046         ERR("Failed to allocate pass annotations memory.\n");
1047         return E_OUTOFMEMORY;
1048     }
1049
1050     for (i = 0; i < p->annotation_count; ++i)
1051     {
1052         struct d3d10_effect_variable *a = &p->annotations[i];
1053
1054         a->effect = p->technique->effect;
1055         a->buffer = &null_local_buffer;
1056
1057         hr = parse_fx10_annotation(a, ptr, data);
1058         if (FAILED(hr)) return hr;
1059     }
1060
1061     p->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->object_count * sizeof(*p->objects));
1062     if (!p->objects)
1063     {
1064         ERR("Failed to allocate effect objects memory.\n");
1065         return E_OUTOFMEMORY;
1066     }
1067
1068     for (i = 0; i < p->object_count; ++i)
1069     {
1070         struct d3d10_effect_object *o = &p->objects[i];
1071
1072         o->pass = p;
1073
1074         hr = parse_fx10_object(o, ptr, data);
1075         if (FAILED(hr)) return hr;
1076     }
1077
1078     return hr;
1079 }
1080
1081 static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char **ptr, const char *data)
1082 {
1083     unsigned int i;
1084     DWORD offset;
1085     HRESULT hr;
1086
1087     read_dword(ptr, &offset);
1088     TRACE("Technique name at offset %#x.\n", offset);
1089
1090     if (!copy_name(data + offset, &t->name))
1091     {
1092         ERR("Failed to copy name.\n");
1093         return E_OUTOFMEMORY;
1094     }
1095     TRACE("Technique name: %s.\n", debugstr_a(t->name));
1096
1097     read_dword(ptr, &t->pass_count);
1098     TRACE("Technique has %u passes\n", t->pass_count);
1099
1100     read_dword(ptr, &t->annotation_count);
1101     TRACE("Technique has %u annotations.\n", t->annotation_count);
1102
1103     t->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->annotation_count * sizeof(*t->annotations));
1104     if (!t->annotations)
1105     {
1106         ERR("Failed to allocate technique annotations memory.\n");
1107         return E_OUTOFMEMORY;
1108     }
1109
1110     for (i = 0; i < t->annotation_count; ++i)
1111     {
1112         struct d3d10_effect_variable *a = &t->annotations[i];
1113
1114         a->effect = t->effect;
1115         a->buffer = &null_local_buffer;
1116
1117         hr = parse_fx10_annotation(a, ptr, data);
1118         if (FAILED(hr)) return hr;
1119     }
1120
1121     t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes));
1122     if (!t->passes)
1123     {
1124         ERR("Failed to allocate passes memory\n");
1125         return E_OUTOFMEMORY;
1126     }
1127
1128     for (i = 0; i < t->pass_count; ++i)
1129     {
1130         struct d3d10_effect_pass *p = &t->passes[i];
1131
1132         p->vtbl = &d3d10_effect_pass_vtbl;
1133         p->technique = t;
1134
1135         hr = parse_fx10_pass(p, ptr, data);
1136         if (FAILED(hr)) return hr;
1137     }
1138
1139     return S_OK;
1140 }
1141
1142 static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
1143 {
1144     DWORD offset;
1145     unsigned int i;
1146     HRESULT hr;
1147
1148     hr = parse_fx10_variable_head(v, ptr, data);
1149     if (FAILED(hr)) return hr;
1150
1151     read_dword(ptr, &offset);
1152     TRACE("Variable semantic at offset %#x.\n", offset);
1153
1154     if (!copy_name(data + offset, &v->semantic))
1155     {
1156         ERR("Failed to copy semantic.\n");
1157         return E_OUTOFMEMORY;
1158     }
1159     TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
1160
1161     read_dword(ptr, &v->buffer_offset);
1162     TRACE("Variable offset in buffer: %#x.\n", v->buffer_offset);
1163
1164     skip_dword_unknown(ptr, 1);
1165
1166     read_dword(ptr, &v->flag);
1167     TRACE("Variable flag: %#x.\n", v->flag);
1168
1169     read_dword(ptr, &v->annotation_count);
1170     TRACE("Variable has %u annotations.\n", v->annotation_count);
1171
1172     v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
1173     if (!v->annotations)
1174     {
1175         ERR("Failed to allocate variable annotations memory.\n");
1176         return E_OUTOFMEMORY;
1177     }
1178
1179     for (i = 0; i < v->annotation_count; ++i)
1180     {
1181         struct d3d10_effect_variable *a = &v->annotations[i];
1182
1183         a->effect = v->effect;
1184         a->buffer = &null_local_buffer;
1185
1186         hr = parse_fx10_annotation(a, ptr, data);
1187         if (FAILED(hr)) return hr;
1188     }
1189
1190     return S_OK;
1191 }
1192
1193 static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
1194 {
1195     unsigned int i;
1196     HRESULT hr;
1197     DWORD offset;
1198
1199     hr = parse_fx10_variable_head(v, ptr, data);
1200     if (FAILED(hr)) return hr;
1201
1202     read_dword(ptr, &offset);
1203     TRACE("Variable semantic at offset %#x.\n", offset);
1204
1205     if (!copy_name(data + offset, &v->semantic))
1206     {
1207         ERR("Failed to copy semantic.\n");
1208         return E_OUTOFMEMORY;
1209     }
1210     TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
1211
1212     skip_dword_unknown(ptr, 1);
1213
1214     switch (v->type->basetype)
1215     {
1216         case D3D10_SVT_TEXTURE1D:
1217         case D3D10_SVT_TEXTURE1DARRAY:
1218         case D3D10_SVT_TEXTURE2D:
1219         case D3D10_SVT_TEXTURE2DARRAY:
1220         case D3D10_SVT_TEXTURE2DMS:
1221         case D3D10_SVT_TEXTURE2DMSARRAY:
1222         case D3D10_SVT_TEXTURE3D:
1223         case D3D10_SVT_TEXTURECUBE:
1224         case D3D10_SVT_RENDERTARGETVIEW:
1225         case D3D10_SVT_DEPTHSTENCILVIEW:
1226             TRACE("SVT could not have elements.\n");
1227             break;
1228
1229         case D3D10_SVT_VERTEXSHADER:
1230         case D3D10_SVT_PIXELSHADER:
1231         case D3D10_SVT_GEOMETRYSHADER:
1232             TRACE("Shader type is %s\n", debug_d3d10_shader_variable_type(v->type->basetype));
1233             for (i = 0; i < max(v->type->element_count, 1); ++i)
1234             {
1235                 DWORD shader_offset;
1236                 struct d3d10_effect_variable *var;
1237
1238                 if (!v->type->element_count)
1239                 {
1240                     var = v;
1241                 }
1242                 else
1243                 {
1244                     var = &v->elements[i];
1245                 }
1246
1247                 read_dword(ptr, &shader_offset);
1248                 TRACE("Shader offset: %#x.\n", shader_offset);
1249
1250                 hr = parse_shader(var, data + shader_offset);
1251                 if (FAILED(hr)) return hr;
1252             }
1253             break;
1254
1255         case D3D10_SVT_DEPTHSTENCIL:
1256         case D3D10_SVT_BLEND:
1257         case D3D10_SVT_RASTERIZER:
1258         case D3D10_SVT_SAMPLER:
1259             TRACE("SVT is a state.\n");
1260             for (i = 0; i < max(v->type->element_count, 1); ++i)
1261             {
1262                 unsigned int j;
1263                 DWORD object_count;
1264
1265                 read_dword(ptr, &object_count);
1266                 TRACE("Object count: %#x.\n", object_count);
1267
1268                 for (j = 0; j < object_count; ++j)
1269                 {
1270                     skip_dword_unknown(ptr, 4);
1271                 }
1272             }
1273             break;
1274
1275         default:
1276             FIXME("Unhandled case %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
1277             return E_FAIL;
1278     }
1279
1280     read_dword(ptr, &v->annotation_count);
1281     TRACE("Variable has %u annotations.\n", v->annotation_count);
1282
1283     v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
1284     if (!v->annotations)
1285     {
1286         ERR("Failed to allocate variable annotations memory.\n");
1287         return E_OUTOFMEMORY;
1288     }
1289
1290     for (i = 0; i < v->annotation_count; ++i)
1291     {
1292         struct d3d10_effect_variable *a = &v->annotations[i];
1293
1294         a->effect = v->effect;
1295         a->buffer = &null_local_buffer;
1296
1297         hr = parse_fx10_annotation(a, ptr, data);
1298         if (FAILED(hr)) return hr;
1299     }
1300
1301     return S_OK;
1302 }
1303
1304 static HRESULT parse_fx10_local_buffer(struct d3d10_effect_variable *l, const char **ptr, const char *data)
1305 {
1306     unsigned int i;
1307     DWORD offset;
1308     D3D10_CBUFFER_TYPE d3d10_cbuffer_type;
1309     HRESULT hr;
1310     unsigned int stride = 0;
1311
1312     /* Generate our own type, it isn't in the fx blob. */
1313     l->type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*l->type));
1314     if (!l->type)
1315     {
1316         ERR("Failed to allocate local buffer type memory.\n");
1317         return E_OUTOFMEMORY;
1318     }
1319     l->type->vtbl = &d3d10_effect_type_vtbl;
1320     l->type->type_class = D3D10_SVC_OBJECT;
1321     l->type->effect = l->effect;
1322
1323     read_dword(ptr, &offset);
1324     TRACE("Local buffer name at offset %#x.\n", offset);
1325
1326     if (!copy_name(data + offset, &l->name))
1327     {
1328         ERR("Failed to copy name.\n");
1329         return E_OUTOFMEMORY;
1330     }
1331     TRACE("Local buffer name: %s.\n", debugstr_a(l->name));
1332
1333     read_dword(ptr, &l->data_size);
1334     TRACE("Local buffer data size: %#x.\n", l->data_size);
1335
1336     read_dword(ptr, &d3d10_cbuffer_type);
1337     TRACE("Local buffer type: %#x.\n", d3d10_cbuffer_type);
1338
1339     switch(d3d10_cbuffer_type)
1340     {
1341         case D3D10_CT_CBUFFER:
1342             l->type->basetype = D3D10_SVT_CBUFFER;
1343             if (!copy_name("cbuffer", &l->type->name))
1344             {
1345                 ERR("Failed to copy name.\n");
1346                 return E_OUTOFMEMORY;
1347             }
1348             break;
1349
1350         case D3D10_CT_TBUFFER:
1351             l->type->basetype = D3D10_SVT_TBUFFER;
1352             if (!copy_name("tbuffer", &l->type->name))
1353             {
1354                 ERR("Failed to copy name.\n");
1355                 return E_OUTOFMEMORY;
1356             }
1357             break;
1358
1359         default:
1360             ERR("Unexpected D3D10_CBUFFER_TYPE %#x!\n", d3d10_cbuffer_type);
1361             return E_FAIL;
1362     }
1363
1364     read_dword(ptr, &l->type->member_count);
1365     TRACE("Local buffer member count: %#x.\n", l->type->member_count);
1366
1367     skip_dword_unknown(ptr, 1);
1368
1369     read_dword(ptr, &l->annotation_count);
1370     TRACE("Local buffer has %u annotations.\n", l->annotation_count);
1371
1372     l->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->annotation_count * sizeof(*l->annotations));
1373     if (!l->annotations)
1374     {
1375         ERR("Failed to allocate local buffer annotations memory.\n");
1376         return E_OUTOFMEMORY;
1377     }
1378
1379     for (i = 0; i < l->annotation_count; ++i)
1380     {
1381         struct d3d10_effect_variable *a = &l->annotations[i];
1382
1383         a->effect = l->effect;
1384         a->buffer = &null_local_buffer;
1385
1386         hr = parse_fx10_annotation(a, ptr, data);
1387         if (FAILED(hr)) return hr;
1388     }
1389
1390     l->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->members));
1391     if (!l->members)
1392     {
1393         ERR("Failed to allocate members memory.\n");
1394         return E_OUTOFMEMORY;
1395     }
1396
1397     l->type->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->type->members));
1398     if (!l->type->members)
1399     {
1400         ERR("Failed to allocate type members memory.\n");
1401         return E_OUTOFMEMORY;
1402     }
1403
1404     for (i = 0; i < l->type->member_count; ++i)
1405     {
1406         struct d3d10_effect_variable *v = &l->members[i];
1407         struct d3d10_effect_type_member *typem = &l->type->members[i];
1408
1409         v->buffer = l;
1410         v->effect = l->effect;
1411
1412         hr = parse_fx10_variable(v, ptr, data);
1413         if (FAILED(hr)) return hr;
1414
1415         /*
1416          * Copy the values from the variable type to the constant buffers type
1417          * members structure, because it is our own generated type.
1418          */
1419         typem->type = v->type;
1420
1421         if (!copy_name(v->name, &typem->name))
1422         {
1423             ERR("Failed to copy name.\n");
1424             return E_OUTOFMEMORY;
1425         }
1426         TRACE("Variable name: %s.\n", debugstr_a(typem->name));
1427
1428         if (!copy_name(v->semantic, &typem->semantic))
1429         {
1430             ERR("Failed to copy name.\n");
1431             return E_OUTOFMEMORY;
1432         }
1433         TRACE("Variable semantic: %s.\n", debugstr_a(typem->semantic));
1434
1435         typem->buffer_offset = v->buffer_offset;
1436         TRACE("Variable buffer offset: %u.\n", typem->buffer_offset);
1437
1438         l->type->size_packed += v->type->size_packed;
1439
1440         /*
1441          * For the complete constantbuffer the size_unpacked = stride,
1442          * the stride is calculated like this:
1443          *
1444          * 1) if the constant buffer variables are packed with packoffset
1445          *    - stride = the highest used constant
1446          *    - the complete stride has to be a multiple of 0x10
1447          *
1448          * 2) if the constant buffer variables are NOT packed with packoffset
1449          *    - sum of unpacked size for all variables which fit in a 0x10 part
1450          *    - if the size exceeds a 0x10 part, the rest of the old part is skipped
1451          *      and a new part is started
1452          *    - if the variable is a struct it is always used a new part
1453          *    - the complete stride has to be a multiple of 0x10
1454          *
1455          *    e.g.:
1456          *             0x4, 0x4, 0x4, 0x8, 0x4, 0x14, 0x4
1457          *        part 0x10           0x10      0x20     -> 0x40
1458          */
1459         if (v->flag & D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT)
1460         {
1461             if ((v->type->size_unpacked + v->buffer_offset) > stride)
1462             {
1463                 stride = v->type->size_unpacked + v->buffer_offset;
1464             }
1465         }
1466         else
1467         {
1468             if (v->type->type_class == D3D10_SVC_STRUCT)
1469             {
1470                 stride = (stride + 0xf) & ~0xf;
1471             }
1472
1473             if ( ((stride & 0xf) + v->type->size_unpacked) > 0x10)
1474             {
1475                 stride = (stride + 0xf) & ~0xf;
1476             }
1477
1478             stride += v->type->size_unpacked;
1479         }
1480     }
1481     l->type->stride = l->type->size_unpacked = (stride + 0xf) & ~0xf;
1482
1483     TRACE("Constant buffer:\n");
1484     TRACE("\tType name: %s.\n", debugstr_a(l->type->name));
1485     TRACE("\tElement count: %u.\n", l->type->element_count);
1486     TRACE("\tMember count: %u.\n", l->type->member_count);
1487     TRACE("\tUnpacked size: %#x.\n", l->type->size_unpacked);
1488     TRACE("\tStride: %#x.\n", l->type->stride);
1489     TRACE("\tPacked size %#x.\n", l->type->size_packed);
1490     TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l->type->basetype));
1491     TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l->type->type_class));
1492
1493     return S_OK;
1494 }
1495
1496 static int d3d10_effect_type_compare(const void *key, const struct wine_rb_entry *entry)
1497 {
1498     const struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, const struct d3d10_effect_type, entry);
1499     const DWORD *id = key;
1500
1501     return *id - t->id;
1502 }
1503
1504 static void d3d10_effect_type_member_destroy(struct d3d10_effect_type_member *typem)
1505 {
1506     TRACE("effect type member %p.\n", typem);
1507
1508     /* Do not release typem->type, it will be covered by d3d10_effect_type_destroy(). */
1509     HeapFree(GetProcessHeap(), 0, typem->semantic);
1510     HeapFree(GetProcessHeap(), 0, typem->name);
1511 }
1512
1513 static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context)
1514 {
1515     struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
1516
1517     TRACE("effect type %p.\n", t);
1518
1519     if (t->elementtype)
1520     {
1521         HeapFree(GetProcessHeap(), 0, t->elementtype->name);
1522         HeapFree(GetProcessHeap(), 0, t->elementtype);
1523     }
1524
1525     if (t->members)
1526     {
1527         unsigned int i;
1528
1529         for (i = 0; i < t->member_count; ++i)
1530         {
1531             d3d10_effect_type_member_destroy(&t->members[i]);
1532         }
1533         HeapFree(GetProcessHeap(), 0, t->members);
1534     }
1535
1536     HeapFree(GetProcessHeap(), 0, t->name);
1537     HeapFree(GetProcessHeap(), 0, t);
1538 }
1539
1540 static const struct wine_rb_functions d3d10_effect_type_rb_functions =
1541 {
1542     d3d10_rb_alloc,
1543     d3d10_rb_realloc,
1544     d3d10_rb_free,
1545     d3d10_effect_type_compare,
1546 };
1547
1548 static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size)
1549 {
1550     const char *ptr = data + e->index_offset;
1551     unsigned int i;
1552     HRESULT hr;
1553
1554     if (wine_rb_init(&e->types, &d3d10_effect_type_rb_functions) == -1)
1555     {
1556         ERR("Failed to initialize type rbtree.\n");
1557         return E_FAIL;
1558     }
1559
1560     e->local_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_buffer_count * sizeof(*e->local_buffers));
1561     if (!e->local_buffers)
1562     {
1563         ERR("Failed to allocate local buffer memory.\n");
1564         return E_OUTOFMEMORY;
1565     }
1566
1567     e->local_variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_variable_count * sizeof(*e->local_variables));
1568     if (!e->local_variables)
1569     {
1570         ERR("Failed to allocate local variable memory.\n");
1571         return E_OUTOFMEMORY;
1572     }
1573
1574     e->anonymous_shaders = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->anonymous_shader_count * sizeof(*e->anonymous_shaders));
1575     if (!e->anonymous_shaders)
1576     {
1577         ERR("Failed to allocate anonymous shaders memory\n");
1578         return E_OUTOFMEMORY;
1579     }
1580
1581     e->used_shaders = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->used_shader_count * sizeof(*e->used_shaders));
1582     if (!e->used_shaders)
1583     {
1584         ERR("Failed to allocate used shaders memory\n");
1585         return E_OUTOFMEMORY;
1586     }
1587
1588     e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques));
1589     if (!e->techniques)
1590     {
1591         ERR("Failed to allocate techniques memory\n");
1592         return E_OUTOFMEMORY;
1593     }
1594
1595     for (i = 0; i < e->local_buffer_count; ++i)
1596     {
1597         struct d3d10_effect_variable *l = &e->local_buffers[i];
1598         l->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl;
1599         l->effect = e;
1600         l->buffer = &null_local_buffer;
1601
1602         hr = parse_fx10_local_buffer(l, &ptr, data);
1603         if (FAILED(hr)) return hr;
1604     }
1605
1606     for (i = 0; i < e->local_variable_count; ++i)
1607     {
1608         struct d3d10_effect_variable *v = &e->local_variables[i];
1609
1610         v->effect = e;
1611         v->vtbl = &d3d10_effect_variable_vtbl;
1612         v->buffer = &null_local_buffer;
1613
1614         hr = parse_fx10_local_variable(v, &ptr, data);
1615         if (FAILED(hr)) return hr;
1616     }
1617
1618     for (i = 0; i < e->technique_count; ++i)
1619     {
1620         struct d3d10_effect_technique *t = &e->techniques[i];
1621
1622         t->vtbl = &d3d10_effect_technique_vtbl;
1623         t->effect = e;
1624
1625         hr = parse_fx10_technique(t, &ptr, data);
1626         if (FAILED(hr)) return hr;
1627     }
1628
1629     return S_OK;
1630 }
1631
1632 static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_size)
1633 {
1634     const char *ptr = data;
1635     DWORD unknown;
1636
1637     /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
1638     read_dword(&ptr, &e->version);
1639     TRACE("Target: %#x\n", e->version);
1640
1641     read_dword(&ptr, &e->local_buffer_count);
1642     TRACE("Local buffer count: %u.\n", e->local_buffer_count);
1643
1644     read_dword(&ptr, &e->variable_count);
1645     TRACE("Variable count: %u\n", e->variable_count);
1646
1647     read_dword(&ptr, &e->local_variable_count);
1648     TRACE("Object count: %u\n", e->local_variable_count);
1649
1650     read_dword(&ptr, &e->sharedbuffers_count);
1651     TRACE("Sharedbuffers count: %u\n", e->sharedbuffers_count);
1652
1653     /* Number of variables in shared buffers? */
1654     read_dword(&ptr, &unknown);
1655     FIXME("Unknown 0: %u\n", unknown);
1656
1657     read_dword(&ptr, &e->sharedobjects_count);
1658     TRACE("Sharedobjects count: %u\n", e->sharedobjects_count);
1659
1660     read_dword(&ptr, &e->technique_count);
1661     TRACE("Technique count: %u\n", e->technique_count);
1662
1663     read_dword(&ptr, &e->index_offset);
1664     TRACE("Index offset: %#x\n", e->index_offset);
1665
1666     read_dword(&ptr, &unknown);
1667     FIXME("Unknown 1: %u\n", unknown);
1668
1669     read_dword(&ptr, &e->texture_count);
1670     TRACE("Texture count: %u\n", e->texture_count);
1671
1672     read_dword(&ptr, &e->dephstencilstate_count);
1673     TRACE("Depthstencilstate count: %u\n", e->dephstencilstate_count);
1674
1675     read_dword(&ptr, &e->blendstate_count);
1676     TRACE("Blendstate count: %u\n", e->blendstate_count);
1677
1678     read_dword(&ptr, &e->rasterizerstate_count);
1679     TRACE("Rasterizerstate count: %u\n", e->rasterizerstate_count);
1680
1681     read_dword(&ptr, &e->samplerstate_count);
1682     TRACE("Samplerstate count: %u\n", e->samplerstate_count);
1683
1684     read_dword(&ptr, &e->rendertargetview_count);
1685     TRACE("Rendertargetview count: %u\n", e->rendertargetview_count);
1686
1687     read_dword(&ptr, &e->depthstencilview_count);
1688     TRACE("Depthstencilview count: %u\n", e->depthstencilview_count);
1689
1690     read_dword(&ptr, &e->used_shader_count);
1691     TRACE("Used shader count: %u\n", e->used_shader_count);
1692
1693     read_dword(&ptr, &e->anonymous_shader_count);
1694     TRACE("Anonymous shader count: %u\n", e->anonymous_shader_count);
1695
1696     return parse_fx10_body(e, ptr, data_size - (ptr - data));
1697 }
1698
1699 static HRESULT fx10_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
1700 {
1701     struct d3d10_effect *e = ctx;
1702
1703     TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
1704
1705     TRACE("chunk size: %#x\n", data_size);
1706
1707     switch(tag)
1708     {
1709         case TAG_FX10:
1710             return parse_fx10(e, data, data_size);
1711
1712         default:
1713             FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
1714             return S_OK;
1715     }
1716 }
1717
1718 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size)
1719 {
1720     return parse_dxbc(data, data_size, fx10_chunk_handler, This);
1721 }
1722
1723 static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
1724 {
1725     ID3D10Device *device = o->pass->technique->effect->device;
1726     struct d3d10_effect_variable *v = (struct d3d10_effect_variable*) o->data;
1727
1728     TRACE("effect object %p, type %#x.\n", o, o->type);
1729
1730     switch(o->type)
1731     {
1732         case D3D10_EOT_VERTEXSHADER:
1733             ID3D10Device_VSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.vs);
1734             return S_OK;
1735
1736         case D3D10_EOT_PIXELSHADER:
1737             ID3D10Device_PSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.ps);
1738             return S_OK;
1739
1740         case D3D10_EOT_GEOMETRYSHADER:
1741             ID3D10Device_GSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.gs);
1742             return S_OK;
1743
1744         default:
1745             FIXME("Unhandled effect object type %#x.\n", o->type);
1746             return E_FAIL;
1747     }
1748 }
1749
1750 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
1751 {
1752     unsigned int i;
1753
1754     TRACE("variable %p.\n", v);
1755
1756     HeapFree(GetProcessHeap(), 0, v->name);
1757     HeapFree(GetProcessHeap(), 0, v->semantic);
1758     if (v->annotations)
1759     {
1760         for (i = 0; i < v->annotation_count; ++i)
1761         {
1762             d3d10_effect_variable_destroy(&v->annotations[i]);
1763         }
1764         HeapFree(GetProcessHeap(), 0, v->annotations);
1765     }
1766
1767     if (v->members)
1768     {
1769         for (i = 0; i < v->type->member_count; ++i)
1770         {
1771             d3d10_effect_variable_destroy(&v->members[i]);
1772         }
1773         HeapFree(GetProcessHeap(), 0, v->members);
1774     }
1775
1776     if (v->elements)
1777     {
1778         for (i = 0; i < v->type->element_count; ++i)
1779         {
1780             d3d10_effect_variable_destroy(&v->elements[i]);
1781         }
1782         HeapFree(GetProcessHeap(), 0, v->elements);
1783     }
1784
1785     if (v->data)
1786     {
1787         switch(v->type->basetype)
1788         {
1789             case D3D10_SVT_VERTEXSHADER:
1790             case D3D10_SVT_PIXELSHADER:
1791             case D3D10_SVT_GEOMETRYSHADER:
1792                 shader_free_signature(&((struct d3d10_effect_shader_variable *)v->data)->input_signature);
1793                 shader_free_signature(&((struct d3d10_effect_shader_variable *)v->data)->output_signature);
1794                 break;
1795
1796             default:
1797                 break;
1798         }
1799         HeapFree(GetProcessHeap(), 0, v->data);
1800     }
1801 }
1802
1803 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p)
1804 {
1805     unsigned int i;
1806
1807     TRACE("pass %p\n", p);
1808
1809     HeapFree(GetProcessHeap(), 0, p->name);
1810     HeapFree(GetProcessHeap(), 0, p->objects);
1811
1812     if (p->annotations)
1813     {
1814         for (i = 0; i < p->annotation_count; ++i)
1815         {
1816             d3d10_effect_variable_destroy(&p->annotations[i]);
1817         }
1818         HeapFree(GetProcessHeap(), 0, p->annotations);
1819     }
1820 }
1821
1822 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
1823 {
1824     unsigned int i;
1825
1826     TRACE("technique %p\n", t);
1827
1828     HeapFree(GetProcessHeap(), 0, t->name);
1829     if (t->passes)
1830     {
1831         for (i = 0; i < t->pass_count; ++i)
1832         {
1833             d3d10_effect_pass_destroy(&t->passes[i]);
1834         }
1835         HeapFree(GetProcessHeap(), 0, t->passes);
1836     }
1837
1838     if (t->annotations)
1839     {
1840         for (i = 0; i < t->annotation_count; ++i)
1841         {
1842             d3d10_effect_variable_destroy(&t->annotations[i]);
1843         }
1844         HeapFree(GetProcessHeap(), 0, t->annotations);
1845     }
1846 }
1847
1848 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_variable *l)
1849 {
1850     unsigned int i;
1851
1852     TRACE("local buffer %p.\n", l);
1853
1854     HeapFree(GetProcessHeap(), 0, l->name);
1855     if (l->members)
1856     {
1857         for (i = 0; i < l->type->member_count; ++i)
1858         {
1859             d3d10_effect_variable_destroy(&l->members[i]);
1860         }
1861         HeapFree(GetProcessHeap(), 0, l->members);
1862     }
1863
1864     if (l->type->members)
1865     {
1866         for (i = 0; i < l->type->member_count; ++i)
1867         {
1868             /* Do not release l->type->members[i].type, it will be covered by d3d10_effect_type_destroy(). */
1869             HeapFree(GetProcessHeap(), 0, l->type->members[i].semantic);
1870             HeapFree(GetProcessHeap(), 0, l->type->members[i].name);
1871         }
1872         HeapFree(GetProcessHeap(), 0, l->type->members);
1873     }
1874     HeapFree(GetProcessHeap(), 0, l->type->name);
1875     HeapFree(GetProcessHeap(), 0, l->type);
1876
1877     if (l->annotations)
1878     {
1879         for (i = 0; i < l->annotation_count; ++i)
1880         {
1881             d3d10_effect_variable_destroy(&l->annotations[i]);
1882         }
1883         HeapFree(GetProcessHeap(), 0, l->annotations);
1884     }
1885 }
1886
1887 /* IUnknown methods */
1888
1889 static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
1890 {
1891     TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
1892
1893     if (IsEqualGUID(riid, &IID_ID3D10Effect)
1894             || IsEqualGUID(riid, &IID_IUnknown))
1895     {
1896         IUnknown_AddRef(iface);
1897         *object = iface;
1898         return S_OK;
1899     }
1900
1901     WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
1902
1903     *object = NULL;
1904     return E_NOINTERFACE;
1905 }
1906
1907 static ULONG STDMETHODCALLTYPE d3d10_effect_AddRef(ID3D10Effect *iface)
1908 {
1909     struct d3d10_effect *This = (struct d3d10_effect *)iface;
1910     ULONG refcount = InterlockedIncrement(&This->refcount);
1911
1912     TRACE("%p increasing refcount to %u\n", This, refcount);
1913
1914     return refcount;
1915 }
1916
1917 static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
1918 {
1919     struct d3d10_effect *This = (struct d3d10_effect *)iface;
1920     ULONG refcount = InterlockedDecrement(&This->refcount);
1921
1922     TRACE("%p decreasing refcount to %u\n", This, refcount);
1923
1924     if (!refcount)
1925     {
1926         unsigned int i;
1927
1928         if (This->techniques)
1929         {
1930             for (i = 0; i < This->technique_count; ++i)
1931             {
1932                 d3d10_effect_technique_destroy(&This->techniques[i]);
1933             }
1934             HeapFree(GetProcessHeap(), 0, This->techniques);
1935         }
1936
1937         if (This->local_variables)
1938         {
1939             for (i = 0; i < This->local_variable_count; ++i)
1940             {
1941                 d3d10_effect_variable_destroy(&This->local_variables[i]);
1942             }
1943             HeapFree(GetProcessHeap(), 0, This->local_variables);
1944         }
1945
1946         if (This->local_buffers)
1947         {
1948             for (i = 0; i < This->local_buffer_count; ++i)
1949             {
1950                 d3d10_effect_local_buffer_destroy(&This->local_buffers[i]);
1951             }
1952             HeapFree(GetProcessHeap(), 0, This->local_buffers);
1953         }
1954
1955         if (This->anonymous_shaders)
1956         {
1957             for (i = 0; i < This->anonymous_shader_count; ++i)
1958             {
1959                 d3d10_effect_variable_destroy(&This->anonymous_shaders[i].shader);
1960                 HeapFree(GetProcessHeap(), 0, This->anonymous_shaders[i].type.name);
1961             }
1962             HeapFree(GetProcessHeap(), 0, This->anonymous_shaders);
1963         }
1964
1965         HeapFree(GetProcessHeap(), 0, This->used_shaders);
1966
1967         wine_rb_destroy(&This->types, d3d10_effect_type_destroy, NULL);
1968
1969         ID3D10Device_Release(This->device);
1970         HeapFree(GetProcessHeap(), 0, This);
1971     }
1972
1973     return refcount;
1974 }
1975
1976 /* ID3D10Effect methods */
1977
1978 static BOOL STDMETHODCALLTYPE d3d10_effect_IsValid(ID3D10Effect *iface)
1979 {
1980     FIXME("iface %p stub!\n", iface);
1981
1982     return FALSE;
1983 }
1984
1985 static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
1986 {
1987     FIXME("iface %p stub!\n", iface);
1988
1989     return FALSE;
1990 }
1991
1992 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
1993 {
1994     struct d3d10_effect *This = (struct d3d10_effect *)iface;
1995
1996     TRACE("iface %p, device %p\n", iface, device);
1997
1998     ID3D10Device_AddRef(This->device);
1999     *device = This->device;
2000
2001     return S_OK;
2002 }
2003
2004 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)
2005 {
2006     FIXME("iface %p, desc %p stub!\n", iface, desc);
2007
2008     return E_NOTIMPL;
2009 }
2010
2011 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface,
2012         UINT index)
2013 {
2014     struct d3d10_effect *This = (struct d3d10_effect *)iface;
2015     struct d3d10_effect_variable *l;
2016
2017     TRACE("iface %p, index %u\n", iface, index);
2018
2019     if (index >= This->local_buffer_count)
2020     {
2021         WARN("Invalid index specified\n");
2022         return (ID3D10EffectConstantBuffer *)&null_local_buffer;
2023     }
2024
2025     l = &This->local_buffers[index];
2026
2027     TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name));
2028
2029     return (ID3D10EffectConstantBuffer *)l;
2030 }
2031
2032 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,
2033         LPCSTR name)
2034 {
2035     struct d3d10_effect *This = (struct d3d10_effect *)iface;
2036     unsigned int i;
2037
2038     TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2039
2040     for (i = 0; i < This->local_buffer_count; ++i)
2041     {
2042         struct d3d10_effect_variable *l = &This->local_buffers[i];
2043
2044         if (!strcmp(l->name, name))
2045         {
2046             TRACE("Returning buffer %p.\n", l);
2047             return (ID3D10EffectConstantBuffer *)l;
2048         }
2049     }
2050
2051     WARN("Invalid name specified\n");
2052
2053     return (ID3D10EffectConstantBuffer *)&null_local_buffer;
2054 }
2055
2056 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index)
2057 {
2058     struct d3d10_effect *This = (struct d3d10_effect *)iface;
2059     unsigned int i;
2060
2061     TRACE("iface %p, index %u\n", iface, index);
2062
2063     for (i = 0; i < This->local_buffer_count; ++i)
2064     {
2065         struct d3d10_effect_variable *l = &This->local_buffers[i];
2066
2067         if (index < l->type->member_count)
2068         {
2069             struct d3d10_effect_variable *v = &l->members[index];
2070
2071             TRACE("Returning variable %p.\n", v);
2072             return (ID3D10EffectVariable *)v;
2073         }
2074         index -= l->type->member_count;
2075     }
2076
2077     if (index < This->local_variable_count)
2078     {
2079         struct d3d10_effect_variable *v = &This->local_variables[index];
2080
2081         TRACE("Returning variable %p.\n", v);
2082         return (ID3D10EffectVariable *)v;
2083     }
2084
2085     WARN("Invalid index specified\n");
2086
2087     return (ID3D10EffectVariable *)&null_variable;
2088 }
2089
2090 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name)
2091 {
2092     struct d3d10_effect *This = (struct d3d10_effect *)iface;
2093     unsigned int i;
2094
2095     TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2096
2097     if (!name)
2098     {
2099         WARN("Invalid name specified\n");
2100         return (ID3D10EffectVariable *)&null_variable;
2101     }
2102
2103     for (i = 0; i < This->local_buffer_count; ++i)
2104     {
2105         struct d3d10_effect_variable *l = &This->local_buffers[i];
2106         unsigned int j;
2107
2108         for (j = 0; j < l->type->member_count; ++j)
2109         {
2110             struct d3d10_effect_variable *v = &l->members[j];
2111
2112             if (!strcmp(v->name, name))
2113             {
2114                 TRACE("Returning variable %p.\n", v);
2115                 return (ID3D10EffectVariable *)v;
2116             }
2117         }
2118     }
2119
2120     for (i = 0; i < This->local_variable_count; ++i)
2121     {
2122         struct d3d10_effect_variable *v = &This->local_variables[i];
2123
2124         if (!strcmp(v->name, name))
2125         {
2126             TRACE("Returning variable %p.\n", v);
2127             return (ID3D10EffectVariable *)v;
2128         }
2129     }
2130
2131     WARN("Invalid name specified\n");
2132
2133     return (ID3D10EffectVariable *)&null_variable;
2134 }
2135
2136 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface,
2137         LPCSTR semantic)
2138 {
2139     struct d3d10_effect *This = (struct d3d10_effect *)iface;
2140     unsigned int i;
2141
2142     TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
2143
2144     if (!semantic)
2145     {
2146         WARN("Invalid semantic specified\n");
2147         return (ID3D10EffectVariable *)&null_variable;
2148     }
2149
2150     for (i = 0; i < This->local_buffer_count; ++i)
2151     {
2152         struct d3d10_effect_variable *l = &This->local_buffers[i];
2153         unsigned int j;
2154
2155         for (j = 0; j < l->type->member_count; ++j)
2156         {
2157             struct d3d10_effect_variable *v = &l->members[j];
2158
2159             if (!strcmp(v->semantic, semantic))
2160             {
2161                 TRACE("Returning variable %p.\n", v);
2162                 return (ID3D10EffectVariable *)v;
2163             }
2164         }
2165     }
2166
2167     for (i = 0; i < This->local_variable_count; ++i)
2168     {
2169         struct d3d10_effect_variable *v = &This->local_variables[i];
2170
2171         if (!strcmp(v->semantic, semantic))
2172         {
2173             TRACE("Returning variable %p.\n", v);
2174             return (ID3D10EffectVariable *)v;
2175         }
2176     }
2177
2178     WARN("Invalid semantic specified\n");
2179
2180     return (ID3D10EffectVariable *)&null_variable;
2181 }
2182
2183 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByIndex(ID3D10Effect *iface,
2184         UINT index)
2185 {
2186     struct d3d10_effect *This = (struct d3d10_effect *)iface;
2187     struct d3d10_effect_technique *t;
2188
2189     TRACE("iface %p, index %u\n", iface, index);
2190
2191     if (index >= This->technique_count)
2192     {
2193         WARN("Invalid index specified\n");
2194         return (ID3D10EffectTechnique *)&null_technique;
2195     }
2196
2197     t = &This->techniques[index];
2198
2199     TRACE("Returning technique %p, %s.\n", t, debugstr_a(t->name));
2200
2201     return (ID3D10EffectTechnique *)t;
2202 }
2203
2204 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByName(ID3D10Effect *iface,
2205         LPCSTR name)
2206 {
2207     struct d3d10_effect *This = (struct d3d10_effect *)iface;
2208     unsigned int i;
2209
2210     TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2211
2212     if (!name)
2213     {
2214         WARN("Invalid name specified\n");
2215         return (ID3D10EffectTechnique *)&null_technique;
2216     }
2217
2218     for (i = 0; i < This->technique_count; ++i)
2219     {
2220         struct d3d10_effect_technique *t = &This->techniques[i];
2221         if (!strcmp(t->name, name))
2222         {
2223             TRACE("Returning technique %p\n", t);
2224             return (ID3D10EffectTechnique *)t;
2225         }
2226     }
2227
2228     WARN("Invalid name specified\n");
2229
2230     return (ID3D10EffectTechnique *)&null_technique;
2231 }
2232
2233 static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
2234 {
2235     FIXME("iface %p stub!\n", iface);
2236
2237     return E_NOTIMPL;
2238 }
2239
2240 static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface)
2241 {
2242     FIXME("iface %p stub!\n", iface);
2243
2244     return FALSE;
2245 }
2246
2247 const struct ID3D10EffectVtbl d3d10_effect_vtbl =
2248 {
2249     /* IUnknown methods */
2250     d3d10_effect_QueryInterface,
2251     d3d10_effect_AddRef,
2252     d3d10_effect_Release,
2253     /* ID3D10Effect methods */
2254     d3d10_effect_IsValid,
2255     d3d10_effect_IsPool,
2256     d3d10_effect_GetDevice,
2257     d3d10_effect_GetDesc,
2258     d3d10_effect_GetConstantBufferByIndex,
2259     d3d10_effect_GetConstantBufferByName,
2260     d3d10_effect_GetVariableByIndex,
2261     d3d10_effect_GetVariableByName,
2262     d3d10_effect_GetVariableBySemantic,
2263     d3d10_effect_GetTechniqueByIndex,
2264     d3d10_effect_GetTechniqueByName,
2265     d3d10_effect_Optimize,
2266     d3d10_effect_IsOptimized,
2267 };
2268
2269 /* ID3D10EffectTechnique methods */
2270
2271 static BOOL STDMETHODCALLTYPE d3d10_effect_technique_IsValid(ID3D10EffectTechnique *iface)
2272 {
2273     TRACE("iface %p\n", iface);
2274
2275     return (struct d3d10_effect_technique *)iface != &null_technique;
2276 }
2277
2278 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_GetDesc(ID3D10EffectTechnique *iface,
2279         D3D10_TECHNIQUE_DESC *desc)
2280 {
2281     struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
2282
2283     TRACE("iface %p, desc %p\n", iface, desc);
2284
2285     if(This == &null_technique)
2286     {
2287         WARN("Null technique specified\n");
2288         return E_FAIL;
2289     }
2290
2291     if(!desc)
2292     {
2293         WARN("Invalid argument specified\n");
2294         return E_INVALIDARG;
2295     }
2296
2297     desc->Name = This->name;
2298     desc->Passes = This->pass_count;
2299     desc->Annotations = This->annotation_count;
2300
2301     return S_OK;
2302 }
2303
2304 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByIndex(
2305         ID3D10EffectTechnique *iface, UINT index)
2306 {
2307     struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
2308     struct d3d10_effect_variable *a;
2309
2310     TRACE("iface %p, index %u\n", iface, index);
2311
2312     if (index >= This->annotation_count)
2313     {
2314         WARN("Invalid index specified\n");
2315         return (ID3D10EffectVariable *)&null_variable;
2316     }
2317
2318     a = &This->annotations[index];
2319
2320     TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
2321
2322     return (ID3D10EffectVariable *)a;
2323 }
2324
2325 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByName(
2326         ID3D10EffectTechnique *iface, LPCSTR name)
2327 {
2328     struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
2329     unsigned int i;
2330
2331     TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2332
2333     for (i = 0; i < This->annotation_count; ++i)
2334     {
2335         struct d3d10_effect_variable *a = &This->annotations[i];
2336         if (!strcmp(a->name, name))
2337         {
2338             TRACE("Returning annotation %p\n", a);
2339             return (ID3D10EffectVariable *)a;
2340         }
2341     }
2342
2343     WARN("Invalid name specified\n");
2344
2345     return (ID3D10EffectVariable *)&null_variable;
2346 }
2347
2348 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique *iface,
2349         UINT index)
2350 {
2351     struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
2352     struct d3d10_effect_pass *p;
2353
2354     TRACE("iface %p, index %u\n", iface, index);
2355
2356     if (index >= This->pass_count)
2357     {
2358         WARN("Invalid index specified\n");
2359         return (ID3D10EffectPass *)&null_pass;
2360     }
2361
2362     p = &This->passes[index];
2363
2364     TRACE("Returning pass %p, %s.\n", p, debugstr_a(p->name));
2365
2366     return (ID3D10EffectPass *)p;
2367 }
2368
2369 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique *iface,
2370         LPCSTR name)
2371 {
2372     struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
2373     unsigned int i;
2374
2375     TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2376
2377     /* Do not check for name==NULL, W7/DX10 crashes in that case. */
2378
2379     for (i = 0; i < This->pass_count; ++i)
2380     {
2381         struct d3d10_effect_pass *p = &This->passes[i];
2382         if (!strcmp(p->name, name))
2383         {
2384             TRACE("Returning pass %p\n", p);
2385             return (ID3D10EffectPass *)p;
2386         }
2387     }
2388
2389     WARN("Invalid name specified\n");
2390
2391     return (ID3D10EffectPass *)&null_pass;
2392 }
2393
2394 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique *iface,
2395         D3D10_STATE_BLOCK_MASK *mask)
2396 {
2397     FIXME("iface %p,mask %p stub!\n", iface, mask);
2398
2399     return E_NOTIMPL;
2400 }
2401
2402 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl =
2403 {
2404     /* ID3D10EffectTechnique methods */
2405     d3d10_effect_technique_IsValid,
2406     d3d10_effect_technique_GetDesc,
2407     d3d10_effect_technique_GetAnnotationByIndex,
2408     d3d10_effect_technique_GetAnnotationByName,
2409     d3d10_effect_technique_GetPassByIndex,
2410     d3d10_effect_technique_GetPassByName,
2411     d3d10_effect_technique_ComputeStateBlockMask,
2412 };
2413
2414 /* ID3D10EffectPass methods */
2415
2416 static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface)
2417 {
2418     TRACE("iface %p\n", iface);
2419
2420     return (struct d3d10_effect_pass *)iface != &null_pass;
2421 }
2422
2423 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface, D3D10_PASS_DESC *desc)
2424 {
2425     struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2426     unsigned int i;
2427
2428     FIXME("iface %p, desc %p partial stub!\n", iface, desc);
2429
2430     if(This == &null_pass)
2431     {
2432         WARN("Null pass specified\n");
2433         return E_FAIL;
2434     }
2435
2436     if(!desc)
2437     {
2438         WARN("Invalid argument specified\n");
2439         return E_INVALIDARG;
2440     }
2441
2442     memset(desc, 0, sizeof(*desc));
2443     desc->Name = This->name;
2444     for (i = 0; i < This->object_count; ++i)
2445     {
2446         struct d3d10_effect_object *o = &This->objects[i];
2447         if (o->type == D3D10_EOT_VERTEXSHADER)
2448         {
2449             struct d3d10_effect_variable *v = o->data;
2450             struct d3d10_effect_shader_variable *s = v->data;
2451             desc->pIAInputSignature = (BYTE *)s->input_signature.signature;
2452             desc->IAInputSignatureSize = s->input_signature.signature_size;
2453             break;
2454         }
2455     }
2456
2457     return S_OK;
2458 }
2459
2460 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface,
2461         D3D10_PASS_SHADER_DESC *desc)
2462 {
2463     struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2464     unsigned int i;
2465
2466     TRACE("iface %p, desc %p\n", iface, desc);
2467
2468     if (This == &null_pass)
2469     {
2470         WARN("Null pass specified\n");
2471         return E_FAIL;
2472     }
2473
2474     if (!desc)
2475     {
2476         WARN("Invalid argument specified\n");
2477         return E_INVALIDARG;
2478     }
2479
2480     for (i = 0; i < This->object_count; ++i)
2481     {
2482         struct d3d10_effect_object *o = &This->objects[i];
2483
2484         if (o->type == D3D10_EOT_VERTEXSHADER)
2485         {
2486             desc->pShaderVariable = o->data;
2487             desc->ShaderIndex = o->index;
2488             return S_OK;
2489         }
2490     }
2491
2492     TRACE("Returning null_shader_variable\n");
2493     desc->pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable;
2494     desc->ShaderIndex = 0;
2495
2496     return S_OK;
2497 }
2498
2499 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface,
2500         D3D10_PASS_SHADER_DESC *desc)
2501 {
2502     struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2503     unsigned int i;
2504
2505     TRACE("iface %p, desc %p\n", iface, desc);
2506
2507     if (This == &null_pass)
2508     {
2509         WARN("Null pass specified\n");
2510         return E_FAIL;
2511     }
2512
2513     if (!desc)
2514     {
2515         WARN("Invalid argument specified\n");
2516         return E_INVALIDARG;
2517     }
2518
2519     for (i = 0; i < This->object_count; ++i)
2520     {
2521         struct d3d10_effect_object *o = &This->objects[i];
2522
2523         if (o->type == D3D10_EOT_GEOMETRYSHADER)
2524         {
2525             desc->pShaderVariable = o->data;
2526             desc->ShaderIndex = o->index;
2527             return S_OK;
2528         }
2529     }
2530
2531     TRACE("Returning null_shader_variable\n");
2532     desc->pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable;
2533     desc->ShaderIndex = 0;
2534
2535     return S_OK;
2536 }
2537
2538 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface,
2539         D3D10_PASS_SHADER_DESC *desc)
2540 {
2541     struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2542     unsigned int i;
2543
2544     TRACE("iface %p, desc %p\n", iface, desc);
2545
2546     if (This == &null_pass)
2547     {
2548         WARN("Null pass specified\n");
2549         return E_FAIL;
2550     }
2551
2552     if (!desc)
2553     {
2554         WARN("Invalid argument specified\n");
2555         return E_INVALIDARG;
2556     }
2557
2558     for (i = 0; i < This->object_count; ++i)
2559     {
2560         struct d3d10_effect_object *o = &This->objects[i];
2561
2562         if (o->type == D3D10_EOT_PIXELSHADER)
2563         {
2564             desc->pShaderVariable = o->data;
2565             desc->ShaderIndex = o->index;
2566             return S_OK;
2567         }
2568     }
2569
2570     TRACE("Returning null_shader_variable\n");
2571     desc->pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable;
2572     desc->ShaderIndex = 0;
2573
2574     return S_OK;
2575 }
2576
2577 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass *iface,
2578         UINT index)
2579 {
2580     struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2581     struct d3d10_effect_variable *a;
2582
2583     TRACE("iface %p, index %u\n", iface, index);
2584
2585     if (index >= This->annotation_count)
2586     {
2587         WARN("Invalid index specified\n");
2588         return (ID3D10EffectVariable *)&null_variable;
2589     }
2590
2591     a = &This->annotations[index];
2592
2593     TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
2594
2595     return (ID3D10EffectVariable *)a;
2596 }
2597
2598 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass *iface,
2599         LPCSTR name)
2600 {
2601     struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2602     unsigned int i;
2603
2604     TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2605
2606     for (i = 0; i < This->annotation_count; ++i)
2607     {
2608         struct d3d10_effect_variable *a = &This->annotations[i];
2609         if (!strcmp(a->name, name))
2610         {
2611             TRACE("Returning annotation %p\n", a);
2612             return (ID3D10EffectVariable *)a;
2613         }
2614     }
2615
2616     WARN("Invalid name specified\n");
2617
2618     return (ID3D10EffectVariable *)&null_variable;
2619 }
2620
2621 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
2622 {
2623     struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2624     HRESULT hr = S_OK;
2625     unsigned int i;
2626
2627     TRACE("iface %p, flags %#x\n", iface, flags);
2628
2629     if (flags) FIXME("Ignoring flags (%#x)\n", flags);
2630
2631     for (i = 0; i < This->object_count; ++i)
2632     {
2633         hr = d3d10_effect_object_apply(&This->objects[i]);
2634         if (FAILED(hr)) break;
2635     }
2636
2637     return hr;
2638 }
2639
2640 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass *iface,
2641         D3D10_STATE_BLOCK_MASK *mask)
2642 {
2643     FIXME("iface %p, mask %p stub!\n", iface, mask);
2644
2645     return E_NOTIMPL;
2646 }
2647
2648 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl =
2649 {
2650     /* ID3D10EffectPass methods */
2651     d3d10_effect_pass_IsValid,
2652     d3d10_effect_pass_GetDesc,
2653     d3d10_effect_pass_GetVertexShaderDesc,
2654     d3d10_effect_pass_GetGeometryShaderDesc,
2655     d3d10_effect_pass_GetPixelShaderDesc,
2656     d3d10_effect_pass_GetAnnotationByIndex,
2657     d3d10_effect_pass_GetAnnotationByName,
2658     d3d10_effect_pass_Apply,
2659     d3d10_effect_pass_ComputeStateBlockMask,
2660 };
2661
2662 /* ID3D10EffectVariable methods */
2663
2664 static BOOL STDMETHODCALLTYPE d3d10_effect_variable_IsValid(ID3D10EffectVariable *iface)
2665 {
2666     TRACE("iface %p\n", iface);
2667
2668     return (struct d3d10_effect_variable *)iface != &null_variable;
2669 }
2670
2671 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_variable_GetType(ID3D10EffectVariable *iface)
2672 {
2673     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2674
2675     TRACE("iface %p\n", iface);
2676
2677     return (ID3D10EffectType *)This->type;
2678 }
2679
2680 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetDesc(ID3D10EffectVariable *iface,
2681         D3D10_EFFECT_VARIABLE_DESC *desc)
2682 {
2683     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2684
2685     TRACE("iface %p, desc %p\n", iface, desc);
2686
2687     if (!iface->lpVtbl->IsValid(iface))
2688     {
2689         WARN("Null variable specified\n");
2690         return E_FAIL;
2691     }
2692
2693     if (!desc)
2694     {
2695         WARN("Invalid argument specified\n");
2696         return E_INVALIDARG;
2697     }
2698
2699     /* FIXME: This isn't correct. Anonymous shaders let desc->ExplicitBindPoint untouched, but normal shaders set it! */
2700     memset(desc, 0, sizeof(*desc));
2701     desc->Name = This->name;
2702     desc->Semantic = This->semantic;
2703     desc->Flags = This->flag;
2704     desc->Annotations = This->annotation_count;
2705     desc->BufferOffset = This->buffer_offset;
2706
2707     if (This->flag & D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT)
2708     {
2709         desc->ExplicitBindPoint = This->buffer_offset;
2710     }
2711
2712     return S_OK;
2713 }
2714
2715 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByIndex(
2716         ID3D10EffectVariable *iface, UINT index)
2717 {
2718     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2719     struct d3d10_effect_variable *a;
2720
2721     TRACE("iface %p, index %u\n", iface, index);
2722
2723     if (index >= This->annotation_count)
2724     {
2725         WARN("Invalid index specified\n");
2726         return (ID3D10EffectVariable *)&null_variable;
2727     }
2728
2729     a = &This->annotations[index];
2730
2731     TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
2732
2733     return (ID3D10EffectVariable *)a;
2734 }
2735
2736 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName(
2737         ID3D10EffectVariable *iface, LPCSTR name)
2738 {
2739     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2740     unsigned int i;
2741
2742     TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2743
2744     for (i = 0; i < This->annotation_count; ++i)
2745     {
2746         struct d3d10_effect_variable *a = &This->annotations[i];
2747         if (!strcmp(a->name, name))
2748         {
2749             TRACE("Returning annotation %p\n", a);
2750             return (ID3D10EffectVariable *)a;
2751         }
2752     }
2753
2754     WARN("Invalid name specified\n");
2755
2756     return (ID3D10EffectVariable *)&null_variable;
2757 }
2758
2759 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex(
2760         ID3D10EffectVariable *iface, UINT index)
2761 {
2762     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2763     struct d3d10_effect_variable *m;
2764
2765     TRACE("iface %p, index %u\n", iface, index);
2766
2767     if (index >= This->type->member_count)
2768     {
2769         WARN("Invalid index specified\n");
2770         return (ID3D10EffectVariable *)&null_variable;
2771     }
2772
2773     m = &This->members[index];
2774
2775     TRACE("Returning member %p, %s\n", m, debugstr_a(m->name));
2776
2777     return (ID3D10EffectVariable *)m;
2778 }
2779
2780 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName(
2781         ID3D10EffectVariable *iface, LPCSTR name)
2782 {
2783     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2784     unsigned int i;
2785
2786     TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2787
2788     if (!name)
2789     {
2790         WARN("Invalid name specified\n");
2791         return (ID3D10EffectVariable *)&null_variable;
2792     }
2793
2794     for (i = 0; i < This->type->member_count; ++i)
2795     {
2796         struct d3d10_effect_variable *m = &This->members[i];
2797
2798         if (m->name)
2799         {
2800             if (!strcmp(m->name, name))
2801             {
2802                 TRACE("Returning member %p\n", m);
2803                 return (ID3D10EffectVariable *)m;
2804             }
2805         }
2806     }
2807
2808     WARN("Invalid name specified\n");
2809
2810     return (ID3D10EffectVariable *)&null_variable;
2811 }
2812
2813 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic(
2814         ID3D10EffectVariable *iface, LPCSTR semantic)
2815 {
2816     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2817     unsigned int i;
2818
2819     TRACE("iface %p, semantic %s.\n", iface, debugstr_a(semantic));
2820
2821     if (!semantic)
2822     {
2823         WARN("Invalid semantic specified\n");
2824         return (ID3D10EffectVariable *)&null_variable;
2825     }
2826
2827     for (i = 0; i < This->type->member_count; ++i)
2828     {
2829         struct d3d10_effect_variable *m = &This->members[i];
2830
2831         if (m->semantic)
2832         {
2833             if (!strcmp(m->semantic, semantic))
2834             {
2835                 TRACE("Returning member %p\n", m);
2836                 return (ID3D10EffectVariable *)m;
2837             }
2838         }
2839     }
2840
2841     WARN("Invalid semantic specified\n");
2842
2843     return (ID3D10EffectVariable *)&null_variable;
2844 }
2845
2846 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetElement(
2847         ID3D10EffectVariable *iface, UINT index)
2848 {
2849     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2850     struct d3d10_effect_variable *v;
2851
2852     TRACE("iface %p, index %u\n", iface, index);
2853
2854     if (index >= This->type->element_count)
2855     {
2856         WARN("Invalid index specified\n");
2857         return (ID3D10EffectVariable *)&null_variable;
2858     }
2859
2860     v = &This->elements[index];
2861
2862     TRACE("Returning element %p, %s\n", v, debugstr_a(v->name));
2863
2864     return (ID3D10EffectVariable *)v;
2865 }
2866
2867 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_GetParentConstantBuffer(
2868         ID3D10EffectVariable *iface)
2869 {
2870     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2871
2872     TRACE("iface %p\n", iface);
2873
2874     return (ID3D10EffectConstantBuffer *)This->buffer;
2875 }
2876
2877 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsScalar(
2878         ID3D10EffectVariable *iface)
2879 {
2880     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2881
2882     TRACE("iface %p\n", iface);
2883
2884     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl)
2885         return (ID3D10EffectScalarVariable *)This;
2886
2887     return (ID3D10EffectScalarVariable *)&null_scalar_variable;
2888 }
2889
2890 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsVector(
2891         ID3D10EffectVariable *iface)
2892 {
2893     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2894
2895     TRACE("iface %p\n", iface);
2896
2897     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl)
2898         return (ID3D10EffectVectorVariable *)This;
2899
2900     return (ID3D10EffectVectorVariable *)&null_vector_variable;
2901 }
2902
2903 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix(
2904         ID3D10EffectVariable *iface)
2905 {
2906     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2907
2908     TRACE("iface %p\n", iface);
2909
2910     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl)
2911         return (ID3D10EffectMatrixVariable *)This;
2912
2913     return (ID3D10EffectMatrixVariable *)&null_matrix_variable;
2914 }
2915
2916 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsString(
2917         ID3D10EffectVariable *iface)
2918 {
2919     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2920
2921     TRACE("iface %p\n", iface);
2922
2923     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl)
2924         return (ID3D10EffectStringVariable *)This;
2925
2926     return (ID3D10EffectStringVariable *)&null_string_variable;
2927 }
2928
2929 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShaderResource(
2930         ID3D10EffectVariable *iface)
2931 {
2932     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2933
2934     TRACE("iface %p\n", iface);
2935
2936     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl)
2937         return (ID3D10EffectShaderResourceVariable *)This;
2938
2939     return (ID3D10EffectShaderResourceVariable *)&null_shader_resource_variable;
2940 }
2941
2942 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRenderTargetView(
2943         ID3D10EffectVariable *iface)
2944 {
2945     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2946
2947     TRACE("iface %p\n", iface);
2948
2949     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl)
2950         return (ID3D10EffectRenderTargetViewVariable *)This;
2951
2952     return (ID3D10EffectRenderTargetViewVariable *)&null_render_target_view_variable;
2953 }
2954
2955 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencilView(
2956         ID3D10EffectVariable *iface)
2957 {
2958     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2959
2960     TRACE("iface %p\n", iface);
2961
2962     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl)
2963         return (ID3D10EffectDepthStencilViewVariable *)This;
2964
2965     return (ID3D10EffectDepthStencilViewVariable *)&null_depth_stencil_view_variable;
2966 }
2967
2968 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_AsConstantBuffer(
2969         ID3D10EffectVariable *iface)
2970 {
2971     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2972
2973     TRACE("iface %p\n", iface);
2974
2975     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl)
2976         return (ID3D10EffectConstantBuffer *)This;
2977
2978     return (ID3D10EffectConstantBuffer *)&null_local_buffer;
2979 }
2980
2981 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShader(
2982         ID3D10EffectVariable *iface)
2983 {
2984     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2985
2986     TRACE("iface %p\n", iface);
2987
2988     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl)
2989         return (ID3D10EffectShaderVariable *)This;
2990
2991     return (ID3D10EffectShaderVariable *)&null_shader_variable;
2992 }
2993
2994 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsBlend(ID3D10EffectVariable *iface)
2995 {
2996     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2997
2998     TRACE("iface %p\n", iface);
2999
3000     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl)
3001         return (ID3D10EffectBlendVariable *)This;
3002
3003     return (ID3D10EffectBlendVariable *)&null_blend_variable;
3004 }
3005
3006 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencil(
3007         ID3D10EffectVariable *iface)
3008 {
3009     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
3010
3011     TRACE("iface %p\n", iface);
3012
3013     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl)
3014         return (ID3D10EffectDepthStencilVariable *)This;
3015
3016     return (ID3D10EffectDepthStencilVariable *)&null_depth_stencil_variable;
3017 }
3018
3019 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRasterizer(
3020         ID3D10EffectVariable *iface)
3021 {
3022     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
3023
3024     TRACE("iface %p\n", iface);
3025
3026     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl)
3027         return (ID3D10EffectRasterizerVariable *)This;
3028
3029     return (ID3D10EffectRasterizerVariable *)&null_rasterizer_variable;
3030 }
3031
3032 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsSampler(
3033         ID3D10EffectVariable *iface)
3034 {
3035     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
3036
3037     TRACE("iface %p\n", iface);
3038
3039     if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl)
3040         return (ID3D10EffectSamplerVariable *)This;
3041
3042     return (ID3D10EffectSamplerVariable *)&null_sampler_variable;
3043 }
3044
3045 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface,
3046         void *data, UINT offset, UINT count)
3047 {
3048     FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3049
3050     return E_NOTIMPL;
3051 }
3052
3053 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface,
3054         void *data, UINT offset, UINT count)
3055 {
3056     FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3057
3058     return E_NOTIMPL;
3059 }
3060
3061 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl =
3062 {
3063     /* ID3D10EffectVariable methods */
3064     d3d10_effect_variable_IsValid,
3065     d3d10_effect_variable_GetType,
3066     d3d10_effect_variable_GetDesc,
3067     d3d10_effect_variable_GetAnnotationByIndex,
3068     d3d10_effect_variable_GetAnnotationByName,
3069     d3d10_effect_variable_GetMemberByIndex,
3070     d3d10_effect_variable_GetMemberByName,
3071     d3d10_effect_variable_GetMemberBySemantic,
3072     d3d10_effect_variable_GetElement,
3073     d3d10_effect_variable_GetParentConstantBuffer,
3074     d3d10_effect_variable_AsScalar,
3075     d3d10_effect_variable_AsVector,
3076     d3d10_effect_variable_AsMatrix,
3077     d3d10_effect_variable_AsString,
3078     d3d10_effect_variable_AsShaderResource,
3079     d3d10_effect_variable_AsRenderTargetView,
3080     d3d10_effect_variable_AsDepthStencilView,
3081     d3d10_effect_variable_AsConstantBuffer,
3082     d3d10_effect_variable_AsShader,
3083     d3d10_effect_variable_AsBlend,
3084     d3d10_effect_variable_AsDepthStencil,
3085     d3d10_effect_variable_AsRasterizer,
3086     d3d10_effect_variable_AsSampler,
3087     d3d10_effect_variable_SetRawValue,
3088     d3d10_effect_variable_GetRawValue,
3089 };
3090
3091 /* ID3D10EffectVariable methods */
3092 static BOOL STDMETHODCALLTYPE d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer *iface)
3093 {
3094     TRACE("iface %p\n", iface);
3095
3096     return (struct d3d10_effect_variable *)iface != &null_local_buffer;
3097 }
3098
3099 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer *iface)
3100 {
3101     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3102 }
3103
3104 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer *iface,
3105         D3D10_EFFECT_VARIABLE_DESC *desc)
3106 {
3107     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3108 }
3109
3110 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByIndex(
3111         ID3D10EffectConstantBuffer *iface, UINT index)
3112 {
3113     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3114 }
3115
3116 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByName(
3117         ID3D10EffectConstantBuffer *iface, LPCSTR name)
3118 {
3119     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3120 }
3121
3122 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByIndex(
3123         ID3D10EffectConstantBuffer *iface, UINT index)
3124 {
3125     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3126 }
3127
3128 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByName(
3129         ID3D10EffectConstantBuffer *iface, LPCSTR name)
3130 {
3131     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3132 }
3133
3134 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberBySemantic(
3135         ID3D10EffectConstantBuffer *iface, LPCSTR semantic)
3136 {
3137     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3138 }
3139
3140 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetElement(
3141         ID3D10EffectConstantBuffer *iface, UINT index)
3142 {
3143     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3144 }
3145
3146 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetParentConstantBuffer(
3147         ID3D10EffectConstantBuffer *iface)
3148 {
3149     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3150 }
3151
3152 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsScalar(
3153         ID3D10EffectConstantBuffer *iface)
3154 {
3155     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3156 }
3157
3158 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsVector(
3159         ID3D10EffectConstantBuffer *iface)
3160 {
3161     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3162 }
3163
3164 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsMatrix(
3165         ID3D10EffectConstantBuffer *iface)
3166 {
3167     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3168 }
3169
3170 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsString(
3171         ID3D10EffectConstantBuffer *iface)
3172 {
3173     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3174 }
3175
3176 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShaderResource(
3177         ID3D10EffectConstantBuffer *iface)
3178 {
3179     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3180 }
3181
3182 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRenderTargetView(
3183         ID3D10EffectConstantBuffer *iface)
3184 {
3185     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3186 }
3187
3188 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencilView(
3189         ID3D10EffectConstantBuffer *iface)
3190 {
3191     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3192 }
3193
3194 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsConstantBuffer(
3195         ID3D10EffectConstantBuffer *iface)
3196 {
3197     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3198 }
3199
3200 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShader(
3201         ID3D10EffectConstantBuffer *iface)
3202 {
3203     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3204 }
3205
3206 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer *iface)
3207 {
3208     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3209 }
3210
3211 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencil(
3212         ID3D10EffectConstantBuffer *iface)
3213 {
3214     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3215 }
3216
3217 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRasterizer(
3218         ID3D10EffectConstantBuffer *iface)
3219 {
3220     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3221 }
3222
3223 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsSampler(
3224         ID3D10EffectConstantBuffer *iface)
3225 {
3226     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3227 }
3228
3229 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer *iface,
3230         void *data, UINT offset, UINT count)
3231 {
3232     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3233 }
3234
3235 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer *iface,
3236         void *data, UINT offset, UINT count)
3237 {
3238     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3239 }
3240
3241 /* ID3D10EffectConstantBuffer methods */
3242 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer *iface,
3243         ID3D10Buffer *buffer)
3244 {
3245     FIXME("iface %p, buffer %p stub!\n", iface, buffer);
3246
3247     return E_NOTIMPL;
3248 }
3249
3250 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer *iface,
3251         ID3D10Buffer **buffer)
3252 {
3253     FIXME("iface %p, buffer %p stub!\n", iface, buffer);
3254
3255     return E_NOTIMPL;
3256 }
3257
3258 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer *iface,
3259         ID3D10ShaderResourceView *view)
3260 {
3261     FIXME("iface %p, view %p stub!\n", iface, view);
3262
3263     return E_NOTIMPL;
3264 }
3265
3266 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer *iface,
3267         ID3D10ShaderResourceView **view)
3268 {
3269     FIXME("iface %p, view %p stub!\n", iface, view);
3270
3271     return E_NOTIMPL;
3272 }
3273
3274 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl =
3275 {
3276     /* ID3D10EffectVariable methods */
3277     d3d10_effect_constant_buffer_IsValid,
3278     d3d10_effect_constant_buffer_GetType,
3279     d3d10_effect_constant_buffer_GetDesc,
3280     d3d10_effect_constant_buffer_GetAnnotationByIndex,
3281     d3d10_effect_constant_buffer_GetAnnotationByName,
3282     d3d10_effect_constant_buffer_GetMemberByIndex,
3283     d3d10_effect_constant_buffer_GetMemberByName,
3284     d3d10_effect_constant_buffer_GetMemberBySemantic,
3285     d3d10_effect_constant_buffer_GetElement,
3286     d3d10_effect_constant_buffer_GetParentConstantBuffer,
3287     d3d10_effect_constant_buffer_AsScalar,
3288     d3d10_effect_constant_buffer_AsVector,
3289     d3d10_effect_constant_buffer_AsMatrix,
3290     d3d10_effect_constant_buffer_AsString,
3291     d3d10_effect_constant_buffer_AsShaderResource,
3292     d3d10_effect_constant_buffer_AsRenderTargetView,
3293     d3d10_effect_constant_buffer_AsDepthStencilView,
3294     d3d10_effect_constant_buffer_AsConstantBuffer,
3295     d3d10_effect_constant_buffer_AsShader,
3296     d3d10_effect_constant_buffer_AsBlend,
3297     d3d10_effect_constant_buffer_AsDepthStencil,
3298     d3d10_effect_constant_buffer_AsRasterizer,
3299     d3d10_effect_constant_buffer_AsSampler,
3300     d3d10_effect_constant_buffer_SetRawValue,
3301     d3d10_effect_constant_buffer_GetRawValue,
3302     /* ID3D10EffectConstantBuffer methods */
3303     d3d10_effect_constant_buffer_SetConstantBuffer,
3304     d3d10_effect_constant_buffer_GetConstantBuffer,
3305     d3d10_effect_constant_buffer_SetTextureBuffer,
3306     d3d10_effect_constant_buffer_GetTextureBuffer,
3307 };
3308
3309 /* ID3D10EffectVariable methods */
3310
3311 static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
3312 {
3313     TRACE("iface %p\n", iface);
3314
3315     return (struct d3d10_effect_variable *)iface != &null_scalar_variable;
3316 }
3317
3318 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetType(
3319         ID3D10EffectScalarVariable *iface)
3320 {
3321     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3322 }
3323
3324 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetDesc(ID3D10EffectScalarVariable *iface,
3325         D3D10_EFFECT_VARIABLE_DESC *desc)
3326 {
3327     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3328 }
3329
3330 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByIndex(
3331         ID3D10EffectScalarVariable *iface, UINT index)
3332 {
3333     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3334 }
3335
3336 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByName(
3337         ID3D10EffectScalarVariable *iface, LPCSTR name)
3338 {
3339     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3340 }
3341
3342 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByIndex(
3343         ID3D10EffectScalarVariable *iface, UINT index)
3344 {
3345     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3346 }
3347
3348 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByName(
3349         ID3D10EffectScalarVariable *iface, LPCSTR name)
3350 {
3351     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3352 }
3353
3354 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberBySemantic(
3355         ID3D10EffectScalarVariable *iface, LPCSTR semantic)
3356 {
3357     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3358 }
3359
3360 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetElement(
3361         ID3D10EffectScalarVariable *iface, UINT index)
3362 {
3363     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3364 }
3365
3366 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetParentConstantBuffer(
3367         ID3D10EffectScalarVariable *iface)
3368 {
3369     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3370 }
3371
3372 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsScalar(
3373         ID3D10EffectScalarVariable *iface)
3374 {
3375     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3376 }
3377
3378 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsVector(
3379         ID3D10EffectScalarVariable *iface)
3380 {
3381     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3382 }
3383
3384 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsMatrix(
3385         ID3D10EffectScalarVariable *iface)
3386 {
3387     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3388 }
3389
3390 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsString(
3391         ID3D10EffectScalarVariable *iface)
3392 {
3393     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3394 }
3395
3396 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShaderResource(
3397         ID3D10EffectScalarVariable *iface)
3398 {
3399     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3400 }
3401
3402 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRenderTargetView(
3403         ID3D10EffectScalarVariable *iface)
3404 {
3405     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3406 }
3407
3408 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencilView(
3409         ID3D10EffectScalarVariable *iface)
3410 {
3411     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3412 }
3413
3414 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsConstantBuffer(
3415         ID3D10EffectScalarVariable *iface)
3416 {
3417     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3418 }
3419
3420 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShader(
3421         ID3D10EffectScalarVariable *iface)
3422 {
3423     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3424 }
3425
3426 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsBlend(
3427         ID3D10EffectScalarVariable *iface)
3428 {
3429     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3430 }
3431
3432 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencil(
3433         ID3D10EffectScalarVariable *iface)
3434 {
3435     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3436 }
3437
3438 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRasterizer(
3439         ID3D10EffectScalarVariable *iface)
3440 {
3441     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3442 }
3443
3444 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsSampler(
3445         ID3D10EffectScalarVariable *iface)
3446 {
3447     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3448 }
3449
3450 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetRawValue(ID3D10EffectScalarVariable *iface,
3451         void *data, UINT offset, UINT count)
3452 {
3453     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3454 }
3455
3456 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetRawValue(ID3D10EffectScalarVariable *iface,
3457         void *data, UINT offset, UINT count)
3458 {
3459     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3460 }
3461
3462 /* ID3D10EffectScalarVariable methods */
3463
3464 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable *iface,
3465         float value)
3466 {
3467     FIXME("iface %p, value %.8e stub!\n", iface, value);
3468
3469     return E_NOTIMPL;
3470 }
3471
3472 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable *iface,
3473         float *value)
3474 {
3475     FIXME("iface %p, value %p stub!\n", iface, value);
3476
3477     return E_NOTIMPL;
3478 }
3479
3480 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable *iface,
3481         float *values, UINT offset, UINT count)
3482 {
3483     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3484
3485     return E_NOTIMPL;
3486 }
3487
3488 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable *iface,
3489         float *values, UINT offset, UINT count)
3490 {
3491     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3492
3493     return E_NOTIMPL;
3494 }
3495
3496 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable *iface,
3497         int value)
3498 {
3499     FIXME("iface %p, value %d stub!\n", iface, value);
3500
3501     return E_NOTIMPL;
3502 }
3503
3504 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable *iface,
3505         int *value)
3506 {
3507     FIXME("iface %p, value %p stub!\n", iface, value);
3508
3509     return E_NOTIMPL;
3510 }
3511
3512 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable *iface,
3513         int *values, UINT offset, UINT count)
3514 {
3515     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3516
3517     return E_NOTIMPL;
3518 }
3519
3520 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable *iface,
3521         int *values, UINT offset, UINT count)
3522 {
3523     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3524
3525     return E_NOTIMPL;
3526 }
3527
3528 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable *iface,
3529         BOOL value)
3530 {
3531     FIXME("iface %p, value %d stub!\n", iface, value);
3532
3533     return E_NOTIMPL;
3534 }
3535
3536 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable *iface,
3537         BOOL *value)
3538 {
3539     FIXME("iface %p, value %p stub!\n", iface, value);
3540
3541     return E_NOTIMPL;
3542 }
3543
3544 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable *iface,
3545         BOOL *values, UINT offset, UINT count)
3546 {
3547     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3548
3549     return E_NOTIMPL;
3550 }
3551
3552 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable *iface,
3553         BOOL *values, UINT offset, UINT count)
3554 {
3555     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3556
3557     return E_NOTIMPL;
3558 }
3559
3560 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl =
3561 {
3562     /* ID3D10EffectVariable methods */
3563     d3d10_effect_scalar_variable_IsValid,
3564     d3d10_effect_scalar_variable_GetType,
3565     d3d10_effect_scalar_variable_GetDesc,
3566     d3d10_effect_scalar_variable_GetAnnotationByIndex,
3567     d3d10_effect_scalar_variable_GetAnnotationByName,
3568     d3d10_effect_scalar_variable_GetMemberByIndex,
3569     d3d10_effect_scalar_variable_GetMemberByName,
3570     d3d10_effect_scalar_variable_GetMemberBySemantic,
3571     d3d10_effect_scalar_variable_GetElement,
3572     d3d10_effect_scalar_variable_GetParentConstantBuffer,
3573     d3d10_effect_scalar_variable_AsScalar,
3574     d3d10_effect_scalar_variable_AsVector,
3575     d3d10_effect_scalar_variable_AsMatrix,
3576     d3d10_effect_scalar_variable_AsString,
3577     d3d10_effect_scalar_variable_AsShaderResource,
3578     d3d10_effect_scalar_variable_AsRenderTargetView,
3579     d3d10_effect_scalar_variable_AsDepthStencilView,
3580     d3d10_effect_scalar_variable_AsConstantBuffer,
3581     d3d10_effect_scalar_variable_AsShader,
3582     d3d10_effect_scalar_variable_AsBlend,
3583     d3d10_effect_scalar_variable_AsDepthStencil,
3584     d3d10_effect_scalar_variable_AsRasterizer,
3585     d3d10_effect_scalar_variable_AsSampler,
3586     d3d10_effect_scalar_variable_SetRawValue,
3587     d3d10_effect_scalar_variable_GetRawValue,
3588     /* ID3D10EffectScalarVariable methods */
3589     d3d10_effect_scalar_variable_SetFloat,
3590     d3d10_effect_scalar_variable_GetFloat,
3591     d3d10_effect_scalar_variable_SetFloatArray,
3592     d3d10_effect_scalar_variable_GetFloatArray,
3593     d3d10_effect_scalar_variable_SetInt,
3594     d3d10_effect_scalar_variable_GetInt,
3595     d3d10_effect_scalar_variable_SetIntArray,
3596     d3d10_effect_scalar_variable_GetIntArray,
3597     d3d10_effect_scalar_variable_SetBool,
3598     d3d10_effect_scalar_variable_GetBool,
3599     d3d10_effect_scalar_variable_SetBoolArray,
3600     d3d10_effect_scalar_variable_GetBoolArray,
3601 };
3602
3603 /* ID3D10EffectVariable methods */
3604
3605 static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
3606 {
3607     TRACE("iface %p\n", iface);
3608
3609     return (struct d3d10_effect_variable *)iface != &null_vector_variable;
3610 }
3611
3612 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetType(
3613         ID3D10EffectVectorVariable *iface)
3614 {
3615     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3616 }
3617
3618 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable *iface,
3619         D3D10_EFFECT_VARIABLE_DESC *desc)
3620 {
3621     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3622 }
3623
3624 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByIndex(
3625         ID3D10EffectVectorVariable *iface, UINT index)
3626 {
3627     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3628 }
3629
3630 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByName(
3631         ID3D10EffectVectorVariable *iface, LPCSTR name)
3632 {
3633     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3634 }
3635
3636 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByIndex(
3637         ID3D10EffectVectorVariable *iface, UINT index)
3638 {
3639     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3640 }
3641
3642 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByName(
3643         ID3D10EffectVectorVariable *iface, LPCSTR name)
3644 {
3645     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3646 }
3647
3648 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberBySemantic(
3649         ID3D10EffectVectorVariable *iface, LPCSTR semantic)
3650 {
3651     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3652 }
3653
3654 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetElement(
3655         ID3D10EffectVectorVariable *iface, UINT index)
3656 {
3657     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3658 }
3659
3660 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetParentConstantBuffer(
3661         ID3D10EffectVectorVariable *iface)
3662 {
3663     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3664 }
3665
3666 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsScalar(
3667         ID3D10EffectVectorVariable *iface)
3668 {
3669     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3670 }
3671
3672 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsVector(
3673         ID3D10EffectVectorVariable *iface)
3674 {
3675     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3676 }
3677
3678 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsMatrix(
3679         ID3D10EffectVectorVariable *iface)
3680 {
3681     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3682 }
3683
3684 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsString(
3685         ID3D10EffectVectorVariable *iface)
3686 {
3687     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3688 }
3689
3690 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShaderResource(
3691         ID3D10EffectVectorVariable *iface)
3692 {
3693     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3694 }
3695
3696 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRenderTargetView(
3697         ID3D10EffectVectorVariable *iface)
3698 {
3699     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3700 }
3701
3702 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencilView(
3703         ID3D10EffectVectorVariable *iface)
3704 {
3705     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3706 }
3707
3708 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsConstantBuffer(
3709         ID3D10EffectVectorVariable *iface)
3710 {
3711     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3712 }
3713
3714 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShader(
3715         ID3D10EffectVectorVariable *iface)
3716 {
3717     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3718 }
3719
3720 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsBlend(
3721         ID3D10EffectVectorVariable *iface)
3722 {
3723     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3724 }
3725
3726 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencil(
3727         ID3D10EffectVectorVariable *iface)
3728 {
3729     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3730 }
3731
3732 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRasterizer(
3733         ID3D10EffectVectorVariable *iface)
3734 {
3735     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3736 }
3737
3738 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsSampler(
3739         ID3D10EffectVectorVariable *iface)
3740 {
3741     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3742 }
3743
3744 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable *iface,
3745         void *data, UINT offset, UINT count)
3746 {
3747     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3748 }
3749
3750 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable *iface,
3751         void *data, UINT offset, UINT count)
3752 {
3753     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3754 }
3755
3756 /* ID3D10EffectVectorVariable methods */
3757
3758 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable *iface,
3759         BOOL *value)
3760 {
3761     FIXME("iface %p, value %p stub!\n", iface, value);
3762
3763     return E_NOTIMPL;
3764 }
3765
3766 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable *iface,
3767         int *value)
3768 {
3769     FIXME("iface %p, value %p stub!\n", iface, value);
3770
3771     return E_NOTIMPL;
3772 }
3773
3774 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable *iface,
3775         float *value)
3776 {
3777     FIXME("iface %p, value %p stub!\n", iface, value);
3778
3779     return E_NOTIMPL;
3780 }
3781
3782 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable *iface,
3783         BOOL *value)
3784 {
3785     FIXME("iface %p, value %p stub!\n", iface, value);
3786
3787     return E_NOTIMPL;
3788 }
3789
3790 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable *iface,
3791         int *value)
3792 {
3793     FIXME("iface %p, value %p stub!\n", iface, value);
3794
3795     return E_NOTIMPL;
3796 }
3797
3798 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable *iface,
3799         float *value)
3800 {
3801     FIXME("iface %p, value %p stub!\n", iface, value);
3802
3803     return E_NOTIMPL;
3804 }
3805
3806 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable *iface,
3807         BOOL *values, UINT offset, UINT count)
3808 {
3809     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3810
3811     return E_NOTIMPL;
3812 }
3813
3814 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable *iface,
3815         int *values, UINT offset, UINT count)
3816 {
3817     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3818
3819     return E_NOTIMPL;
3820 }
3821
3822 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable *iface,
3823         float *values, UINT offset, UINT count)
3824 {
3825     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3826
3827     return E_NOTIMPL;
3828 }
3829
3830 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable *iface,
3831         BOOL *values, UINT offset, UINT count)
3832 {
3833     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3834
3835     return E_NOTIMPL;
3836 }
3837
3838 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable *iface,
3839         int *values, UINT offset, UINT count)
3840 {
3841     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3842
3843     return E_NOTIMPL;
3844 }
3845
3846 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable *iface,
3847         float *values, UINT offset, UINT count)
3848 {
3849     FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3850
3851     return E_NOTIMPL;
3852 }
3853
3854 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl =
3855 {
3856     /* ID3D10EffectVariable methods */
3857     d3d10_effect_vector_variable_IsValid,
3858     d3d10_effect_vector_variable_GetType,
3859     d3d10_effect_vector_variable_GetDesc,
3860     d3d10_effect_vector_variable_GetAnnotationByIndex,
3861     d3d10_effect_vector_variable_GetAnnotationByName,
3862     d3d10_effect_vector_variable_GetMemberByIndex,
3863     d3d10_effect_vector_variable_GetMemberByName,
3864     d3d10_effect_vector_variable_GetMemberBySemantic,
3865     d3d10_effect_vector_variable_GetElement,
3866     d3d10_effect_vector_variable_GetParentConstantBuffer,
3867     d3d10_effect_vector_variable_AsScalar,
3868     d3d10_effect_vector_variable_AsVector,
3869     d3d10_effect_vector_variable_AsMatrix,
3870     d3d10_effect_vector_variable_AsString,
3871     d3d10_effect_vector_variable_AsShaderResource,
3872     d3d10_effect_vector_variable_AsRenderTargetView,
3873     d3d10_effect_vector_variable_AsDepthStencilView,
3874     d3d10_effect_vector_variable_AsConstantBuffer,
3875     d3d10_effect_vector_variable_AsShader,
3876     d3d10_effect_vector_variable_AsBlend,
3877     d3d10_effect_vector_variable_AsDepthStencil,
3878     d3d10_effect_vector_variable_AsRasterizer,
3879     d3d10_effect_vector_variable_AsSampler,
3880     d3d10_effect_vector_variable_SetRawValue,
3881     d3d10_effect_vector_variable_GetRawValue,
3882     /* ID3D10EffectVectorVariable methods */
3883     d3d10_effect_vector_variable_SetBoolVector,
3884     d3d10_effect_vector_variable_SetIntVector,
3885     d3d10_effect_vector_variable_SetFloatVector,
3886     d3d10_effect_vector_variable_GetBoolVector,
3887     d3d10_effect_vector_variable_GetIntVector,
3888     d3d10_effect_vector_variable_GetFloatVector,
3889     d3d10_effect_vector_variable_SetBoolVectorArray,
3890     d3d10_effect_vector_variable_SetIntVectorArray,
3891     d3d10_effect_vector_variable_SetFloatVectorArray,
3892     d3d10_effect_vector_variable_GetBoolVectorArray,
3893     d3d10_effect_vector_variable_GetIntVectorArray,
3894     d3d10_effect_vector_variable_GetFloatVectorArray,
3895 };
3896
3897 /* ID3D10EffectVariable methods */
3898
3899 static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
3900 {
3901     TRACE("iface %p\n", iface);
3902
3903     return (struct d3d10_effect_variable *)iface != &null_matrix_variable;
3904 }
3905
3906 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetType(
3907         ID3D10EffectMatrixVariable *iface)
3908 {
3909     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3910 }
3911
3912 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetDesc(ID3D10EffectMatrixVariable *iface,
3913         D3D10_EFFECT_VARIABLE_DESC *desc)
3914 {
3915     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3916 }
3917
3918 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByIndex(
3919         ID3D10EffectMatrixVariable *iface, UINT index)
3920 {
3921     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3922 }
3923
3924 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByName(
3925         ID3D10EffectMatrixVariable *iface, LPCSTR name)
3926 {
3927     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3928 }
3929
3930 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByIndex(
3931         ID3D10EffectMatrixVariable *iface, UINT index)
3932 {
3933     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3934 }
3935
3936 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByName(
3937         ID3D10EffectMatrixVariable *iface, LPCSTR name)
3938 {
3939     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3940 }
3941
3942 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberBySemantic(
3943         ID3D10EffectMatrixVariable *iface, LPCSTR semantic)
3944 {
3945     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3946 }
3947
3948 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetElement(
3949         ID3D10EffectMatrixVariable *iface, UINT index)
3950 {
3951     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3952 }
3953
3954 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetParentConstantBuffer(
3955         ID3D10EffectMatrixVariable *iface)
3956 {
3957     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3958 }
3959
3960 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsScalar(
3961         ID3D10EffectMatrixVariable *iface)
3962 {
3963     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3964 }
3965
3966 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsVector(
3967         ID3D10EffectMatrixVariable *iface)
3968 {
3969     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3970 }
3971
3972 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsMatrix(
3973         ID3D10EffectMatrixVariable *iface)
3974 {
3975     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3976 }
3977
3978 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsString(
3979         ID3D10EffectMatrixVariable *iface)
3980 {
3981     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3982 }
3983
3984 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShaderResource(
3985         ID3D10EffectMatrixVariable *iface)
3986 {
3987     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3988 }
3989
3990 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRenderTargetView(
3991         ID3D10EffectMatrixVariable *iface)
3992 {
3993     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3994 }
3995
3996 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencilView(
3997         ID3D10EffectMatrixVariable *iface)
3998 {
3999     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4000 }
4001
4002 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsConstantBuffer(
4003         ID3D10EffectMatrixVariable *iface)
4004 {
4005     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4006 }
4007
4008 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShader(
4009         ID3D10EffectMatrixVariable *iface)
4010 {
4011     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4012 }
4013
4014 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsBlend(
4015         ID3D10EffectMatrixVariable *iface)
4016 {
4017     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4018 }
4019
4020 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencil(
4021         ID3D10EffectMatrixVariable *iface)
4022 {
4023     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4024 }
4025
4026 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRasterizer(
4027         ID3D10EffectMatrixVariable *iface)
4028 {
4029     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4030 }
4031
4032 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsSampler(
4033         ID3D10EffectMatrixVariable *iface)
4034 {
4035     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4036 }
4037
4038 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetRawValue(ID3D10EffectMatrixVariable *iface,
4039         void *data, UINT offset, UINT count)
4040 {
4041     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4042 }
4043
4044 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetRawValue(ID3D10EffectMatrixVariable *iface,
4045         void *data, UINT offset, UINT count)
4046 {
4047     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4048 }
4049
4050 /* ID3D10EffectMatrixVariable methods */
4051
4052 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrix(ID3D10EffectMatrixVariable *iface,
4053         float *data)
4054 {
4055     FIXME("iface %p, data %p stub!\n", iface, data);
4056
4057     return E_NOTIMPL;
4058 }
4059
4060 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrix(ID3D10EffectMatrixVariable *iface,
4061         float *data)
4062 {
4063     FIXME("iface %p, data %p stub!\n", iface, data);
4064
4065     return E_NOTIMPL;
4066 }
4067
4068 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixArray(ID3D10EffectMatrixVariable *iface,
4069         float *data, UINT offset, UINT count)
4070 {
4071     FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4072
4073     return E_NOTIMPL;
4074 }
4075
4076 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixArray(ID3D10EffectMatrixVariable *iface,
4077         float *data, UINT offset, UINT count)
4078 {
4079     FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4080
4081     return E_NOTIMPL;
4082 }
4083
4084 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
4085         float *data)
4086 {
4087     FIXME("iface %p, data %p stub!\n", iface, data);
4088
4089     return E_NOTIMPL;
4090 }
4091
4092 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
4093         float *data)
4094 {
4095     FIXME("iface %p, data %p stub!\n", iface, data);
4096
4097     return E_NOTIMPL;
4098 }
4099
4100 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
4101         float *data, UINT offset, UINT count)
4102 {
4103     FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4104
4105     return E_NOTIMPL;
4106 }
4107
4108 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
4109         float *data, UINT offset, UINT count)
4110 {
4111     FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4112
4113     return E_NOTIMPL;
4114 }
4115
4116
4117 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl =
4118 {
4119     /* ID3D10EffectVariable methods */
4120     d3d10_effect_matrix_variable_IsValid,
4121     d3d10_effect_matrix_variable_GetType,
4122     d3d10_effect_matrix_variable_GetDesc,
4123     d3d10_effect_matrix_variable_GetAnnotationByIndex,
4124     d3d10_effect_matrix_variable_GetAnnotationByName,
4125     d3d10_effect_matrix_variable_GetMemberByIndex,
4126     d3d10_effect_matrix_variable_GetMemberByName,
4127     d3d10_effect_matrix_variable_GetMemberBySemantic,
4128     d3d10_effect_matrix_variable_GetElement,
4129     d3d10_effect_matrix_variable_GetParentConstantBuffer,
4130     d3d10_effect_matrix_variable_AsScalar,
4131     d3d10_effect_matrix_variable_AsVector,
4132     d3d10_effect_matrix_variable_AsMatrix,
4133     d3d10_effect_matrix_variable_AsString,
4134     d3d10_effect_matrix_variable_AsShaderResource,
4135     d3d10_effect_matrix_variable_AsRenderTargetView,
4136     d3d10_effect_matrix_variable_AsDepthStencilView,
4137     d3d10_effect_matrix_variable_AsConstantBuffer,
4138     d3d10_effect_matrix_variable_AsShader,
4139     d3d10_effect_matrix_variable_AsBlend,
4140     d3d10_effect_matrix_variable_AsDepthStencil,
4141     d3d10_effect_matrix_variable_AsRasterizer,
4142     d3d10_effect_matrix_variable_AsSampler,
4143     d3d10_effect_matrix_variable_SetRawValue,
4144     d3d10_effect_matrix_variable_GetRawValue,
4145     /* ID3D10EffectMatrixVariable methods */
4146     d3d10_effect_matrix_variable_SetMatrix,
4147     d3d10_effect_matrix_variable_GetMatrix,
4148     d3d10_effect_matrix_variable_SetMatrixArray,
4149     d3d10_effect_matrix_variable_GetMatrixArray,
4150     d3d10_effect_matrix_variable_SetMatrixTranspose,
4151     d3d10_effect_matrix_variable_GetMatrixTranspose,
4152     d3d10_effect_matrix_variable_SetMatrixTransposeArray,
4153     d3d10_effect_matrix_variable_GetMatrixTransposeArray,
4154 };
4155
4156 /* ID3D10EffectVariable methods */
4157
4158 static BOOL STDMETHODCALLTYPE d3d10_effect_string_variable_IsValid(ID3D10EffectStringVariable *iface)
4159 {
4160     TRACE("iface %p\n", iface);
4161
4162     return (struct d3d10_effect_variable *)iface != &null_string_variable;
4163 }
4164
4165 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_string_variable_GetType(
4166         ID3D10EffectStringVariable *iface)
4167 {
4168     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4169 }
4170
4171 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetDesc(ID3D10EffectStringVariable *iface,
4172         D3D10_EFFECT_VARIABLE_DESC *desc)
4173 {
4174     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4175 }
4176
4177 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetAnnotationByIndex(
4178         ID3D10EffectStringVariable *iface, UINT index)
4179 {
4180     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4181 }
4182
4183 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetAnnotationByName(
4184         ID3D10EffectStringVariable *iface, LPCSTR name)
4185 {
4186     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4187 }
4188
4189 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberByIndex(
4190         ID3D10EffectStringVariable *iface, UINT index)
4191 {
4192     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4193 }
4194
4195 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberByName(
4196         ID3D10EffectStringVariable *iface, LPCSTR name)
4197 {
4198     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4199 }
4200
4201 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberBySemantic(
4202         ID3D10EffectStringVariable *iface, LPCSTR semantic)
4203 {
4204     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4205 }
4206
4207 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetElement(
4208         ID3D10EffectStringVariable *iface, UINT index)
4209 {
4210     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4211 }
4212
4213 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_string_variable_GetParentConstantBuffer(
4214         ID3D10EffectStringVariable *iface)
4215 {
4216     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4217 }
4218
4219 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsScalar(
4220         ID3D10EffectStringVariable *iface)
4221 {
4222     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4223 }
4224
4225 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsVector(
4226         ID3D10EffectStringVariable *iface)
4227 {
4228     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4229 }
4230
4231 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsMatrix(
4232         ID3D10EffectStringVariable *iface)
4233 {
4234     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4235 }
4236
4237 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsString(
4238         ID3D10EffectStringVariable *iface)
4239 {
4240     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4241 }
4242
4243 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsShaderResource(
4244         ID3D10EffectStringVariable *iface)
4245 {
4246     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4247 }
4248
4249 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsRenderTargetView(
4250         ID3D10EffectStringVariable *iface)
4251 {
4252     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4253 }
4254
4255 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsDepthStencilView(
4256         ID3D10EffectStringVariable *iface)
4257 {
4258     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4259 }
4260
4261 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_string_variable_AsConstantBuffer(
4262         ID3D10EffectStringVariable *iface)
4263 {
4264     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4265 }
4266
4267 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsShader(
4268         ID3D10EffectStringVariable *iface)
4269 {
4270     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4271 }
4272
4273 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsBlend(
4274         ID3D10EffectStringVariable *iface)
4275 {
4276     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4277 }
4278
4279 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsDepthStencil(
4280         ID3D10EffectStringVariable *iface)
4281 {
4282     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4283 }
4284
4285 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsRasterizer(
4286         ID3D10EffectStringVariable *iface)
4287 {
4288     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4289 }
4290
4291 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsSampler(
4292         ID3D10EffectStringVariable *iface)
4293 {
4294     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4295 }
4296
4297 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_SetRawValue(ID3D10EffectStringVariable *iface,
4298         void *data, UINT offset, UINT count)
4299 {
4300     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4301 }
4302
4303 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetRawValue(ID3D10EffectStringVariable *iface,
4304         void *data, UINT offset, UINT count)
4305 {
4306     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4307 }
4308
4309 /* ID3D10EffectStringVariable methods */
4310
4311 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetString(ID3D10EffectStringVariable *iface,
4312         LPCSTR *str)
4313 {
4314     FIXME("iface %p, str %p stub!\n", iface, str);
4315
4316     return E_NOTIMPL;
4317 }
4318
4319 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetStringArray(ID3D10EffectStringVariable *iface,
4320         LPCSTR *strs, UINT offset, UINT count)
4321 {
4322     FIXME("iface %p, strs %p, offset %u, count %u stub!\n", iface, strs, offset, count);
4323
4324     return E_NOTIMPL;
4325 }
4326
4327
4328 static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl =
4329 {
4330     /* ID3D10EffectVariable methods */
4331     d3d10_effect_string_variable_IsValid,
4332     d3d10_effect_string_variable_GetType,
4333     d3d10_effect_string_variable_GetDesc,
4334     d3d10_effect_string_variable_GetAnnotationByIndex,
4335     d3d10_effect_string_variable_GetAnnotationByName,
4336     d3d10_effect_string_variable_GetMemberByIndex,
4337     d3d10_effect_string_variable_GetMemberByName,
4338     d3d10_effect_string_variable_GetMemberBySemantic,
4339     d3d10_effect_string_variable_GetElement,
4340     d3d10_effect_string_variable_GetParentConstantBuffer,
4341     d3d10_effect_string_variable_AsScalar,
4342     d3d10_effect_string_variable_AsVector,
4343     d3d10_effect_string_variable_AsMatrix,
4344     d3d10_effect_string_variable_AsString,
4345     d3d10_effect_string_variable_AsShaderResource,
4346     d3d10_effect_string_variable_AsRenderTargetView,
4347     d3d10_effect_string_variable_AsDepthStencilView,
4348     d3d10_effect_string_variable_AsConstantBuffer,
4349     d3d10_effect_string_variable_AsShader,
4350     d3d10_effect_string_variable_AsBlend,
4351     d3d10_effect_string_variable_AsDepthStencil,
4352     d3d10_effect_string_variable_AsRasterizer,
4353     d3d10_effect_string_variable_AsSampler,
4354     d3d10_effect_string_variable_SetRawValue,
4355     d3d10_effect_string_variable_GetRawValue,
4356     /* ID3D10EffectStringVariable methods */
4357     d3d10_effect_string_variable_GetString,
4358     d3d10_effect_string_variable_GetStringArray,
4359 };
4360
4361 /* ID3D10EffectVariable methods */
4362
4363 static BOOL STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_IsValid(ID3D10EffectShaderResourceVariable *iface)
4364 {
4365     TRACE("iface %p\n", iface);
4366
4367     return (struct d3d10_effect_variable *)iface != &null_shader_resource_variable;
4368 }
4369
4370 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetType(
4371         ID3D10EffectShaderResourceVariable *iface)
4372 {
4373     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4374 }
4375
4376 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetDesc(
4377         ID3D10EffectShaderResourceVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
4378 {
4379     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4380 }
4381
4382 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetAnnotationByIndex(
4383         ID3D10EffectShaderResourceVariable *iface, UINT index)
4384 {
4385     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4386 }
4387
4388 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetAnnotationByName(
4389         ID3D10EffectShaderResourceVariable *iface, LPCSTR name)
4390 {
4391     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4392 }
4393
4394 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberByIndex(
4395         ID3D10EffectShaderResourceVariable *iface, UINT index)
4396 {
4397     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4398 }
4399
4400 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberByName(
4401         ID3D10EffectShaderResourceVariable *iface, LPCSTR name)
4402 {
4403     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4404 }
4405
4406 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberBySemantic(
4407         ID3D10EffectShaderResourceVariable *iface, LPCSTR semantic)
4408 {
4409     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4410 }
4411
4412 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetElement(
4413         ID3D10EffectShaderResourceVariable *iface, UINT index)
4414 {
4415     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4416 }
4417
4418 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetParentConstantBuffer(
4419         ID3D10EffectShaderResourceVariable *iface)
4420 {
4421     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4422 }
4423
4424 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsScalar(
4425         ID3D10EffectShaderResourceVariable *iface)
4426 {
4427     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4428 }
4429
4430 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsVector(
4431         ID3D10EffectShaderResourceVariable *iface)
4432 {
4433     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4434 }
4435
4436 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsMatrix(
4437         ID3D10EffectShaderResourceVariable *iface)
4438 {
4439     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4440 }
4441
4442 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsString(
4443         ID3D10EffectShaderResourceVariable *iface)
4444 {
4445     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4446 }
4447
4448 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsShaderResource(
4449         ID3D10EffectShaderResourceVariable *iface)
4450 {
4451     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4452 }
4453
4454 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsRenderTargetView(
4455         ID3D10EffectShaderResourceVariable *iface)
4456 {
4457     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4458 }
4459
4460 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsDepthStencilView(
4461         ID3D10EffectShaderResourceVariable *iface)
4462 {
4463     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4464 }
4465
4466 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsConstantBuffer(
4467         ID3D10EffectShaderResourceVariable *iface)
4468 {
4469     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4470 }
4471
4472 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsShader(
4473         ID3D10EffectShaderResourceVariable *iface)
4474 {
4475     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4476 }
4477
4478 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsBlend(
4479         ID3D10EffectShaderResourceVariable *iface)
4480 {
4481     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4482 }
4483
4484 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsDepthStencil(
4485         ID3D10EffectShaderResourceVariable *iface)
4486 {
4487     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4488 }
4489
4490 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsRasterizer(
4491         ID3D10EffectShaderResourceVariable *iface)
4492 {
4493     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4494 }
4495
4496 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsSampler(
4497         ID3D10EffectShaderResourceVariable *iface)
4498 {
4499     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4500 }
4501
4502 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetRawValue(
4503         ID3D10EffectShaderResourceVariable *iface, void *data, UINT offset, UINT count)
4504 {
4505     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4506 }
4507
4508 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetRawValue(
4509         ID3D10EffectShaderResourceVariable *iface, void *data, UINT offset, UINT count)
4510 {
4511     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4512 }
4513
4514 /* ID3D10EffectShaderResourceVariable methods */
4515
4516 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetResource(
4517         ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView *resource)
4518 {
4519     FIXME("iface %p, resource %p stub!\n", iface, resource);
4520
4521     return E_NOTIMPL;
4522 }
4523
4524 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetResource(
4525         ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resource)
4526 {
4527     FIXME("iface %p, resource %p stub!\n", iface, resource);
4528
4529     return E_NOTIMPL;
4530 }
4531
4532 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetResourceArray(
4533         ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resources, UINT offset, UINT count)
4534 {
4535     FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface, resources, offset, count);
4536
4537     return E_NOTIMPL;
4538 }
4539
4540 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetResourceArray(
4541         ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resources, UINT offset, UINT count)
4542 {
4543     FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface, resources, offset, count);
4544
4545     return E_NOTIMPL;
4546 }
4547
4548
4549 static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl =
4550 {
4551     /* ID3D10EffectVariable methods */
4552     d3d10_effect_shader_resource_variable_IsValid,
4553     d3d10_effect_shader_resource_variable_GetType,
4554     d3d10_effect_shader_resource_variable_GetDesc,
4555     d3d10_effect_shader_resource_variable_GetAnnotationByIndex,
4556     d3d10_effect_shader_resource_variable_GetAnnotationByName,
4557     d3d10_effect_shader_resource_variable_GetMemberByIndex,
4558     d3d10_effect_shader_resource_variable_GetMemberByName,
4559     d3d10_effect_shader_resource_variable_GetMemberBySemantic,
4560     d3d10_effect_shader_resource_variable_GetElement,
4561     d3d10_effect_shader_resource_variable_GetParentConstantBuffer,
4562     d3d10_effect_shader_resource_variable_AsScalar,
4563     d3d10_effect_shader_resource_variable_AsVector,
4564     d3d10_effect_shader_resource_variable_AsMatrix,
4565     d3d10_effect_shader_resource_variable_AsString,
4566     d3d10_effect_shader_resource_variable_AsShaderResource,
4567     d3d10_effect_shader_resource_variable_AsRenderTargetView,
4568     d3d10_effect_shader_resource_variable_AsDepthStencilView,
4569     d3d10_effect_shader_resource_variable_AsConstantBuffer,
4570     d3d10_effect_shader_resource_variable_AsShader,
4571     d3d10_effect_shader_resource_variable_AsBlend,
4572     d3d10_effect_shader_resource_variable_AsDepthStencil,
4573     d3d10_effect_shader_resource_variable_AsRasterizer,
4574     d3d10_effect_shader_resource_variable_AsSampler,
4575     d3d10_effect_shader_resource_variable_SetRawValue,
4576     d3d10_effect_shader_resource_variable_GetRawValue,
4577     /* ID3D10EffectShaderResourceVariable methods */
4578     d3d10_effect_shader_resource_variable_SetResource,
4579     d3d10_effect_shader_resource_variable_GetResource,
4580     d3d10_effect_shader_resource_variable_SetResourceArray,
4581     d3d10_effect_shader_resource_variable_GetResourceArray,
4582 };
4583
4584 /* ID3D10EffectVariable methods */
4585
4586 static BOOL STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_IsValid(
4587         ID3D10EffectRenderTargetViewVariable *iface)
4588 {
4589     TRACE("iface %p\n", iface);
4590
4591     return (struct d3d10_effect_variable *)iface != &null_render_target_view_variable;
4592 }
4593
4594 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetType(
4595         ID3D10EffectRenderTargetViewVariable *iface)
4596 {
4597     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4598 }
4599
4600 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetDesc(
4601         ID3D10EffectRenderTargetViewVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
4602 {
4603     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4604 }
4605
4606 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetAnnotationByIndex(
4607         ID3D10EffectRenderTargetViewVariable *iface, UINT index)
4608 {
4609     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4610 }
4611
4612 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetAnnotationByName(
4613         ID3D10EffectRenderTargetViewVariable *iface, LPCSTR name)
4614 {
4615     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4616 }
4617
4618 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberByIndex(
4619         ID3D10EffectRenderTargetViewVariable *iface, UINT index)
4620 {
4621     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4622 }
4623
4624 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberByName(
4625         ID3D10EffectRenderTargetViewVariable *iface, LPCSTR name)
4626 {
4627     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4628 }
4629
4630 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberBySemantic(
4631         ID3D10EffectRenderTargetViewVariable *iface, LPCSTR semantic)
4632 {
4633     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4634 }
4635
4636 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetElement(
4637         ID3D10EffectRenderTargetViewVariable *iface, UINT index)
4638 {
4639     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4640 }
4641
4642 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetParentConstantBuffer(
4643         ID3D10EffectRenderTargetViewVariable *iface)
4644 {
4645     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4646 }
4647
4648 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsScalar(
4649         ID3D10EffectRenderTargetViewVariable *iface)
4650 {
4651     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4652 }
4653
4654 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsVector(
4655         ID3D10EffectRenderTargetViewVariable *iface)
4656 {
4657     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4658 }
4659
4660 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsMatrix(
4661         ID3D10EffectRenderTargetViewVariable *iface)
4662 {
4663     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4664 }
4665
4666 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsString(
4667         ID3D10EffectRenderTargetViewVariable *iface)
4668 {
4669     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4670 }
4671
4672 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsShaderResource(
4673         ID3D10EffectRenderTargetViewVariable *iface)
4674 {
4675     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4676 }
4677
4678 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsRenderTargetView(
4679         ID3D10EffectRenderTargetViewVariable *iface)
4680 {
4681     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4682 }
4683
4684 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsDepthStencilView(
4685         ID3D10EffectRenderTargetViewVariable *iface)
4686 {
4687     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4688 }
4689
4690 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsConstantBuffer(
4691         ID3D10EffectRenderTargetViewVariable *iface)
4692 {
4693     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4694 }
4695
4696 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsShader(
4697         ID3D10EffectRenderTargetViewVariable *iface)
4698 {
4699     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4700 }
4701
4702 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsBlend(
4703         ID3D10EffectRenderTargetViewVariable *iface)
4704 {
4705     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4706 }
4707
4708 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsDepthStencil(
4709         ID3D10EffectRenderTargetViewVariable *iface)
4710 {
4711     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4712 }
4713
4714 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsRasterizer(
4715         ID3D10EffectRenderTargetViewVariable *iface)
4716 {
4717     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4718 }
4719
4720 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsSampler(
4721         ID3D10EffectRenderTargetViewVariable *iface)
4722 {
4723     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4724 }
4725
4726 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRawValue(
4727         ID3D10EffectRenderTargetViewVariable *iface, void *data, UINT offset, UINT count)
4728 {
4729     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4730 }
4731
4732 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRawValue(
4733         ID3D10EffectRenderTargetViewVariable *iface, void *data, UINT offset, UINT count)
4734 {
4735     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4736 }
4737
4738 /* ID3D10EffectRenderTargetViewVariable methods */
4739
4740 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRenderTarget(
4741         ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView *view)
4742 {
4743     FIXME("iface %p, view %p stub!\n", iface, view);
4744
4745     return E_NOTIMPL;
4746 }
4747
4748 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRenderTarget(
4749         ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **view)
4750 {
4751     FIXME("iface %p, view %p stub!\n", iface, view);
4752
4753     return E_NOTIMPL;
4754 }
4755
4756 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRenderTargetArray(
4757         ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **views, UINT offset, UINT count)
4758 {
4759     FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
4760
4761     return E_NOTIMPL;
4762 }
4763
4764 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRenderTargetArray(
4765         ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **views, UINT offset, UINT count)
4766 {
4767     FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
4768
4769     return E_NOTIMPL;
4770 }
4771
4772
4773 static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl =
4774 {
4775     /* ID3D10EffectVariable methods */
4776     d3d10_effect_render_target_view_variable_IsValid,
4777     d3d10_effect_render_target_view_variable_GetType,
4778     d3d10_effect_render_target_view_variable_GetDesc,
4779     d3d10_effect_render_target_view_variable_GetAnnotationByIndex,
4780     d3d10_effect_render_target_view_variable_GetAnnotationByName,
4781     d3d10_effect_render_target_view_variable_GetMemberByIndex,
4782     d3d10_effect_render_target_view_variable_GetMemberByName,
4783     d3d10_effect_render_target_view_variable_GetMemberBySemantic,
4784     d3d10_effect_render_target_view_variable_GetElement,
4785     d3d10_effect_render_target_view_variable_GetParentConstantBuffer,
4786     d3d10_effect_render_target_view_variable_AsScalar,
4787     d3d10_effect_render_target_view_variable_AsVector,
4788     d3d10_effect_render_target_view_variable_AsMatrix,
4789     d3d10_effect_render_target_view_variable_AsString,
4790     d3d10_effect_render_target_view_variable_AsShaderResource,
4791     d3d10_effect_render_target_view_variable_AsRenderTargetView,
4792     d3d10_effect_render_target_view_variable_AsDepthStencilView,
4793     d3d10_effect_render_target_view_variable_AsConstantBuffer,
4794     d3d10_effect_render_target_view_variable_AsShader,
4795     d3d10_effect_render_target_view_variable_AsBlend,
4796     d3d10_effect_render_target_view_variable_AsDepthStencil,
4797     d3d10_effect_render_target_view_variable_AsRasterizer,
4798     d3d10_effect_render_target_view_variable_AsSampler,
4799     d3d10_effect_render_target_view_variable_SetRawValue,
4800     d3d10_effect_render_target_view_variable_GetRawValue,
4801     /* ID3D10EffectRenderTargetViewVariable methods */
4802     d3d10_effect_render_target_view_variable_SetRenderTarget,
4803     d3d10_effect_render_target_view_variable_GetRenderTarget,
4804     d3d10_effect_render_target_view_variable_SetRenderTargetArray,
4805     d3d10_effect_render_target_view_variable_GetRenderTargetArray,
4806 };
4807
4808 /* ID3D10EffectVariable methods */
4809
4810 static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_IsValid(
4811         ID3D10EffectDepthStencilViewVariable *iface)
4812 {
4813     TRACE("iface %p\n", iface);
4814
4815     return (struct d3d10_effect_variable *)iface != &null_depth_stencil_view_variable;
4816 }
4817
4818 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetType(
4819         ID3D10EffectDepthStencilViewVariable *iface)
4820 {
4821     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4822 }
4823
4824 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDesc(
4825         ID3D10EffectDepthStencilViewVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
4826 {
4827     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4828 }
4829
4830 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex(
4831         ID3D10EffectDepthStencilViewVariable *iface, UINT index)
4832 {
4833     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4834 }
4835
4836 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetAnnotationByName(
4837         ID3D10EffectDepthStencilViewVariable *iface, LPCSTR name)
4838 {
4839     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4840 }
4841
4842 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberByIndex(
4843         ID3D10EffectDepthStencilViewVariable *iface, UINT index)
4844 {
4845     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4846 }
4847
4848 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberByName(
4849         ID3D10EffectDepthStencilViewVariable *iface, LPCSTR name)
4850 {
4851     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4852 }
4853
4854 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic(
4855         ID3D10EffectDepthStencilViewVariable *iface, LPCSTR semantic)
4856 {
4857     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4858 }
4859
4860 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetElement(
4861         ID3D10EffectDepthStencilViewVariable *iface, UINT index)
4862 {
4863     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4864 }
4865
4866 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer(
4867         ID3D10EffectDepthStencilViewVariable *iface)
4868 {
4869     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4870 }
4871
4872 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsScalar(
4873         ID3D10EffectDepthStencilViewVariable *iface)
4874 {
4875     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4876 }
4877
4878 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsVector(
4879         ID3D10EffectDepthStencilViewVariable *iface)
4880 {
4881     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4882 }
4883
4884 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsMatrix(
4885         ID3D10EffectDepthStencilViewVariable *iface)
4886 {
4887     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4888 }
4889
4890 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsString(
4891         ID3D10EffectDepthStencilViewVariable *iface)
4892 {
4893     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4894 }
4895
4896 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsShaderResource(
4897         ID3D10EffectDepthStencilViewVariable *iface)
4898 {
4899     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4900 }
4901
4902 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsRenderTargetView(
4903         ID3D10EffectDepthStencilViewVariable *iface)
4904 {
4905     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4906 }
4907
4908 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsDepthStencilView(
4909         ID3D10EffectDepthStencilViewVariable *iface)
4910 {
4911     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4912 }
4913
4914 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsConstantBuffer(
4915         ID3D10EffectDepthStencilViewVariable *iface)
4916 {
4917     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4918 }
4919
4920 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsShader(
4921         ID3D10EffectDepthStencilViewVariable *iface)
4922 {
4923     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4924 }
4925
4926 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsBlend(
4927         ID3D10EffectDepthStencilViewVariable *iface)
4928 {
4929     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4930 }
4931
4932 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsDepthStencil(
4933         ID3D10EffectDepthStencilViewVariable *iface)
4934 {
4935     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4936 }
4937
4938 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsRasterizer(
4939         ID3D10EffectDepthStencilViewVariable *iface)
4940 {
4941     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4942 }
4943
4944 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsSampler(
4945         ID3D10EffectDepthStencilViewVariable *iface)
4946 {
4947     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4948 }
4949
4950 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetRawValue(
4951         ID3D10EffectDepthStencilViewVariable *iface, void *data, UINT offset, UINT count)
4952 {
4953     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4954 }
4955
4956 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetRawValue(
4957         ID3D10EffectDepthStencilViewVariable *iface, void *data, UINT offset, UINT count)
4958 {
4959     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4960 }
4961
4962 /* ID3D10EffectDepthStencilViewVariable methods */
4963
4964 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetDepthStencil(
4965         ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView *view)
4966 {
4967     FIXME("iface %p, view %p stub!\n", iface, view);
4968
4969     return E_NOTIMPL;
4970 }
4971
4972 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDepthStencil(
4973         ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **view)
4974 {
4975     FIXME("iface %p, view %p stub!\n", iface, view);
4976
4977     return E_NOTIMPL;
4978 }
4979
4980 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray(
4981         ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **views, UINT offset, UINT count)
4982 {
4983     FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
4984
4985     return E_NOTIMPL;
4986 }
4987
4988 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray(
4989         ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **views, UINT offset, UINT count)
4990 {
4991     FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
4992
4993     return E_NOTIMPL;
4994 }
4995
4996
4997 static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl =
4998 {
4999     /* ID3D10EffectVariable methods */
5000     d3d10_effect_depth_stencil_view_variable_IsValid,
5001     d3d10_effect_depth_stencil_view_variable_GetType,
5002     d3d10_effect_depth_stencil_view_variable_GetDesc,
5003     d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex,
5004     d3d10_effect_depth_stencil_view_variable_GetAnnotationByName,
5005     d3d10_effect_depth_stencil_view_variable_GetMemberByIndex,
5006     d3d10_effect_depth_stencil_view_variable_GetMemberByName,
5007     d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic,
5008     d3d10_effect_depth_stencil_view_variable_GetElement,
5009     d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer,
5010     d3d10_effect_depth_stencil_view_variable_AsScalar,
5011     d3d10_effect_depth_stencil_view_variable_AsVector,
5012     d3d10_effect_depth_stencil_view_variable_AsMatrix,
5013     d3d10_effect_depth_stencil_view_variable_AsString,
5014     d3d10_effect_depth_stencil_view_variable_AsShaderResource,
5015     d3d10_effect_depth_stencil_view_variable_AsRenderTargetView,
5016     d3d10_effect_depth_stencil_view_variable_AsDepthStencilView,
5017     d3d10_effect_depth_stencil_view_variable_AsConstantBuffer,
5018     d3d10_effect_depth_stencil_view_variable_AsShader,
5019     d3d10_effect_depth_stencil_view_variable_AsBlend,
5020     d3d10_effect_depth_stencil_view_variable_AsDepthStencil,
5021     d3d10_effect_depth_stencil_view_variable_AsRasterizer,
5022     d3d10_effect_depth_stencil_view_variable_AsSampler,
5023     d3d10_effect_depth_stencil_view_variable_SetRawValue,
5024     d3d10_effect_depth_stencil_view_variable_GetRawValue,
5025     /* ID3D10EffectDepthStencilViewVariable methods */
5026     d3d10_effect_depth_stencil_view_variable_SetDepthStencil,
5027     d3d10_effect_depth_stencil_view_variable_GetDepthStencil,
5028     d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray,
5029     d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray,
5030 };
5031
5032 /* ID3D10EffectVariable methods */
5033
5034 static BOOL STDMETHODCALLTYPE d3d10_effect_shader_variable_IsValid(ID3D10EffectShaderVariable *iface)
5035 {
5036     TRACE("iface %p\n", iface);
5037
5038     return (struct d3d10_effect_variable *)iface != &null_shader_variable;
5039 }
5040
5041 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetType(
5042         ID3D10EffectShaderVariable *iface)
5043 {
5044     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5045 }
5046
5047 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetDesc(ID3D10EffectShaderVariable *iface,
5048         D3D10_EFFECT_VARIABLE_DESC *desc)
5049 {
5050     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5051 }
5052
5053 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetAnnotationByIndex(
5054         ID3D10EffectShaderVariable *iface, UINT index)
5055 {
5056     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5057 }
5058
5059 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetAnnotationByName(
5060         ID3D10EffectShaderVariable *iface, LPCSTR name)
5061 {
5062     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5063 }
5064
5065 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberByIndex(
5066         ID3D10EffectShaderVariable *iface, UINT index)
5067 {
5068     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5069 }
5070
5071 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberByName(
5072         ID3D10EffectShaderVariable *iface, LPCSTR name)
5073 {
5074     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5075 }
5076
5077 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberBySemantic(
5078         ID3D10EffectShaderVariable *iface, LPCSTR semantic)
5079 {
5080     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5081 }
5082
5083 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetElement(
5084         ID3D10EffectShaderVariable *iface, UINT index)
5085 {
5086     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5087 }
5088
5089 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetParentConstantBuffer(
5090         ID3D10EffectShaderVariable *iface)
5091 {
5092     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5093 }
5094
5095 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsScalar(
5096         ID3D10EffectShaderVariable *iface)
5097 {
5098     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5099 }
5100
5101 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsVector(
5102         ID3D10EffectShaderVariable *iface)
5103 {
5104     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5105 }
5106
5107 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsMatrix(
5108         ID3D10EffectShaderVariable *iface)
5109 {
5110     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5111 }
5112
5113 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsString(
5114         ID3D10EffectShaderVariable *iface)
5115 {
5116     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5117 }
5118
5119 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsShaderResource(
5120         ID3D10EffectShaderVariable *iface)
5121 {
5122     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5123 }
5124
5125 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsRenderTargetView(
5126         ID3D10EffectShaderVariable *iface)
5127 {
5128     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5129 }
5130
5131 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsDepthStencilView(
5132         ID3D10EffectShaderVariable *iface)
5133 {
5134     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5135 }
5136
5137 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsConstantBuffer(
5138         ID3D10EffectShaderVariable *iface)
5139 {
5140     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5141 }
5142
5143 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsShader(
5144         ID3D10EffectShaderVariable *iface)
5145 {
5146     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5147 }
5148
5149 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsBlend(
5150         ID3D10EffectShaderVariable *iface)
5151 {
5152     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5153 }
5154
5155 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsDepthStencil(
5156         ID3D10EffectShaderVariable *iface)
5157 {
5158     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5159 }
5160
5161 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsRasterizer(
5162         ID3D10EffectShaderVariable *iface)
5163 {
5164     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5165 }
5166
5167 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsSampler(
5168         ID3D10EffectShaderVariable *iface)
5169 {
5170     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5171 }
5172
5173 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_SetRawValue(
5174         ID3D10EffectShaderVariable *iface, void *data, UINT offset, UINT count)
5175 {
5176     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5177 }
5178
5179 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetRawValue(
5180         ID3D10EffectShaderVariable *iface, void *data, UINT offset, UINT count)
5181 {
5182     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5183 }
5184
5185 /* ID3D10EffectShaderVariable methods */
5186
5187 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetShaderDesc(
5188         ID3D10EffectShaderVariable *iface, UINT index, D3D10_EFFECT_SHADER_DESC *desc)
5189 {
5190     FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5191
5192     return E_NOTIMPL;
5193 }
5194
5195 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetVertexShader(
5196         ID3D10EffectShaderVariable *iface, UINT index, ID3D10VertexShader **shader)
5197 {
5198     FIXME("iface %p, index %u, shader %p stub!\n", iface, index, shader);
5199
5200     return E_NOTIMPL;
5201 }
5202
5203 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetGeometryShader(
5204         ID3D10EffectShaderVariable *iface, UINT index, ID3D10GeometryShader **shader)
5205 {
5206     FIXME("iface %p, index %u, shader %p stub!\n", iface, index, shader);
5207
5208     return E_NOTIMPL;
5209 }
5210
5211 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetPixelShader(
5212         ID3D10EffectShaderVariable *iface, UINT index, ID3D10PixelShader **shader)
5213 {
5214     FIXME("iface %p, index %u, shader %p stub!\n", iface, index, shader);
5215
5216     return E_NOTIMPL;
5217 }
5218
5219 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetInputSignatureElementDesc(
5220         ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index,
5221         D3D10_SIGNATURE_PARAMETER_DESC *desc)
5222 {
5223     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
5224     struct d3d10_effect_shader_variable *s;
5225     D3D10_SIGNATURE_PARAMETER_DESC *d;
5226
5227     TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5228             iface, shader_index, element_index, desc);
5229
5230     if (!iface->lpVtbl->IsValid(iface))
5231     {
5232         WARN("Null variable specified\n");
5233         return E_FAIL;
5234     }
5235
5236     /* Check shader_index, this crashes on W7/DX10 */
5237     if (shader_index >= This->effect->used_shader_count)
5238     {
5239         WARN("This should crash on W7/DX10!\n");
5240         return E_FAIL;
5241     }
5242
5243     s = This->effect->used_shaders[shader_index]->data;
5244     if (!s->input_signature.signature)
5245     {
5246         WARN("No shader signature\n");
5247         return D3DERR_INVALIDCALL;
5248     }
5249
5250     /* Check desc for NULL, this crashes on W7/DX10 */
5251     if (!desc)
5252     {
5253         WARN("This should crash on W7/DX10!\n");
5254         return E_FAIL;
5255     }
5256
5257     if (element_index >= s->input_signature.element_count)
5258     {
5259         WARN("Invalid element index specified\n");
5260         return E_INVALIDARG;
5261     }
5262
5263     d = &s->input_signature.elements[element_index];
5264     desc->SemanticName = d->SemanticName;
5265     desc->SemanticIndex  =  d->SemanticIndex;
5266     desc->SystemValueType =  d->SystemValueType;
5267     desc->ComponentType =  d->ComponentType;
5268     desc->Register =  d->Register;
5269     desc->ReadWriteMask  =  d->ReadWriteMask;
5270     desc->Mask =  d->Mask;
5271
5272     return S_OK;
5273 }
5274
5275 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetOutputSignatureElementDesc(
5276         ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index,
5277         D3D10_SIGNATURE_PARAMETER_DESC *desc)
5278 {
5279     struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
5280     struct d3d10_effect_shader_variable *s;
5281     D3D10_SIGNATURE_PARAMETER_DESC *d;
5282
5283     TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5284             iface, shader_index, element_index, desc);
5285
5286     if (!iface->lpVtbl->IsValid(iface))
5287     {
5288         WARN("Null variable specified\n");
5289         return E_FAIL;
5290     }
5291
5292     /* Check shader_index, this crashes on W7/DX10 */
5293     if (shader_index >= This->effect->used_shader_count)
5294     {
5295         WARN("This should crash on W7/DX10!\n");
5296         return E_FAIL;
5297     }
5298
5299     s = This->effect->used_shaders[shader_index]->data;
5300     if (!s->output_signature.signature)
5301     {
5302         WARN("No shader signature\n");
5303         return D3DERR_INVALIDCALL;
5304     }
5305
5306     /* Check desc for NULL, this crashes on W7/DX10 */
5307     if (!desc)
5308     {
5309         WARN("This should crash on W7/DX10!\n");
5310         return E_FAIL;
5311     }
5312
5313     if (element_index >= s->output_signature.element_count)
5314     {
5315         WARN("Invalid element index specified\n");
5316         return E_INVALIDARG;
5317     }
5318
5319     d = &s->output_signature.elements[element_index];
5320     desc->SemanticName = d->SemanticName;
5321     desc->SemanticIndex  =  d->SemanticIndex;
5322     desc->SystemValueType =  d->SystemValueType;
5323     desc->ComponentType =  d->ComponentType;
5324     desc->Register =  d->Register;
5325     desc->ReadWriteMask  =  d->ReadWriteMask;
5326     desc->Mask =  d->Mask;
5327
5328     return S_OK;
5329 }
5330
5331
5332 static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl =
5333 {
5334     /* ID3D10EffectVariable methods */
5335     d3d10_effect_shader_variable_IsValid,
5336     d3d10_effect_shader_variable_GetType,
5337     d3d10_effect_shader_variable_GetDesc,
5338     d3d10_effect_shader_variable_GetAnnotationByIndex,
5339     d3d10_effect_shader_variable_GetAnnotationByName,
5340     d3d10_effect_shader_variable_GetMemberByIndex,
5341     d3d10_effect_shader_variable_GetMemberByName,
5342     d3d10_effect_shader_variable_GetMemberBySemantic,
5343     d3d10_effect_shader_variable_GetElement,
5344     d3d10_effect_shader_variable_GetParentConstantBuffer,
5345     d3d10_effect_shader_variable_AsScalar,
5346     d3d10_effect_shader_variable_AsVector,
5347     d3d10_effect_shader_variable_AsMatrix,
5348     d3d10_effect_shader_variable_AsString,
5349     d3d10_effect_shader_variable_AsShaderResource,
5350     d3d10_effect_shader_variable_AsRenderTargetView,
5351     d3d10_effect_shader_variable_AsDepthStencilView,
5352     d3d10_effect_shader_variable_AsConstantBuffer,
5353     d3d10_effect_shader_variable_AsShader,
5354     d3d10_effect_shader_variable_AsBlend,
5355     d3d10_effect_shader_variable_AsDepthStencil,
5356     d3d10_effect_shader_variable_AsRasterizer,
5357     d3d10_effect_shader_variable_AsSampler,
5358     d3d10_effect_shader_variable_SetRawValue,
5359     d3d10_effect_shader_variable_GetRawValue,
5360     /* ID3D10EffectShaderVariable methods */
5361     d3d10_effect_shader_variable_GetShaderDesc,
5362     d3d10_effect_shader_variable_GetVertexShader,
5363     d3d10_effect_shader_variable_GetGeometryShader,
5364     d3d10_effect_shader_variable_GetPixelShader,
5365     d3d10_effect_shader_variable_GetInputSignatureElementDesc,
5366     d3d10_effect_shader_variable_GetOutputSignatureElementDesc,
5367 };
5368
5369 /* ID3D10EffectVariable methods */
5370
5371 static BOOL STDMETHODCALLTYPE d3d10_effect_blend_variable_IsValid(ID3D10EffectBlendVariable *iface)
5372 {
5373     TRACE("iface %p\n", iface);
5374
5375     return (struct d3d10_effect_variable *)iface != &null_blend_variable;
5376 }
5377
5378 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetType(
5379         ID3D10EffectBlendVariable *iface)
5380 {
5381     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5382 }
5383
5384 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetDesc(ID3D10EffectBlendVariable *iface,
5385         D3D10_EFFECT_VARIABLE_DESC *desc)
5386 {
5387     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5388 }
5389
5390 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetAnnotationByIndex(
5391         ID3D10EffectBlendVariable *iface, UINT index)
5392 {
5393     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5394 }
5395
5396 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetAnnotationByName(
5397         ID3D10EffectBlendVariable *iface, LPCSTR name)
5398 {
5399     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5400 }
5401
5402 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberByIndex(
5403         ID3D10EffectBlendVariable *iface, UINT index)
5404 {
5405     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5406 }
5407
5408 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberByName(
5409         ID3D10EffectBlendVariable *iface, LPCSTR name)
5410 {
5411     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5412 }
5413
5414 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberBySemantic(
5415         ID3D10EffectBlendVariable *iface, LPCSTR semantic)
5416 {
5417     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5418 }
5419
5420 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetElement(
5421         ID3D10EffectBlendVariable *iface, UINT index)
5422 {
5423     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5424 }
5425
5426 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetParentConstantBuffer(
5427         ID3D10EffectBlendVariable *iface)
5428 {
5429     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5430 }
5431
5432 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsScalar(
5433         ID3D10EffectBlendVariable *iface)
5434 {
5435     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5436 }
5437
5438 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsVector(
5439         ID3D10EffectBlendVariable *iface)
5440 {
5441     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5442 }
5443
5444 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsMatrix(
5445         ID3D10EffectBlendVariable *iface)
5446 {
5447     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5448 }
5449
5450 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsString(
5451         ID3D10EffectBlendVariable *iface)
5452 {
5453     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5454 }
5455
5456 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsShaderResource(
5457         ID3D10EffectBlendVariable *iface)
5458 {
5459     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5460 }
5461
5462 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsRenderTargetView(
5463         ID3D10EffectBlendVariable *iface)
5464 {
5465     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5466 }
5467
5468 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsDepthStencilView(
5469         ID3D10EffectBlendVariable *iface)
5470 {
5471     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5472 }
5473
5474 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsConstantBuffer(
5475         ID3D10EffectBlendVariable *iface)
5476 {
5477     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5478 }
5479
5480 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsShader(
5481         ID3D10EffectBlendVariable *iface)
5482 {
5483     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5484 }
5485
5486 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsBlend(
5487         ID3D10EffectBlendVariable *iface)
5488 {
5489     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5490 }
5491
5492 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsDepthStencil(
5493         ID3D10EffectBlendVariable *iface)
5494 {
5495     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5496 }
5497
5498 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsRasterizer(
5499         ID3D10EffectBlendVariable *iface)
5500 {
5501     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5502 }
5503
5504 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsSampler(
5505         ID3D10EffectBlendVariable *iface)
5506 {
5507     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5508 }
5509
5510 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_SetRawValue(ID3D10EffectBlendVariable *iface,
5511         void *data, UINT offset, UINT count)
5512 {
5513     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5514 }
5515
5516 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetRawValue(ID3D10EffectBlendVariable *iface,
5517         void *data, UINT offset, UINT count)
5518 {
5519     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5520 }
5521
5522 /* ID3D10EffectBlendVariable methods */
5523
5524 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBlendState(ID3D10EffectBlendVariable *iface,
5525         UINT index, ID3D10BlendState **blend_state)
5526 {
5527     FIXME("iface %p, index %u, blend_state %p stub!\n", iface, index, blend_state);
5528
5529     return E_NOTIMPL;
5530 }
5531
5532 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBackingStore(ID3D10EffectBlendVariable *iface,
5533         UINT index, D3D10_BLEND_DESC *desc)
5534 {
5535     FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5536
5537     return E_NOTIMPL;
5538 }
5539
5540
5541 static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl =
5542 {
5543     /* ID3D10EffectVariable methods */
5544     d3d10_effect_blend_variable_IsValid,
5545     d3d10_effect_blend_variable_GetType,
5546     d3d10_effect_blend_variable_GetDesc,
5547     d3d10_effect_blend_variable_GetAnnotationByIndex,
5548     d3d10_effect_blend_variable_GetAnnotationByName,
5549     d3d10_effect_blend_variable_GetMemberByIndex,
5550     d3d10_effect_blend_variable_GetMemberByName,
5551     d3d10_effect_blend_variable_GetMemberBySemantic,
5552     d3d10_effect_blend_variable_GetElement,
5553     d3d10_effect_blend_variable_GetParentConstantBuffer,
5554     d3d10_effect_blend_variable_AsScalar,
5555     d3d10_effect_blend_variable_AsVector,
5556     d3d10_effect_blend_variable_AsMatrix,
5557     d3d10_effect_blend_variable_AsString,
5558     d3d10_effect_blend_variable_AsShaderResource,
5559     d3d10_effect_blend_variable_AsRenderTargetView,
5560     d3d10_effect_blend_variable_AsDepthStencilView,
5561     d3d10_effect_blend_variable_AsConstantBuffer,
5562     d3d10_effect_blend_variable_AsShader,
5563     d3d10_effect_blend_variable_AsBlend,
5564     d3d10_effect_blend_variable_AsDepthStencil,
5565     d3d10_effect_blend_variable_AsRasterizer,
5566     d3d10_effect_blend_variable_AsSampler,
5567     d3d10_effect_blend_variable_SetRawValue,
5568     d3d10_effect_blend_variable_GetRawValue,
5569     /* ID3D10EffectBlendVariable methods */
5570     d3d10_effect_blend_variable_GetBlendState,
5571     d3d10_effect_blend_variable_GetBackingStore,
5572 };
5573
5574 /* ID3D10EffectVariable methods */
5575
5576 static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_IsValid(ID3D10EffectDepthStencilVariable *iface)
5577 {
5578     TRACE("iface %p\n", iface);
5579
5580     return (struct d3d10_effect_variable *)iface != &null_depth_stencil_variable;
5581 }
5582
5583 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetType(
5584         ID3D10EffectDepthStencilVariable *iface)
5585 {
5586     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5587 }
5588
5589 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetDesc(ID3D10EffectDepthStencilVariable *iface,
5590         D3D10_EFFECT_VARIABLE_DESC *desc)
5591 {
5592     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5593 }
5594
5595 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetAnnotationByIndex(
5596         ID3D10EffectDepthStencilVariable *iface, UINT index)
5597 {
5598     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5599 }
5600
5601 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetAnnotationByName(
5602         ID3D10EffectDepthStencilVariable *iface, LPCSTR name)
5603 {
5604     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5605 }
5606
5607 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberByIndex(
5608         ID3D10EffectDepthStencilVariable *iface, UINT index)
5609 {
5610     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5611 }
5612
5613 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberByName(
5614         ID3D10EffectDepthStencilVariable *iface, LPCSTR name)
5615 {
5616     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5617 }
5618
5619 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberBySemantic(
5620         ID3D10EffectDepthStencilVariable *iface, LPCSTR semantic)
5621 {
5622     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5623 }
5624
5625 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetElement(
5626         ID3D10EffectDepthStencilVariable *iface, UINT index)
5627 {
5628     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5629 }
5630
5631 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetParentConstantBuffer(
5632         ID3D10EffectDepthStencilVariable *iface)
5633 {
5634     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5635 }
5636
5637 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsScalar(
5638         ID3D10EffectDepthStencilVariable *iface)
5639 {
5640     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5641 }
5642
5643 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsVector(
5644         ID3D10EffectDepthStencilVariable *iface)
5645 {
5646     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5647 }
5648
5649 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsMatrix(
5650         ID3D10EffectDepthStencilVariable *iface)
5651 {
5652     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5653 }
5654
5655 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsString(
5656         ID3D10EffectDepthStencilVariable *iface)
5657 {
5658     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5659 }
5660
5661 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsShaderResource(
5662         ID3D10EffectDepthStencilVariable *iface)
5663 {
5664     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5665 }
5666
5667 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsRenderTargetView(
5668         ID3D10EffectDepthStencilVariable *iface)
5669 {
5670     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5671 }
5672
5673 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsDepthStencilView(
5674         ID3D10EffectDepthStencilVariable *iface)
5675 {
5676     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5677 }
5678
5679 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsConstantBuffer(
5680         ID3D10EffectDepthStencilVariable *iface)
5681 {
5682     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5683 }
5684
5685 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsShader(
5686         ID3D10EffectDepthStencilVariable *iface)
5687 {
5688     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5689 }
5690
5691 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsBlend(
5692         ID3D10EffectDepthStencilVariable *iface)
5693 {
5694     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5695 }
5696
5697 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsDepthStencil(
5698         ID3D10EffectDepthStencilVariable *iface)
5699 {
5700     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5701 }
5702
5703 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsRasterizer(
5704         ID3D10EffectDepthStencilVariable *iface)
5705 {
5706     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5707 }
5708
5709 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsSampler(
5710         ID3D10EffectDepthStencilVariable *iface)
5711 {
5712     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5713 }
5714
5715 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_SetRawValue(ID3D10EffectDepthStencilVariable *iface,
5716         void *data, UINT offset, UINT count)
5717 {
5718     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5719 }
5720
5721 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetRawValue(ID3D10EffectDepthStencilVariable *iface,
5722         void *data, UINT offset, UINT count)
5723 {
5724     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5725 }
5726
5727 /* ID3D10EffectDepthStencilVariable methods */
5728
5729 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetDepthStencilState(ID3D10EffectDepthStencilVariable *iface,
5730         UINT index, ID3D10DepthStencilState **depth_stencil_state)
5731 {
5732     FIXME("iface %p, index %u, depth_stencil_state %p stub!\n", iface, index, depth_stencil_state);
5733
5734     return E_NOTIMPL;
5735 }
5736
5737 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetBackingStore(ID3D10EffectDepthStencilVariable *iface,
5738         UINT index, D3D10_DEPTH_STENCIL_DESC *desc)
5739 {
5740     FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5741
5742     return E_NOTIMPL;
5743 }
5744
5745
5746 static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl =
5747 {
5748     /* ID3D10EffectVariable methods */
5749     d3d10_effect_depth_stencil_variable_IsValid,
5750     d3d10_effect_depth_stencil_variable_GetType,
5751     d3d10_effect_depth_stencil_variable_GetDesc,
5752     d3d10_effect_depth_stencil_variable_GetAnnotationByIndex,
5753     d3d10_effect_depth_stencil_variable_GetAnnotationByName,
5754     d3d10_effect_depth_stencil_variable_GetMemberByIndex,
5755     d3d10_effect_depth_stencil_variable_GetMemberByName,
5756     d3d10_effect_depth_stencil_variable_GetMemberBySemantic,
5757     d3d10_effect_depth_stencil_variable_GetElement,
5758     d3d10_effect_depth_stencil_variable_GetParentConstantBuffer,
5759     d3d10_effect_depth_stencil_variable_AsScalar,
5760     d3d10_effect_depth_stencil_variable_AsVector,
5761     d3d10_effect_depth_stencil_variable_AsMatrix,
5762     d3d10_effect_depth_stencil_variable_AsString,
5763     d3d10_effect_depth_stencil_variable_AsShaderResource,
5764     d3d10_effect_depth_stencil_variable_AsRenderTargetView,
5765     d3d10_effect_depth_stencil_variable_AsDepthStencilView,
5766     d3d10_effect_depth_stencil_variable_AsConstantBuffer,
5767     d3d10_effect_depth_stencil_variable_AsShader,
5768     d3d10_effect_depth_stencil_variable_AsBlend,
5769     d3d10_effect_depth_stencil_variable_AsDepthStencil,
5770     d3d10_effect_depth_stencil_variable_AsRasterizer,
5771     d3d10_effect_depth_stencil_variable_AsSampler,
5772     d3d10_effect_depth_stencil_variable_SetRawValue,
5773     d3d10_effect_depth_stencil_variable_GetRawValue,
5774     /* ID3D10EffectDepthStencilVariable methods */
5775     d3d10_effect_depth_stencil_variable_GetDepthStencilState,
5776     d3d10_effect_depth_stencil_variable_GetBackingStore,
5777 };
5778
5779 /* ID3D10EffectVariable methods */
5780
5781 static BOOL STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_IsValid(ID3D10EffectRasterizerVariable *iface)
5782 {
5783     TRACE("iface %p\n", iface);
5784
5785     return (struct d3d10_effect_variable *)iface != &null_rasterizer_variable;
5786 }
5787
5788 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetType(
5789         ID3D10EffectRasterizerVariable *iface)
5790 {
5791     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5792 }
5793
5794 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetDesc(ID3D10EffectRasterizerVariable *iface,
5795         D3D10_EFFECT_VARIABLE_DESC *desc)
5796 {
5797     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5798 }
5799
5800 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetAnnotationByIndex(
5801         ID3D10EffectRasterizerVariable *iface, UINT index)
5802 {
5803     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5804 }
5805
5806 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetAnnotationByName(
5807         ID3D10EffectRasterizerVariable *iface, LPCSTR name)
5808 {
5809     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5810 }
5811
5812 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberByIndex(
5813         ID3D10EffectRasterizerVariable *iface, UINT index)
5814 {
5815     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5816 }
5817
5818 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberByName(
5819         ID3D10EffectRasterizerVariable *iface, LPCSTR name)
5820 {
5821     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5822 }
5823
5824 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberBySemantic(
5825         ID3D10EffectRasterizerVariable *iface, LPCSTR semantic)
5826 {
5827     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5828 }
5829
5830 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetElement(
5831         ID3D10EffectRasterizerVariable *iface, UINT index)
5832 {
5833     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5834 }
5835
5836 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetParentConstantBuffer(
5837         ID3D10EffectRasterizerVariable *iface)
5838 {
5839     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5840 }
5841
5842 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsScalar(
5843         ID3D10EffectRasterizerVariable *iface)
5844 {
5845     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5846 }
5847
5848 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsVector(
5849         ID3D10EffectRasterizerVariable *iface)
5850 {
5851     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5852 }
5853
5854 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsMatrix(
5855         ID3D10EffectRasterizerVariable *iface)
5856 {
5857     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5858 }
5859
5860 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsString(
5861         ID3D10EffectRasterizerVariable *iface)
5862 {
5863     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5864 }
5865
5866 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsShaderResource(
5867         ID3D10EffectRasterizerVariable *iface)
5868 {
5869     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5870 }
5871
5872 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsRenderTargetView(
5873         ID3D10EffectRasterizerVariable *iface)
5874 {
5875     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5876 }
5877
5878 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsDepthStencilView(
5879         ID3D10EffectRasterizerVariable *iface)
5880 {
5881     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5882 }
5883
5884 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsConstantBuffer(
5885         ID3D10EffectRasterizerVariable *iface)
5886 {
5887     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5888 }
5889
5890 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsShader(
5891         ID3D10EffectRasterizerVariable *iface)
5892 {
5893     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5894 }
5895
5896 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsBlend(
5897         ID3D10EffectRasterizerVariable *iface)
5898 {
5899     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5900 }
5901
5902 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsDepthStencil(
5903         ID3D10EffectRasterizerVariable *iface)
5904 {
5905     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5906 }
5907
5908 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsRasterizer(
5909         ID3D10EffectRasterizerVariable *iface)
5910 {
5911     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5912 }
5913
5914 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsSampler(
5915         ID3D10EffectRasterizerVariable *iface)
5916 {
5917     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5918 }
5919
5920 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_SetRawValue(ID3D10EffectRasterizerVariable *iface,
5921         void *data, UINT offset, UINT count)
5922 {
5923     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5924 }
5925
5926 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetRawValue(ID3D10EffectRasterizerVariable *iface,
5927         void *data, UINT offset, UINT count)
5928 {
5929     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5930 }
5931
5932 /* ID3D10EffectRasterizerVariable methods */
5933
5934 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetRasterizerState(ID3D10EffectRasterizerVariable *iface,
5935         UINT index, ID3D10RasterizerState **rasterizer_state)
5936 {
5937     FIXME("iface %p, index %u, rasterizer_state %p stub!\n", iface, index, rasterizer_state);
5938
5939     return E_NOTIMPL;
5940 }
5941
5942 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetBackingStore(ID3D10EffectRasterizerVariable *iface,
5943         UINT index, D3D10_RASTERIZER_DESC *desc)
5944 {
5945     FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5946
5947     return E_NOTIMPL;
5948 }
5949
5950
5951 static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl =
5952 {
5953     /* ID3D10EffectVariable methods */
5954     d3d10_effect_rasterizer_variable_IsValid,
5955     d3d10_effect_rasterizer_variable_GetType,
5956     d3d10_effect_rasterizer_variable_GetDesc,
5957     d3d10_effect_rasterizer_variable_GetAnnotationByIndex,
5958     d3d10_effect_rasterizer_variable_GetAnnotationByName,
5959     d3d10_effect_rasterizer_variable_GetMemberByIndex,
5960     d3d10_effect_rasterizer_variable_GetMemberByName,
5961     d3d10_effect_rasterizer_variable_GetMemberBySemantic,
5962     d3d10_effect_rasterizer_variable_GetElement,
5963     d3d10_effect_rasterizer_variable_GetParentConstantBuffer,
5964     d3d10_effect_rasterizer_variable_AsScalar,
5965     d3d10_effect_rasterizer_variable_AsVector,
5966     d3d10_effect_rasterizer_variable_AsMatrix,
5967     d3d10_effect_rasterizer_variable_AsString,
5968     d3d10_effect_rasterizer_variable_AsShaderResource,
5969     d3d10_effect_rasterizer_variable_AsRenderTargetView,
5970     d3d10_effect_rasterizer_variable_AsDepthStencilView,
5971     d3d10_effect_rasterizer_variable_AsConstantBuffer,
5972     d3d10_effect_rasterizer_variable_AsShader,
5973     d3d10_effect_rasterizer_variable_AsBlend,
5974     d3d10_effect_rasterizer_variable_AsDepthStencil,
5975     d3d10_effect_rasterizer_variable_AsRasterizer,
5976     d3d10_effect_rasterizer_variable_AsSampler,
5977     d3d10_effect_rasterizer_variable_SetRawValue,
5978     d3d10_effect_rasterizer_variable_GetRawValue,
5979     /* ID3D10EffectRasterizerVariable methods */
5980     d3d10_effect_rasterizer_variable_GetRasterizerState,
5981     d3d10_effect_rasterizer_variable_GetBackingStore,
5982 };
5983
5984 /* ID3D10EffectVariable methods */
5985
5986 static BOOL STDMETHODCALLTYPE d3d10_effect_sampler_variable_IsValid(ID3D10EffectSamplerVariable *iface)
5987 {
5988     TRACE("iface %p\n", iface);
5989
5990     return (struct d3d10_effect_variable *)iface != &null_sampler_variable;
5991 }
5992
5993 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetType(
5994         ID3D10EffectSamplerVariable *iface)
5995 {
5996     return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5997 }
5998
5999 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetDesc(ID3D10EffectSamplerVariable *iface,
6000         D3D10_EFFECT_VARIABLE_DESC *desc)
6001 {
6002     return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
6003 }
6004
6005 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetAnnotationByIndex(
6006         ID3D10EffectSamplerVariable *iface, UINT index)
6007 {
6008     return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
6009 }
6010
6011 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetAnnotationByName(
6012         ID3D10EffectSamplerVariable *iface, LPCSTR name)
6013 {
6014     return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
6015 }
6016
6017 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberByIndex(
6018         ID3D10EffectSamplerVariable *iface, UINT index)
6019 {
6020     return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
6021 }
6022
6023 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberByName(
6024         ID3D10EffectSamplerVariable *iface, LPCSTR name)
6025 {
6026     return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
6027 }
6028
6029 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberBySemantic(
6030         ID3D10EffectSamplerVariable *iface, LPCSTR semantic)
6031 {
6032     return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
6033 }
6034
6035 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetElement(
6036         ID3D10EffectSamplerVariable *iface, UINT index)
6037 {
6038     return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
6039 }
6040
6041 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetParentConstantBuffer(
6042         ID3D10EffectSamplerVariable *iface)
6043 {
6044     return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
6045 }
6046
6047 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsScalar(
6048         ID3D10EffectSamplerVariable *iface)
6049 {
6050     return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
6051 }
6052
6053 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsVector(
6054         ID3D10EffectSamplerVariable *iface)
6055 {
6056     return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
6057 }
6058
6059 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsMatrix(
6060         ID3D10EffectSamplerVariable *iface)
6061 {
6062     return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
6063 }
6064
6065 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsString(
6066         ID3D10EffectSamplerVariable *iface)
6067 {
6068     return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
6069 }
6070
6071 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsShaderResource(
6072         ID3D10EffectSamplerVariable *iface)
6073 {
6074     return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
6075 }
6076
6077 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsRenderTargetView(
6078         ID3D10EffectSamplerVariable *iface)
6079 {
6080     return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
6081 }
6082
6083 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsDepthStencilView(
6084         ID3D10EffectSamplerVariable *iface)
6085 {
6086     return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
6087 }
6088
6089 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsConstantBuffer(
6090         ID3D10EffectSamplerVariable *iface)
6091 {
6092     return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
6093 }
6094
6095 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsShader(
6096         ID3D10EffectSamplerVariable *iface)
6097 {
6098     return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
6099 }
6100
6101 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsBlend(
6102         ID3D10EffectSamplerVariable *iface)
6103 {
6104     return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
6105 }
6106
6107 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsDepthStencil(
6108         ID3D10EffectSamplerVariable *iface)
6109 {
6110     return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
6111 }
6112
6113 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsRasterizer(
6114         ID3D10EffectSamplerVariable *iface)
6115 {
6116     return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
6117 }
6118
6119 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsSampler(
6120         ID3D10EffectSamplerVariable *iface)
6121 {
6122     return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
6123 }
6124
6125 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_SetRawValue(ID3D10EffectSamplerVariable *iface,
6126         void *data, UINT offset, UINT count)
6127 {
6128     return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6129 }
6130
6131 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetRawValue(ID3D10EffectSamplerVariable *iface,
6132         void *data, UINT offset, UINT count)
6133 {
6134     return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6135 }
6136
6137 /* ID3D10EffectSamplerVariable methods */
6138
6139 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetSampler(ID3D10EffectSamplerVariable *iface,
6140         UINT index, ID3D10SamplerState **sampler)
6141 {
6142     FIXME("iface %p, index %u, sampler %p stub!\n", iface, index, sampler);
6143
6144     return E_NOTIMPL;
6145 }
6146
6147 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetBackingStore(ID3D10EffectSamplerVariable *iface,
6148         UINT index, D3D10_SAMPLER_DESC *desc)
6149 {
6150     FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
6151
6152     return E_NOTIMPL;
6153 }
6154
6155
6156 static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl =
6157 {
6158     /* ID3D10EffectVariable methods */
6159     d3d10_effect_sampler_variable_IsValid,
6160     d3d10_effect_sampler_variable_GetType,
6161     d3d10_effect_sampler_variable_GetDesc,
6162     d3d10_effect_sampler_variable_GetAnnotationByIndex,
6163     d3d10_effect_sampler_variable_GetAnnotationByName,
6164     d3d10_effect_sampler_variable_GetMemberByIndex,
6165     d3d10_effect_sampler_variable_GetMemberByName,
6166     d3d10_effect_sampler_variable_GetMemberBySemantic,
6167     d3d10_effect_sampler_variable_GetElement,
6168     d3d10_effect_sampler_variable_GetParentConstantBuffer,
6169     d3d10_effect_sampler_variable_AsScalar,
6170     d3d10_effect_sampler_variable_AsVector,
6171     d3d10_effect_sampler_variable_AsMatrix,
6172     d3d10_effect_sampler_variable_AsString,
6173     d3d10_effect_sampler_variable_AsShaderResource,
6174     d3d10_effect_sampler_variable_AsRenderTargetView,
6175     d3d10_effect_sampler_variable_AsDepthStencilView,
6176     d3d10_effect_sampler_variable_AsConstantBuffer,
6177     d3d10_effect_sampler_variable_AsShader,
6178     d3d10_effect_sampler_variable_AsBlend,
6179     d3d10_effect_sampler_variable_AsDepthStencil,
6180     d3d10_effect_sampler_variable_AsRasterizer,
6181     d3d10_effect_sampler_variable_AsSampler,
6182     d3d10_effect_sampler_variable_SetRawValue,
6183     d3d10_effect_sampler_variable_GetRawValue,
6184     /* ID3D10EffectSamplerVariable methods */
6185     d3d10_effect_sampler_variable_GetSampler,
6186     d3d10_effect_sampler_variable_GetBackingStore,
6187 };
6188
6189 /* ID3D10EffectType methods */
6190
6191 static BOOL STDMETHODCALLTYPE d3d10_effect_type_IsValid(ID3D10EffectType *iface)
6192 {
6193     TRACE("iface %p\n", iface);
6194
6195     return (struct d3d10_effect_type *)iface != &null_type;
6196 }
6197
6198 static HRESULT STDMETHODCALLTYPE d3d10_effect_type_GetDesc(ID3D10EffectType *iface, D3D10_EFFECT_TYPE_DESC *desc)
6199 {
6200     struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6201
6202     TRACE("iface %p, desc %p\n", iface, desc);
6203
6204     if (This == &null_type)
6205     {
6206         WARN("Null type specified\n");
6207         return E_FAIL;
6208     }
6209
6210     if (!desc)
6211     {
6212         WARN("Invalid argument specified\n");
6213         return E_INVALIDARG;
6214     }
6215
6216     desc->TypeName = This->name;
6217     desc->Class = This->type_class;
6218     desc->Type = This->basetype;
6219     desc->Elements = This->element_count;
6220     desc->Members = This->member_count;
6221     desc->Rows = This->row_count;
6222     desc->Columns = This->column_count;
6223     desc->PackedSize = This->size_packed;
6224     desc->UnpackedSize = This->size_unpacked;
6225     desc->Stride = This->stride;
6226
6227     return S_OK;
6228 }
6229
6230 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByIndex(ID3D10EffectType *iface,
6231         UINT index)
6232 {
6233     struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6234     struct d3d10_effect_type *t;
6235
6236     TRACE("iface %p, index %u\n", iface, index);
6237
6238     if (index >= This->member_count)
6239     {
6240         WARN("Invalid index specified\n");
6241         return (ID3D10EffectType *)&null_type;
6242     }
6243
6244     t = (&This->members[index])->type;
6245
6246     TRACE("Returning member %p, %s\n", t, debugstr_a(t->name));
6247
6248     return (ID3D10EffectType *)t;
6249 }
6250
6251 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByName(ID3D10EffectType *iface,
6252         LPCSTR name)
6253 {
6254     struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6255     unsigned int i;
6256
6257     TRACE("iface %p, name %s\n", iface, debugstr_a(name));
6258
6259     if (!name)
6260     {
6261         WARN("Invalid name specified\n");
6262         return (ID3D10EffectType *)&null_type;
6263     }
6264
6265     for (i = 0; i < This->member_count; ++i)
6266     {
6267         struct d3d10_effect_type_member *typem = &This->members[i];
6268
6269         if (typem->name)
6270         {
6271             if (!strcmp(typem->name, name))
6272             {
6273                 TRACE("Returning type %p.\n", typem->type);
6274                 return (ID3D10EffectType *)typem->type;
6275             }
6276         }
6277     }
6278
6279     WARN("Invalid name specified\n");
6280
6281     return (ID3D10EffectType *)&null_type;
6282 }
6283
6284 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeBySemantic(ID3D10EffectType *iface,
6285         LPCSTR semantic)
6286 {
6287     struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6288     unsigned int i;
6289
6290     TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
6291
6292     if (!semantic)
6293     {
6294         WARN("Invalid semantic specified\n");
6295         return (ID3D10EffectType *)&null_type;
6296     }
6297
6298     for (i = 0; i < This->member_count; ++i)
6299     {
6300         struct d3d10_effect_type_member *typem = &This->members[i];
6301
6302         if (typem->semantic)
6303         {
6304             if (!strcmp(typem->semantic, semantic))
6305             {
6306                 TRACE("Returning type %p.\n", typem->type);
6307                 return (ID3D10EffectType *)typem->type;
6308             }
6309         }
6310     }
6311
6312     WARN("Invalid semantic specified\n");
6313
6314     return (ID3D10EffectType *)&null_type;
6315 }
6316
6317 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberName(ID3D10EffectType *iface, UINT index)
6318 {
6319     struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6320     struct d3d10_effect_type_member *typem;
6321
6322     TRACE("iface %p, index %u\n", iface, index);
6323
6324     if (index >= This->member_count)
6325     {
6326         WARN("Invalid index specified\n");
6327         return NULL;
6328     }
6329
6330     typem = &This->members[index];
6331
6332     TRACE("Returning name %s\n", debugstr_a(typem->name));
6333
6334     return typem->name;
6335 }
6336
6337 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberSemantic(ID3D10EffectType *iface, UINT index)
6338 {
6339     struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6340     struct d3d10_effect_type_member *typem;
6341
6342     TRACE("iface %p, index %u\n", iface, index);
6343
6344     if (index >= This->member_count)
6345     {
6346         WARN("Invalid index specified\n");
6347         return NULL;
6348     }
6349
6350     typem = &This->members[index];
6351
6352     TRACE("Returning semantic %s\n", debugstr_a(typem->semantic));
6353
6354     return typem->semantic;
6355 }
6356
6357 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl =
6358 {
6359     /* ID3D10EffectType */
6360     d3d10_effect_type_IsValid,
6361     d3d10_effect_type_GetDesc,
6362     d3d10_effect_type_GetMemberTypeByIndex,
6363     d3d10_effect_type_GetMemberTypeByName,
6364     d3d10_effect_type_GetMemberTypeBySemantic,
6365     d3d10_effect_type_GetMemberName,
6366     d3d10_effect_type_GetMemberSemantic,
6367 };