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