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