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