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