mshtml: Added IHTMLObjectElement::get_vspace implementation.
[wine/multimedia.git] / dlls / d3d10 / effect.c
blobaf7f8110ab90c5f6960932e592d06874534ecd26
1 /*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
3 * Copyright 2009 Rico Schüller
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.
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.
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
21 #include "config.h"
22 #include "wine/port.h"
24 #include "d3d10_private.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
28 #define D3D10_FX10_TYPE_COLUMN_SHIFT 11
29 #define D3D10_FX10_TYPE_COLUMN_MASK (0x7 << D3D10_FX10_TYPE_COLUMN_SHIFT)
31 #define D3D10_FX10_TYPE_ROW_SHIFT 8
32 #define D3D10_FX10_TYPE_ROW_MASK (0x7 << D3D10_FX10_TYPE_ROW_SHIFT)
34 #define D3D10_FX10_TYPE_BASETYPE_SHIFT 3
35 #define D3D10_FX10_TYPE_BASETYPE_MASK (0x1f << D3D10_FX10_TYPE_BASETYPE_SHIFT)
37 #define D3D10_FX10_TYPE_CLASS_SHIFT 0
38 #define D3D10_FX10_TYPE_CLASS_MASK (0x7 << D3D10_FX10_TYPE_CLASS_SHIFT)
40 #define D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK 0x4000
42 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl;
43 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl;
44 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl;
45 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl;
46 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl;
47 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl;
48 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl;
49 static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl;
50 static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl;
51 static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl;
52 static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl;
53 static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl;
54 static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl;
55 static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl;
56 static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl;
57 static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl;
58 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl;
60 /* null objects - needed for invalid calls */
61 static struct d3d10_effect_technique null_technique = {&d3d10_effect_technique_vtbl};
62 static struct d3d10_effect_pass null_pass = {&d3d10_effect_pass_vtbl};
63 static struct d3d10_effect_type null_type = {&d3d10_effect_type_vtbl};
64 static struct d3d10_effect_variable null_local_buffer = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl,
65 &null_local_buffer, &null_type};
66 static struct d3d10_effect_variable null_variable = {&d3d10_effect_variable_vtbl,
67 &null_local_buffer, &null_type};
68 static struct d3d10_effect_variable null_scalar_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl,
69 &null_local_buffer, &null_type};
70 static struct d3d10_effect_variable null_vector_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl,
71 &null_local_buffer, &null_type};
72 static struct d3d10_effect_variable null_matrix_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl,
73 &null_local_buffer, &null_type};
74 static struct d3d10_effect_variable null_string_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl,
75 &null_local_buffer, &null_type};
76 static struct d3d10_effect_variable null_shader_resource_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl,
77 &null_local_buffer, &null_type};
78 static struct d3d10_effect_variable null_render_target_view_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl,
79 &null_local_buffer, &null_type};
80 static struct d3d10_effect_variable null_depth_stencil_view_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl,
81 &null_local_buffer, &null_type};
82 static struct d3d10_effect_variable null_shader_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl,
83 &null_local_buffer, &null_type};
84 static struct d3d10_effect_variable null_blend_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl,
85 &null_local_buffer, &null_type};
86 static struct d3d10_effect_variable null_depth_stencil_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl,
87 &null_local_buffer, &null_type};
88 static struct d3d10_effect_variable null_rasterizer_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl,
89 &null_local_buffer, &null_type};
90 static struct d3d10_effect_variable null_sampler_variable = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl,
91 &null_local_buffer, &null_type};
93 /* anonymous_shader_type and anonymous_shader */
94 static char anonymous_name[] = "$Anonymous";
95 static char anonymous_vertexshader_name[] = "vertexshader";
96 static char anonymous_pixelshader_name[] = "pixelshader";
97 static char anonymous_geometryshader_name[] = "geometryshader";
98 static struct d3d10_effect_type anonymous_vs_type = {&d3d10_effect_type_vtbl, anonymous_vertexshader_name,
99 D3D10_SVT_VERTEXSHADER, D3D10_SVC_OBJECT};
100 static struct d3d10_effect_type anonymous_ps_type = {&d3d10_effect_type_vtbl, anonymous_pixelshader_name,
101 D3D10_SVT_PIXELSHADER, D3D10_SVC_OBJECT};
102 static struct d3d10_effect_type anonymous_gs_type = {&d3d10_effect_type_vtbl, anonymous_geometryshader_name,
103 D3D10_SVT_GEOMETRYSHADER, D3D10_SVC_OBJECT};
104 static struct d3d10_effect_variable anonymous_vs = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl,
105 &null_local_buffer, &anonymous_vs_type, &null_shader_variable, anonymous_name};
106 static struct d3d10_effect_variable anonymous_ps = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl,
107 &null_local_buffer, &anonymous_ps_type, &null_shader_variable, anonymous_name};
108 static struct d3d10_effect_variable anonymous_gs = {(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl,
109 &null_local_buffer, &anonymous_gs_type, &null_shader_variable, anonymous_name};
111 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset);
113 static BOOL copy_name(const char *ptr, char **name)
115 size_t name_len;
117 if (!ptr) return TRUE;
119 name_len = strlen(ptr) + 1;
120 if (name_len == 1)
122 return TRUE;
125 *name = HeapAlloc(GetProcessHeap(), 0, name_len);
126 if (!*name)
128 ERR("Failed to allocate name memory.\n");
129 return FALSE;
132 memcpy(*name, ptr, name_len);
134 return TRUE;
137 static HRESULT shader_parse_signature(const char *data, DWORD data_size, struct d3d10_effect_shader_signature *s)
139 D3D10_SIGNATURE_PARAMETER_DESC *e;
140 const char *ptr = data;
141 unsigned int i;
142 DWORD count;
144 read_dword(&ptr, &count);
145 TRACE("%u elements\n", count);
147 skip_dword_unknown(&ptr, 1);
149 e = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*e));
150 if (!e)
152 ERR("Failed to allocate signature memory.\n");
153 return E_OUTOFMEMORY;
156 for (i = 0; i < count; ++i)
158 UINT name_offset;
159 UINT mask;
161 read_dword(&ptr, &name_offset);
162 e[i].SemanticName = data + name_offset;
163 read_dword(&ptr, &e[i].SemanticIndex);
164 read_dword(&ptr, &e[i].SystemValueType);
165 read_dword(&ptr, &e[i].ComponentType);
166 read_dword(&ptr, &e[i].Register);
167 read_dword(&ptr, &mask);
169 e[i].ReadWriteMask = mask >> 8;
170 e[i].Mask = mask & 0xff;
172 TRACE("semantic: %s, semantic idx: %u, sysval_semantic %#x, "
173 "type %u, register idx: %u, use_mask %#x, input_mask %#x\n",
174 debugstr_a(e[i].SemanticName), e[i].SemanticIndex, e[i].SystemValueType,
175 e[i].ComponentType, e[i].Register, e[i].Mask, e[i].ReadWriteMask);
178 s->elements = e;
179 s->element_count = count;
181 return S_OK;
184 static void shader_free_signature(struct d3d10_effect_shader_signature *s)
186 HeapFree(GetProcessHeap(), 0, s->signature);
187 HeapFree(GetProcessHeap(), 0, s->elements);
190 static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
192 struct d3d10_effect_shader_variable *s = ctx;
193 HRESULT hr;
195 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
197 TRACE("chunk size: %#x\n", data_size);
199 switch(tag)
201 case TAG_ISGN:
202 case TAG_OSGN:
204 /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */
205 UINT size = 44 + data_size;
206 struct d3d10_effect_shader_signature *sig;
207 char *ptr;
209 if (tag == TAG_ISGN) sig = &s->input_signature;
210 else sig = &s->output_signature;
212 sig->signature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
213 if (!sig->signature)
215 ERR("Failed to allocate input signature data\n");
216 return E_OUTOFMEMORY;
218 sig->signature_size = size;
220 ptr = sig->signature;
222 write_dword(&ptr, TAG_DXBC);
224 /* signature(?) */
225 write_dword_unknown(&ptr, 0);
226 write_dword_unknown(&ptr, 0);
227 write_dword_unknown(&ptr, 0);
228 write_dword_unknown(&ptr, 0);
230 /* seems to be always 1 */
231 write_dword_unknown(&ptr, 1);
233 /* DXBC size */
234 write_dword(&ptr, size);
236 /* chunk count */
237 write_dword(&ptr, 1);
239 /* chunk index */
240 write_dword(&ptr, (ptr - sig->signature) + 4);
242 /* chunk */
243 write_dword(&ptr, tag);
244 write_dword(&ptr, data_size);
245 memcpy(ptr, data, data_size);
247 hr = shader_parse_signature(ptr, data_size, sig);
248 if (FAILED(hr))
250 ERR("Failed to parse shader, hr %#x\n", hr);
251 shader_free_signature(sig);
254 break;
257 default:
258 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
259 break;
262 return S_OK;
265 static HRESULT parse_shader(struct d3d10_effect_variable *v, const char *data)
267 ID3D10Device *device = v->effect->device;
268 struct d3d10_effect_shader_variable *s;
269 const char *ptr = data;
270 DWORD dxbc_size;
271 HRESULT hr;
273 s = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*s));
274 if (!s)
276 ERR("Failed to allocate shader variable memory\n");
277 return E_OUTOFMEMORY;
280 v->data = s;
282 if (v->effect->used_shader_current >= v->effect->used_shader_count)
284 WARN("Invalid shader? Used shader current(%u) >= used shader count(%u)\n", v->effect->used_shader_current, v->effect->used_shader_count);
285 return E_FAIL;
288 v->effect->used_shaders[v->effect->used_shader_current] = v;
289 ++v->effect->used_shader_current;
291 if (!ptr) return S_OK;
293 read_dword(&ptr, &dxbc_size);
294 TRACE("dxbc size: %#x\n", dxbc_size);
296 /* We got a shader VertexShader vs = NULL, so it is fine to skip this. */
297 if (!dxbc_size) return S_OK;
299 switch (v->type->basetype)
301 case D3D10_SVT_VERTEXSHADER:
302 hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &s->shader.vs);
303 if (FAILED(hr)) return hr;
304 break;
306 case D3D10_SVT_PIXELSHADER:
307 hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &s->shader.ps);
308 if (FAILED(hr)) return hr;
309 break;
311 case D3D10_SVT_GEOMETRYSHADER:
312 hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &s->shader.gs);
313 if (FAILED(hr)) return hr;
314 break;
316 default:
317 ERR("This should not happen!\n");
318 return E_FAIL;
321 return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, s);
324 static D3D10_SHADER_VARIABLE_CLASS d3d10_variable_class(DWORD c, BOOL is_column_major)
326 switch (c)
328 case 1: return D3D10_SVC_SCALAR;
329 case 2: return D3D10_SVC_VECTOR;
330 case 3: if (is_column_major) return D3D10_SVC_MATRIX_COLUMNS;
331 else return D3D10_SVC_MATRIX_ROWS;
332 default:
333 FIXME("Unknown variable class %#x.\n", c);
334 return 0;
338 static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(DWORD t, BOOL is_object)
340 if(is_object)
342 switch (t)
344 case 1: return D3D10_SVT_STRING;
345 case 2: return D3D10_SVT_BLEND;
346 case 3: return D3D10_SVT_DEPTHSTENCIL;
347 case 4: return D3D10_SVT_RASTERIZER;
348 case 5: return D3D10_SVT_PIXELSHADER;
349 case 6: return D3D10_SVT_VERTEXSHADER;
350 case 7: return D3D10_SVT_GEOMETRYSHADER;
352 case 10: return D3D10_SVT_TEXTURE1D;
353 case 11: return D3D10_SVT_TEXTURE1DARRAY;
354 case 12: return D3D10_SVT_TEXTURE2D;
355 case 13: return D3D10_SVT_TEXTURE2DARRAY;
356 case 14: return D3D10_SVT_TEXTURE2DMS;
357 case 15: return D3D10_SVT_TEXTURE2DMSARRAY;
358 case 16: return D3D10_SVT_TEXTURE3D;
359 case 17: return D3D10_SVT_TEXTURECUBE;
361 case 19: return D3D10_SVT_RENDERTARGETVIEW;
362 case 20: return D3D10_SVT_DEPTHSTENCILVIEW;
363 case 21: return D3D10_SVT_SAMPLER;
364 default:
365 FIXME("Unknown variable type %#x.\n", t);
366 return 0;
369 else
371 switch (t)
373 case 1: return D3D10_SVT_FLOAT;
374 case 2: return D3D10_SVT_INT;
375 case 3: return D3D10_SVT_UINT;
376 case 4: return D3D10_SVT_BOOL;
377 default:
378 FIXME("Unknown variable type %#x.\n", t);
379 return 0;
384 static HRESULT parse_fx10_type(struct d3d10_effect_type *t, const char *ptr, const char *data)
386 DWORD unknown0;
387 DWORD offset;
388 DWORD typeinfo;
389 unsigned int i;
391 read_dword(&ptr, &offset);
392 TRACE("Type name at offset %#x.\n", offset);
394 if (!copy_name(data + offset, &t->name))
396 ERR("Failed to copy name.\n");
397 return E_OUTOFMEMORY;
399 TRACE("Type name: %s.\n", debugstr_a(t->name));
401 read_dword(&ptr, &unknown0);
402 TRACE("Unknown 0: %u.\n", unknown0);
404 read_dword(&ptr, &t->element_count);
405 TRACE("Element count: %u.\n", t->element_count);
407 read_dword(&ptr, &t->size_unpacked);
408 TRACE("Unpacked size: %#x.\n", t->size_unpacked);
410 read_dword(&ptr, &t->stride);
411 TRACE("Stride: %#x.\n", t->stride);
413 read_dword(&ptr, &t->size_packed);
414 TRACE("Packed size %#x.\n", t->size_packed);
416 switch (unknown0)
418 case 1:
419 t->member_count = 0;
421 read_dword(&ptr, &typeinfo);
422 t->column_count = (typeinfo & D3D10_FX10_TYPE_COLUMN_MASK) >> D3D10_FX10_TYPE_COLUMN_SHIFT;
423 t->row_count = (typeinfo & D3D10_FX10_TYPE_ROW_MASK) >> D3D10_FX10_TYPE_ROW_SHIFT;
424 t->basetype = d3d10_variable_type((typeinfo & D3D10_FX10_TYPE_BASETYPE_MASK) >> D3D10_FX10_TYPE_BASETYPE_SHIFT, FALSE);
425 t->type_class = d3d10_variable_class((typeinfo & D3D10_FX10_TYPE_CLASS_MASK) >> D3D10_FX10_TYPE_CLASS_SHIFT, typeinfo & D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK);
427 TRACE("Type description: %#x.\n", typeinfo);
428 TRACE("\tcolumns: %u.\n", t->column_count);
429 TRACE("\trows: %u.\n", t->row_count);
430 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
431 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
432 TRACE("\tunknown bits: %#x.\n", typeinfo & ~(D3D10_FX10_TYPE_COLUMN_MASK | D3D10_FX10_TYPE_ROW_MASK
433 | D3D10_FX10_TYPE_BASETYPE_MASK | D3D10_FX10_TYPE_CLASS_MASK | D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK));
434 break;
436 case 2:
437 TRACE("Type is an object.\n");
439 t->member_count = 0;
440 t->column_count = 0;
441 t->row_count = 0;
442 t->type_class = D3D10_SVC_OBJECT;
444 read_dword(&ptr, &typeinfo);
445 t->basetype = d3d10_variable_type(typeinfo, TRUE);
447 TRACE("Type description: %#x.\n", typeinfo);
448 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
449 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
450 break;
452 case 3:
453 TRACE("Type is a structure.\n");
455 read_dword(&ptr, &t->member_count);
456 TRACE("Member count: %u.\n", t->member_count);
458 t->column_count = 0;
459 t->row_count = 0;
460 t->basetype = 0;
461 t->type_class = D3D10_SVC_STRUCT;
463 t->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->member_count * sizeof(*t->members));
464 if (!t->members)
466 ERR("Failed to allocate members memory.\n");
467 return E_OUTOFMEMORY;
470 for (i = 0; i < t->member_count; ++i)
472 struct d3d10_effect_type_member *typem = &t->members[i];
474 read_dword(&ptr, &offset);
475 TRACE("Member name at offset %#x.\n", offset);
477 if (!copy_name(data + offset, &typem->name))
479 ERR("Failed to copy name.\n");
480 return E_OUTOFMEMORY;
482 TRACE("Member name: %s.\n", debugstr_a(typem->name));
484 read_dword(&ptr, &offset);
485 TRACE("Member semantic at offset %#x.\n", offset);
487 if (!copy_name(data + offset, &typem->semantic))
489 ERR("Failed to copy semantic.\n");
490 return E_OUTOFMEMORY;
492 TRACE("Member semantic: %s.\n", debugstr_a(typem->semantic));
494 read_dword(&ptr, &typem->buffer_offset);
495 TRACE("Member offset in struct: %#x.\n", typem->buffer_offset);
497 read_dword(&ptr, &offset);
498 TRACE("Member type info at offset %#x.\n", offset);
500 typem->type = get_fx10_type(t->effect, data, offset);
501 if (!typem->type)
503 ERR("Failed to get variable type.\n");
504 return E_FAIL;
507 break;
509 default:
510 FIXME("Unhandled case %#x.\n", unknown0);
511 return E_FAIL;
514 if (t->element_count)
516 TRACE("Elementtype for type at offset: %#x\n", t->id);
518 /* allocate elementtype - we need only one, because all elements have the same type */
519 t->elementtype = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*t->elementtype));
520 if (!t->elementtype)
522 ERR("Failed to allocate members memory.\n");
523 return E_OUTOFMEMORY;
526 /* create a copy of the original type with some minor changes */
527 t->elementtype->vtbl = &d3d10_effect_type_vtbl;
528 t->elementtype->effect = t->effect;
530 if (!copy_name(t->name, &t->elementtype->name))
532 ERR("Failed to copy name.\n");
533 return E_OUTOFMEMORY;
535 TRACE("\tType name: %s.\n", debugstr_a(t->elementtype->name));
537 t->elementtype->element_count = 0;
538 TRACE("\tElement count: %u.\n", t->elementtype->element_count);
541 * Not sure if this calculation is 100% correct, but a test
542 * show's that these values work.
544 t->elementtype->size_unpacked = t->size_packed / t->element_count;
545 TRACE("\tUnpacked size: %#x.\n", t->elementtype->size_unpacked);
547 t->elementtype->stride = t->stride;
548 TRACE("\tStride: %#x.\n", t->elementtype->stride);
550 t->elementtype->size_packed = t->size_packed / t->element_count;
551 TRACE("\tPacked size: %#x.\n", t->elementtype->size_packed);
553 t->elementtype->member_count = t->member_count;
554 TRACE("\tMember count: %u.\n", t->elementtype->member_count);
556 t->elementtype->column_count = t->column_count;
557 TRACE("\tColumns: %u.\n", t->elementtype->column_count);
559 t->elementtype->row_count = t->row_count;
560 TRACE("\tRows: %u.\n", t->elementtype->row_count);
562 t->elementtype->basetype = t->basetype;
563 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(t->elementtype->basetype));
565 t->elementtype->type_class = t->type_class;
566 TRACE("\tClass: %s.\n", debug_d3d10_shader_variable_class(t->elementtype->type_class));
568 t->elementtype->members = t->members;
571 return S_OK;
574 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset)
576 struct d3d10_effect_type *type;
577 struct wine_rb_entry *entry;
578 HRESULT hr;
580 entry = wine_rb_get(&effect->types, &offset);
581 if (entry)
583 TRACE("Returning existing type.\n");
584 return WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
587 type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*type));
588 if (!type)
590 ERR("Failed to allocate type memory.\n");
591 return NULL;
594 type->vtbl = &d3d10_effect_type_vtbl;
595 type->id = offset;
596 type->effect = effect;
597 hr = parse_fx10_type(type, data + offset, data);
598 if (FAILED(hr))
600 ERR("Failed to parse type info, hr %#x.\n", hr);
601 HeapFree(GetProcessHeap(), 0, type);
602 return NULL;
605 if (wine_rb_put(&effect->types, &offset, &type->entry) == -1)
607 ERR("Failed to insert type entry.\n");
608 HeapFree(GetProcessHeap(), 0, type);
609 return NULL;
612 return type;
615 static void set_variable_vtbl(struct d3d10_effect_variable *v)
617 switch (v->type->type_class)
619 case D3D10_SVC_SCALAR:
620 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl;
621 break;
623 case D3D10_SVC_VECTOR:
624 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl;
625 break;
627 case D3D10_SVC_MATRIX_ROWS:
628 case D3D10_SVC_MATRIX_COLUMNS:
629 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl;
630 break;
632 case D3D10_SVC_STRUCT:
633 v->vtbl = &d3d10_effect_variable_vtbl;
634 break;
636 case D3D10_SVC_OBJECT:
637 switch(v->type->basetype)
639 case D3D10_SVT_STRING:
640 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl;
641 break;
643 case D3D10_SVT_TEXTURE1D:
644 case D3D10_SVT_TEXTURE1DARRAY:
645 case D3D10_SVT_TEXTURE2D:
646 case D3D10_SVT_TEXTURE2DARRAY:
647 case D3D10_SVT_TEXTURE2DMS:
648 case D3D10_SVT_TEXTURE2DMSARRAY:
649 case D3D10_SVT_TEXTURE3D:
650 case D3D10_SVT_TEXTURECUBE:
651 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl;
652 break;
654 case D3D10_SVT_RENDERTARGETVIEW:
655 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl;
656 break;
658 case D3D10_SVT_DEPTHSTENCILVIEW:
659 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl;
660 break;
662 case D3D10_SVT_DEPTHSTENCIL:
663 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl;
664 break;
666 case D3D10_SVT_VERTEXSHADER:
667 case D3D10_SVT_GEOMETRYSHADER:
668 case D3D10_SVT_PIXELSHADER:
669 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl;
670 break;
672 case D3D10_SVT_BLEND:
673 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl;
674 break;
676 case D3D10_SVT_RASTERIZER:
677 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl;
678 break;
680 case D3D10_SVT_SAMPLER:
681 v->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl;
682 break;
684 default:
685 FIXME("Unhandled basetype %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
686 v->vtbl = &d3d10_effect_variable_vtbl;
687 break;
689 break;
691 default:
692 FIXME("Unhandled type class %s.\n", debug_d3d10_shader_variable_class(v->type->type_class));
693 v->vtbl = &d3d10_effect_variable_vtbl;
694 break;
698 static HRESULT copy_variableinfo_from_type(struct d3d10_effect_variable *v)
700 unsigned int i;
701 HRESULT hr;
703 if (v->type->member_count)
705 v->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->member_count * sizeof(*v->members));
706 if (!v->members)
708 ERR("Failed to allocate members memory.\n");
709 return E_OUTOFMEMORY;
712 for (i = 0; i < v->type->member_count; ++i)
714 struct d3d10_effect_variable *var = &v->members[i];
715 struct d3d10_effect_type_member *typem = &v->type->members[i];
717 var->buffer = v->buffer;
718 var->effect = v->effect;
719 var->type = typem->type;
720 set_variable_vtbl(var);
722 if (!copy_name(typem->name, &var->name))
724 ERR("Failed to copy name.\n");
725 return E_OUTOFMEMORY;
727 TRACE("Variable name: %s.\n", debugstr_a(var->name));
729 if (!copy_name(typem->semantic, &var->semantic))
731 ERR("Failed to copy name.\n");
732 return E_OUTOFMEMORY;
734 TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
736 var->buffer_offset = v->buffer_offset + typem->buffer_offset;
737 TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
739 hr = copy_variableinfo_from_type(var);
740 if (FAILED(hr)) return hr;
744 if (v->type->element_count)
746 unsigned int bufferoffset = v->buffer_offset;
748 v->elements = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->element_count * sizeof(*v->elements));
749 if (!v->elements)
751 ERR("Failed to allocate elements memory.\n");
752 return E_OUTOFMEMORY;
755 for (i = 0; i < v->type->element_count; ++i)
757 struct d3d10_effect_variable *var = &v->elements[i];
759 var->buffer = v->buffer;
760 var->effect = v->effect;
761 var->type = v->type->elementtype;
762 set_variable_vtbl(var);
764 if (!copy_name(v->name, &var->name))
766 ERR("Failed to copy name.\n");
767 return E_OUTOFMEMORY;
769 TRACE("Variable name: %s.\n", debugstr_a(var->name));
771 if (!copy_name(v->semantic, &var->semantic))
773 ERR("Failed to copy name.\n");
774 return E_OUTOFMEMORY;
776 TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
778 if (i != 0)
780 bufferoffset += v->type->stride;
782 var->buffer_offset = bufferoffset;
783 TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
785 hr = copy_variableinfo_from_type(var);
786 if (FAILED(hr)) return hr;
790 return S_OK;
793 static HRESULT parse_fx10_variable_head(struct d3d10_effect_variable *v, const char **ptr, const char *data)
795 DWORD offset;
797 read_dword(ptr, &offset);
798 TRACE("Variable name at offset %#x.\n", offset);
800 if (!copy_name(data + offset, &v->name))
802 ERR("Failed to copy name.\n");
803 return E_OUTOFMEMORY;
805 TRACE("Variable name: %s.\n", debugstr_a(v->name));
807 read_dword(ptr, &offset);
808 TRACE("Variable type info at offset %#x.\n", offset);
810 v->type = get_fx10_type(v->effect, data, offset);
811 if (!v->type)
813 ERR("Failed to get variable type.\n");
814 return E_FAIL;
816 set_variable_vtbl(v);
818 return copy_variableinfo_from_type(v);
821 static HRESULT parse_fx10_annotation(struct d3d10_effect_variable *a, const char **ptr, const char *data)
823 HRESULT hr;
825 hr = parse_fx10_variable_head(a, ptr, data);
826 if (FAILED(hr)) return hr;
828 skip_dword_unknown(ptr, 1);
830 /* mark the variable as annotation */
831 a->flag = D3D10_EFFECT_VARIABLE_ANNOTATION;
833 return S_OK;
836 static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, struct d3d10_effect_anonymous_shader *s,
837 enum d3d10_effect_object_type otype)
839 struct d3d10_effect_variable *v = &s->shader;
840 struct d3d10_effect_type *t = &s->type;
841 const char *shader = NULL;
843 switch (otype)
845 case D3D10_EOT_VERTEXSHADER:
846 shader = "vertexshader";
847 t->basetype = D3D10_SVT_VERTEXSHADER;
848 break;
850 case D3D10_EOT_PIXELSHADER:
851 shader = "pixelshader";
852 t->basetype = D3D10_SVT_PIXELSHADER;
853 break;
855 case D3D10_EOT_GEOMETRYSHADER:
856 shader = "geometryshader";
857 t->basetype = D3D10_SVT_GEOMETRYSHADER;
858 break;
861 if (!copy_name(shader, &t->name))
863 ERR("Failed to copy name.\n");
864 return E_OUTOFMEMORY;
866 TRACE("Type name: %s.\n", debugstr_a(t->name));
868 t->type_class = D3D10_SVC_OBJECT;
870 t->vtbl = &d3d10_effect_type_vtbl;
872 v->type = t;
873 v->effect = e;
874 set_variable_vtbl(v);
876 if (!copy_name("$Anonymous", &v->name))
878 ERR("Failed to copy semantic.\n");
879 return E_OUTOFMEMORY;
881 TRACE("Variable name: %s.\n", debugstr_a(v->name));
883 if (!copy_name(NULL, &v->semantic))
885 ERR("Failed to copy semantic.\n");
886 return E_OUTOFMEMORY;
888 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
890 return S_OK;
893 static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr, const char *data)
895 const char *data_ptr = NULL;
896 DWORD offset;
897 enum d3d10_effect_object_operation operation;
898 HRESULT hr;
899 struct d3d10_effect *effect = o->pass->technique->effect;
900 ID3D10Effect *e = (ID3D10Effect *)effect;
902 read_dword(ptr, &o->type);
903 TRACE("Effect object is of type %#x.\n", o->type);
905 read_dword(ptr, &o->index);
906 TRACE("Effect object index %#x.\n", o->index);
908 read_dword(ptr, &operation);
909 TRACE("Effect object operation %#x.\n", operation);
911 read_dword(ptr, &offset);
912 TRACE("Effect object idx is at offset %#x.\n", offset);
914 switch(operation)
916 case D3D10_EOO_VALUE:
917 TRACE("Copy variable values\n");
918 hr = E_FAIL;
920 switch (o->type)
922 case D3D10_EOT_VERTEXSHADER:
923 TRACE("Vertex shader\n");
924 o->data = &anonymous_vs;
925 hr = S_OK;
926 break;
928 case D3D10_EOT_PIXELSHADER:
929 TRACE("Pixel shader\n");
930 o->data = &anonymous_ps;
931 hr = S_OK;
932 break;
934 case D3D10_EOT_GEOMETRYSHADER:
935 TRACE("Geometry shader\n");
936 o->data = &anonymous_gs;
937 hr = S_OK;
938 break;
940 default:
941 FIXME("Unhandled object type %#x\n", o->type);
942 hr = E_FAIL;
943 break;
945 break;
947 case D3D10_EOO_PARSED_OBJECT:
948 /* This is a local object, we've parsed in parse_fx10_local_object. */
949 TRACE("Shader = %s.\n", data + offset);
951 o->data = e->lpVtbl->GetVariableByName(e, data + offset);
952 hr = S_OK;
953 break;
955 case D3D10_EOO_PARSED_OBJECT_INDEX:
956 /* This is a local object, we've parsed in parse_fx10_local_object, which has an array index. */
957 data_ptr = data + offset;
958 read_dword(&data_ptr, &offset);
959 read_dword(&data_ptr, &o->index);
960 TRACE("Shader = %s[%u].\n", data + offset, o->index);
962 o->data = e->lpVtbl->GetVariableByName(e, data + offset);
963 hr = S_OK;
964 break;
966 case D3D10_EOO_ANONYMOUS_SHADER:
967 TRACE("Anonymous shader\n");
969 /* check anonymous_shader_current for validity */
970 if (effect->anonymous_shader_current >= effect->anonymous_shader_count)
972 ERR("Anonymous shader count is wrong!\n");
973 return E_FAIL;
976 data_ptr = data + offset;
977 read_dword(&data_ptr, &offset);
978 TRACE("Effect object starts at offset %#x.\n", offset);
980 data_ptr = data + offset;
982 hr = parse_fx10_anonymous_shader(effect, &effect->anonymous_shaders[effect->anonymous_shader_current], o->type);
983 if (FAILED(hr)) return hr;
985 o->data = &effect->anonymous_shaders[effect->anonymous_shader_current].shader;
986 ++effect->anonymous_shader_current;
988 switch (o->type)
990 case D3D10_EOT_VERTEXSHADER:
991 TRACE("Vertex shader\n");
992 hr = parse_shader(o->data, data_ptr);
993 break;
995 case D3D10_EOT_PIXELSHADER:
996 TRACE("Pixel shader\n");
997 hr = parse_shader(o->data, data_ptr);
998 break;
1000 case D3D10_EOT_GEOMETRYSHADER:
1001 TRACE("Geometry shader\n");
1002 hr = parse_shader(o->data, data_ptr);
1003 break;
1005 default:
1006 FIXME("Unhandled object type %#x\n", o->type);
1007 hr = E_FAIL;
1008 break;
1010 break;
1012 default:
1013 hr = E_FAIL;
1014 FIXME("Unhandled operation %#x.\n", operation);
1015 break;
1018 return hr;
1021 static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, const char *data)
1023 HRESULT hr = S_OK;
1024 unsigned int i;
1025 DWORD offset;
1027 read_dword(ptr, &offset);
1028 TRACE("Pass name at offset %#x.\n", offset);
1030 if (!copy_name(data + offset, &p->name))
1032 ERR("Failed to copy name.\n");
1033 return E_OUTOFMEMORY;
1035 TRACE("Pass name: %s.\n", debugstr_a(p->name));
1037 read_dword(ptr, &p->object_count);
1038 TRACE("Pass has %u effect objects.\n", p->object_count);
1040 read_dword(ptr, &p->annotation_count);
1041 TRACE("Pass has %u annotations.\n", p->annotation_count);
1043 p->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->annotation_count * sizeof(*p->annotations));
1044 if (!p->annotations)
1046 ERR("Failed to allocate pass annotations memory.\n");
1047 return E_OUTOFMEMORY;
1050 for (i = 0; i < p->annotation_count; ++i)
1052 struct d3d10_effect_variable *a = &p->annotations[i];
1054 a->effect = p->technique->effect;
1055 a->buffer = &null_local_buffer;
1057 hr = parse_fx10_annotation(a, ptr, data);
1058 if (FAILED(hr)) return hr;
1061 p->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->object_count * sizeof(*p->objects));
1062 if (!p->objects)
1064 ERR("Failed to allocate effect objects memory.\n");
1065 return E_OUTOFMEMORY;
1068 for (i = 0; i < p->object_count; ++i)
1070 struct d3d10_effect_object *o = &p->objects[i];
1072 o->pass = p;
1074 hr = parse_fx10_object(o, ptr, data);
1075 if (FAILED(hr)) return hr;
1078 return hr;
1081 static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char **ptr, const char *data)
1083 unsigned int i;
1084 DWORD offset;
1085 HRESULT hr;
1087 read_dword(ptr, &offset);
1088 TRACE("Technique name at offset %#x.\n", offset);
1090 if (!copy_name(data + offset, &t->name))
1092 ERR("Failed to copy name.\n");
1093 return E_OUTOFMEMORY;
1095 TRACE("Technique name: %s.\n", debugstr_a(t->name));
1097 read_dword(ptr, &t->pass_count);
1098 TRACE("Technique has %u passes\n", t->pass_count);
1100 read_dword(ptr, &t->annotation_count);
1101 TRACE("Technique has %u annotations.\n", t->annotation_count);
1103 t->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->annotation_count * sizeof(*t->annotations));
1104 if (!t->annotations)
1106 ERR("Failed to allocate technique annotations memory.\n");
1107 return E_OUTOFMEMORY;
1110 for (i = 0; i < t->annotation_count; ++i)
1112 struct d3d10_effect_variable *a = &t->annotations[i];
1114 a->effect = t->effect;
1115 a->buffer = &null_local_buffer;
1117 hr = parse_fx10_annotation(a, ptr, data);
1118 if (FAILED(hr)) return hr;
1121 t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes));
1122 if (!t->passes)
1124 ERR("Failed to allocate passes memory\n");
1125 return E_OUTOFMEMORY;
1128 for (i = 0; i < t->pass_count; ++i)
1130 struct d3d10_effect_pass *p = &t->passes[i];
1132 p->vtbl = &d3d10_effect_pass_vtbl;
1133 p->technique = t;
1135 hr = parse_fx10_pass(p, ptr, data);
1136 if (FAILED(hr)) return hr;
1139 return S_OK;
1142 static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
1144 DWORD offset;
1145 unsigned int i;
1146 HRESULT hr;
1148 hr = parse_fx10_variable_head(v, ptr, data);
1149 if (FAILED(hr)) return hr;
1151 read_dword(ptr, &offset);
1152 TRACE("Variable semantic at offset %#x.\n", offset);
1154 if (!copy_name(data + offset, &v->semantic))
1156 ERR("Failed to copy semantic.\n");
1157 return E_OUTOFMEMORY;
1159 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
1161 read_dword(ptr, &v->buffer_offset);
1162 TRACE("Variable offset in buffer: %#x.\n", v->buffer_offset);
1164 skip_dword_unknown(ptr, 1);
1166 read_dword(ptr, &v->flag);
1167 TRACE("Variable flag: %#x.\n", v->flag);
1169 read_dword(ptr, &v->annotation_count);
1170 TRACE("Variable has %u annotations.\n", v->annotation_count);
1172 v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
1173 if (!v->annotations)
1175 ERR("Failed to allocate variable annotations memory.\n");
1176 return E_OUTOFMEMORY;
1179 for (i = 0; i < v->annotation_count; ++i)
1181 struct d3d10_effect_variable *a = &v->annotations[i];
1183 a->effect = v->effect;
1184 a->buffer = &null_local_buffer;
1186 hr = parse_fx10_annotation(a, ptr, data);
1187 if (FAILED(hr)) return hr;
1190 return S_OK;
1193 static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
1195 unsigned int i;
1196 HRESULT hr;
1197 DWORD offset;
1199 hr = parse_fx10_variable_head(v, ptr, data);
1200 if (FAILED(hr)) return hr;
1202 read_dword(ptr, &offset);
1203 TRACE("Variable semantic at offset %#x.\n", offset);
1205 if (!copy_name(data + offset, &v->semantic))
1207 ERR("Failed to copy semantic.\n");
1208 return E_OUTOFMEMORY;
1210 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
1212 skip_dword_unknown(ptr, 1);
1214 switch (v->type->basetype)
1216 case D3D10_SVT_TEXTURE1D:
1217 case D3D10_SVT_TEXTURE1DARRAY:
1218 case D3D10_SVT_TEXTURE2D:
1219 case D3D10_SVT_TEXTURE2DARRAY:
1220 case D3D10_SVT_TEXTURE2DMS:
1221 case D3D10_SVT_TEXTURE2DMSARRAY:
1222 case D3D10_SVT_TEXTURE3D:
1223 case D3D10_SVT_TEXTURECUBE:
1224 case D3D10_SVT_RENDERTARGETVIEW:
1225 case D3D10_SVT_DEPTHSTENCILVIEW:
1226 TRACE("SVT could not have elements.\n");
1227 break;
1229 case D3D10_SVT_VERTEXSHADER:
1230 case D3D10_SVT_PIXELSHADER:
1231 case D3D10_SVT_GEOMETRYSHADER:
1232 TRACE("Shader type is %s\n", debug_d3d10_shader_variable_type(v->type->basetype));
1233 for (i = 0; i < max(v->type->element_count, 1); ++i)
1235 DWORD shader_offset;
1236 struct d3d10_effect_variable *var;
1238 if (!v->type->element_count)
1240 var = v;
1242 else
1244 var = &v->elements[i];
1247 read_dword(ptr, &shader_offset);
1248 TRACE("Shader offset: %#x.\n", shader_offset);
1250 hr = parse_shader(var, data + shader_offset);
1251 if (FAILED(hr)) return hr;
1253 break;
1255 case D3D10_SVT_DEPTHSTENCIL:
1256 case D3D10_SVT_BLEND:
1257 case D3D10_SVT_RASTERIZER:
1258 case D3D10_SVT_SAMPLER:
1259 TRACE("SVT is a state.\n");
1260 for (i = 0; i < max(v->type->element_count, 1); ++i)
1262 unsigned int j;
1263 DWORD object_count;
1265 read_dword(ptr, &object_count);
1266 TRACE("Object count: %#x.\n", object_count);
1268 for (j = 0; j < object_count; ++j)
1270 skip_dword_unknown(ptr, 4);
1273 break;
1275 default:
1276 FIXME("Unhandled case %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
1277 return E_FAIL;
1280 read_dword(ptr, &v->annotation_count);
1281 TRACE("Variable has %u annotations.\n", v->annotation_count);
1283 v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
1284 if (!v->annotations)
1286 ERR("Failed to allocate variable annotations memory.\n");
1287 return E_OUTOFMEMORY;
1290 for (i = 0; i < v->annotation_count; ++i)
1292 struct d3d10_effect_variable *a = &v->annotations[i];
1294 a->effect = v->effect;
1295 a->buffer = &null_local_buffer;
1297 hr = parse_fx10_annotation(a, ptr, data);
1298 if (FAILED(hr)) return hr;
1301 return S_OK;
1304 static HRESULT parse_fx10_local_buffer(struct d3d10_effect_variable *l, const char **ptr, const char *data)
1306 unsigned int i;
1307 DWORD offset;
1308 D3D10_CBUFFER_TYPE d3d10_cbuffer_type;
1309 HRESULT hr;
1310 unsigned int stride = 0;
1312 /* Generate our own type, it isn't in the fx blob. */
1313 l->type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*l->type));
1314 if (!l->type)
1316 ERR("Failed to allocate local buffer type memory.\n");
1317 return E_OUTOFMEMORY;
1319 l->type->vtbl = &d3d10_effect_type_vtbl;
1320 l->type->type_class = D3D10_SVC_OBJECT;
1321 l->type->effect = l->effect;
1323 read_dword(ptr, &offset);
1324 TRACE("Local buffer name at offset %#x.\n", offset);
1326 if (!copy_name(data + offset, &l->name))
1328 ERR("Failed to copy name.\n");
1329 return E_OUTOFMEMORY;
1331 TRACE("Local buffer name: %s.\n", debugstr_a(l->name));
1333 read_dword(ptr, &l->data_size);
1334 TRACE("Local buffer data size: %#x.\n", l->data_size);
1336 read_dword(ptr, &d3d10_cbuffer_type);
1337 TRACE("Local buffer type: %#x.\n", d3d10_cbuffer_type);
1339 switch(d3d10_cbuffer_type)
1341 case D3D10_CT_CBUFFER:
1342 l->type->basetype = D3D10_SVT_CBUFFER;
1343 if (!copy_name("cbuffer", &l->type->name))
1345 ERR("Failed to copy name.\n");
1346 return E_OUTOFMEMORY;
1348 break;
1350 case D3D10_CT_TBUFFER:
1351 l->type->basetype = D3D10_SVT_TBUFFER;
1352 if (!copy_name("tbuffer", &l->type->name))
1354 ERR("Failed to copy name.\n");
1355 return E_OUTOFMEMORY;
1357 break;
1359 default:
1360 ERR("Unexpected D3D10_CBUFFER_TYPE %#x!\n", d3d10_cbuffer_type);
1361 return E_FAIL;
1364 read_dword(ptr, &l->type->member_count);
1365 TRACE("Local buffer member count: %#x.\n", l->type->member_count);
1367 skip_dword_unknown(ptr, 1);
1369 read_dword(ptr, &l->annotation_count);
1370 TRACE("Local buffer has %u annotations.\n", l->annotation_count);
1372 l->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->annotation_count * sizeof(*l->annotations));
1373 if (!l->annotations)
1375 ERR("Failed to allocate local buffer annotations memory.\n");
1376 return E_OUTOFMEMORY;
1379 for (i = 0; i < l->annotation_count; ++i)
1381 struct d3d10_effect_variable *a = &l->annotations[i];
1383 a->effect = l->effect;
1384 a->buffer = &null_local_buffer;
1386 hr = parse_fx10_annotation(a, ptr, data);
1387 if (FAILED(hr)) return hr;
1390 l->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->members));
1391 if (!l->members)
1393 ERR("Failed to allocate members memory.\n");
1394 return E_OUTOFMEMORY;
1397 l->type->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->type->members));
1398 if (!l->type->members)
1400 ERR("Failed to allocate type members memory.\n");
1401 return E_OUTOFMEMORY;
1404 for (i = 0; i < l->type->member_count; ++i)
1406 struct d3d10_effect_variable *v = &l->members[i];
1407 struct d3d10_effect_type_member *typem = &l->type->members[i];
1409 v->buffer = l;
1410 v->effect = l->effect;
1412 hr = parse_fx10_variable(v, ptr, data);
1413 if (FAILED(hr)) return hr;
1416 * Copy the values from the variable type to the constant buffers type
1417 * members structure, because it is our own generated type.
1419 typem->type = v->type;
1421 if (!copy_name(v->name, &typem->name))
1423 ERR("Failed to copy name.\n");
1424 return E_OUTOFMEMORY;
1426 TRACE("Variable name: %s.\n", debugstr_a(typem->name));
1428 if (!copy_name(v->semantic, &typem->semantic))
1430 ERR("Failed to copy name.\n");
1431 return E_OUTOFMEMORY;
1433 TRACE("Variable semantic: %s.\n", debugstr_a(typem->semantic));
1435 typem->buffer_offset = v->buffer_offset;
1436 TRACE("Variable buffer offset: %u.\n", typem->buffer_offset);
1438 l->type->size_packed += v->type->size_packed;
1441 * For the complete constantbuffer the size_unpacked = stride,
1442 * the stride is calculated like this:
1444 * 1) if the constant buffer variables are packed with packoffset
1445 * - stride = the highest used constant
1446 * - the complete stride has to be a multiple of 0x10
1448 * 2) if the constant buffer variables are NOT packed with packoffset
1449 * - sum of unpacked size for all variables which fit in a 0x10 part
1450 * - if the size exceeds a 0x10 part, the rest of the old part is skipped
1451 * and a new part is started
1452 * - if the variable is a struct it is always used a new part
1453 * - the complete stride has to be a multiple of 0x10
1455 * e.g.:
1456 * 0x4, 0x4, 0x4, 0x8, 0x4, 0x14, 0x4
1457 * part 0x10 0x10 0x20 -> 0x40
1459 if (v->flag & D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT)
1461 if ((v->type->size_unpacked + v->buffer_offset) > stride)
1463 stride = v->type->size_unpacked + v->buffer_offset;
1466 else
1468 if (v->type->type_class == D3D10_SVC_STRUCT)
1470 stride = (stride + 0xf) & ~0xf;
1473 if ( ((stride & 0xf) + v->type->size_unpacked) > 0x10)
1475 stride = (stride + 0xf) & ~0xf;
1478 stride += v->type->size_unpacked;
1481 l->type->stride = l->type->size_unpacked = (stride + 0xf) & ~0xf;
1483 TRACE("Constant buffer:\n");
1484 TRACE("\tType name: %s.\n", debugstr_a(l->type->name));
1485 TRACE("\tElement count: %u.\n", l->type->element_count);
1486 TRACE("\tMember count: %u.\n", l->type->member_count);
1487 TRACE("\tUnpacked size: %#x.\n", l->type->size_unpacked);
1488 TRACE("\tStride: %#x.\n", l->type->stride);
1489 TRACE("\tPacked size %#x.\n", l->type->size_packed);
1490 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l->type->basetype));
1491 TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l->type->type_class));
1493 return S_OK;
1496 static int d3d10_effect_type_compare(const void *key, const struct wine_rb_entry *entry)
1498 const struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, const struct d3d10_effect_type, entry);
1499 const DWORD *id = key;
1501 return *id - t->id;
1504 static void d3d10_effect_type_member_destroy(struct d3d10_effect_type_member *typem)
1506 TRACE("effect type member %p.\n", typem);
1508 /* Do not release typem->type, it will be covered by d3d10_effect_type_destroy(). */
1509 HeapFree(GetProcessHeap(), 0, typem->semantic);
1510 HeapFree(GetProcessHeap(), 0, typem->name);
1513 static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context)
1515 struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
1517 TRACE("effect type %p.\n", t);
1519 if (t->elementtype)
1521 HeapFree(GetProcessHeap(), 0, t->elementtype->name);
1522 HeapFree(GetProcessHeap(), 0, t->elementtype);
1525 if (t->members)
1527 unsigned int i;
1529 for (i = 0; i < t->member_count; ++i)
1531 d3d10_effect_type_member_destroy(&t->members[i]);
1533 HeapFree(GetProcessHeap(), 0, t->members);
1536 HeapFree(GetProcessHeap(), 0, t->name);
1537 HeapFree(GetProcessHeap(), 0, t);
1540 static const struct wine_rb_functions d3d10_effect_type_rb_functions =
1542 d3d10_rb_alloc,
1543 d3d10_rb_realloc,
1544 d3d10_rb_free,
1545 d3d10_effect_type_compare,
1548 static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size)
1550 const char *ptr = data + e->index_offset;
1551 unsigned int i;
1552 HRESULT hr;
1554 if (wine_rb_init(&e->types, &d3d10_effect_type_rb_functions) == -1)
1556 ERR("Failed to initialize type rbtree.\n");
1557 return E_FAIL;
1560 e->local_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_buffer_count * sizeof(*e->local_buffers));
1561 if (!e->local_buffers)
1563 ERR("Failed to allocate local buffer memory.\n");
1564 return E_OUTOFMEMORY;
1567 e->local_variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_variable_count * sizeof(*e->local_variables));
1568 if (!e->local_variables)
1570 ERR("Failed to allocate local variable memory.\n");
1571 return E_OUTOFMEMORY;
1574 e->anonymous_shaders = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->anonymous_shader_count * sizeof(*e->anonymous_shaders));
1575 if (!e->anonymous_shaders)
1577 ERR("Failed to allocate anonymous shaders memory\n");
1578 return E_OUTOFMEMORY;
1581 e->used_shaders = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->used_shader_count * sizeof(*e->used_shaders));
1582 if (!e->used_shaders)
1584 ERR("Failed to allocate used shaders memory\n");
1585 return E_OUTOFMEMORY;
1588 e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques));
1589 if (!e->techniques)
1591 ERR("Failed to allocate techniques memory\n");
1592 return E_OUTOFMEMORY;
1595 for (i = 0; i < e->local_buffer_count; ++i)
1597 struct d3d10_effect_variable *l = &e->local_buffers[i];
1598 l->vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl;
1599 l->effect = e;
1600 l->buffer = &null_local_buffer;
1602 hr = parse_fx10_local_buffer(l, &ptr, data);
1603 if (FAILED(hr)) return hr;
1606 for (i = 0; i < e->local_variable_count; ++i)
1608 struct d3d10_effect_variable *v = &e->local_variables[i];
1610 v->effect = e;
1611 v->vtbl = &d3d10_effect_variable_vtbl;
1612 v->buffer = &null_local_buffer;
1614 hr = parse_fx10_local_variable(v, &ptr, data);
1615 if (FAILED(hr)) return hr;
1618 for (i = 0; i < e->technique_count; ++i)
1620 struct d3d10_effect_technique *t = &e->techniques[i];
1622 t->vtbl = &d3d10_effect_technique_vtbl;
1623 t->effect = e;
1625 hr = parse_fx10_technique(t, &ptr, data);
1626 if (FAILED(hr)) return hr;
1629 return S_OK;
1632 static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_size)
1634 const char *ptr = data;
1635 DWORD unknown;
1637 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
1638 read_dword(&ptr, &e->version);
1639 TRACE("Target: %#x\n", e->version);
1641 read_dword(&ptr, &e->local_buffer_count);
1642 TRACE("Local buffer count: %u.\n", e->local_buffer_count);
1644 read_dword(&ptr, &e->variable_count);
1645 TRACE("Variable count: %u\n", e->variable_count);
1647 read_dword(&ptr, &e->local_variable_count);
1648 TRACE("Object count: %u\n", e->local_variable_count);
1650 read_dword(&ptr, &e->sharedbuffers_count);
1651 TRACE("Sharedbuffers count: %u\n", e->sharedbuffers_count);
1653 /* Number of variables in shared buffers? */
1654 read_dword(&ptr, &unknown);
1655 FIXME("Unknown 0: %u\n", unknown);
1657 read_dword(&ptr, &e->sharedobjects_count);
1658 TRACE("Sharedobjects count: %u\n", e->sharedobjects_count);
1660 read_dword(&ptr, &e->technique_count);
1661 TRACE("Technique count: %u\n", e->technique_count);
1663 read_dword(&ptr, &e->index_offset);
1664 TRACE("Index offset: %#x\n", e->index_offset);
1666 read_dword(&ptr, &unknown);
1667 FIXME("Unknown 1: %u\n", unknown);
1669 read_dword(&ptr, &e->texture_count);
1670 TRACE("Texture count: %u\n", e->texture_count);
1672 read_dword(&ptr, &e->dephstencilstate_count);
1673 TRACE("Depthstencilstate count: %u\n", e->dephstencilstate_count);
1675 read_dword(&ptr, &e->blendstate_count);
1676 TRACE("Blendstate count: %u\n", e->blendstate_count);
1678 read_dword(&ptr, &e->rasterizerstate_count);
1679 TRACE("Rasterizerstate count: %u\n", e->rasterizerstate_count);
1681 read_dword(&ptr, &e->samplerstate_count);
1682 TRACE("Samplerstate count: %u\n", e->samplerstate_count);
1684 read_dword(&ptr, &e->rendertargetview_count);
1685 TRACE("Rendertargetview count: %u\n", e->rendertargetview_count);
1687 read_dword(&ptr, &e->depthstencilview_count);
1688 TRACE("Depthstencilview count: %u\n", e->depthstencilview_count);
1690 read_dword(&ptr, &e->used_shader_count);
1691 TRACE("Used shader count: %u\n", e->used_shader_count);
1693 read_dword(&ptr, &e->anonymous_shader_count);
1694 TRACE("Anonymous shader count: %u\n", e->anonymous_shader_count);
1696 return parse_fx10_body(e, ptr, data_size - (ptr - data));
1699 static HRESULT fx10_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
1701 struct d3d10_effect *e = ctx;
1703 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
1705 TRACE("chunk size: %#x\n", data_size);
1707 switch(tag)
1709 case TAG_FX10:
1710 return parse_fx10(e, data, data_size);
1712 default:
1713 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
1714 return S_OK;
1718 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size)
1720 return parse_dxbc(data, data_size, fx10_chunk_handler, This);
1723 static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
1725 ID3D10Device *device = o->pass->technique->effect->device;
1726 struct d3d10_effect_variable *v = (struct d3d10_effect_variable*) o->data;
1728 TRACE("effect object %p, type %#x.\n", o, o->type);
1730 switch(o->type)
1732 case D3D10_EOT_VERTEXSHADER:
1733 ID3D10Device_VSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.vs);
1734 return S_OK;
1736 case D3D10_EOT_PIXELSHADER:
1737 ID3D10Device_PSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.ps);
1738 return S_OK;
1740 case D3D10_EOT_GEOMETRYSHADER:
1741 ID3D10Device_GSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.gs);
1742 return S_OK;
1744 default:
1745 FIXME("Unhandled effect object type %#x.\n", o->type);
1746 return E_FAIL;
1750 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
1752 unsigned int i;
1754 TRACE("variable %p.\n", v);
1756 HeapFree(GetProcessHeap(), 0, v->name);
1757 HeapFree(GetProcessHeap(), 0, v->semantic);
1758 if (v->annotations)
1760 for (i = 0; i < v->annotation_count; ++i)
1762 d3d10_effect_variable_destroy(&v->annotations[i]);
1764 HeapFree(GetProcessHeap(), 0, v->annotations);
1767 if (v->members)
1769 for (i = 0; i < v->type->member_count; ++i)
1771 d3d10_effect_variable_destroy(&v->members[i]);
1773 HeapFree(GetProcessHeap(), 0, v->members);
1776 if (v->elements)
1778 for (i = 0; i < v->type->element_count; ++i)
1780 d3d10_effect_variable_destroy(&v->elements[i]);
1782 HeapFree(GetProcessHeap(), 0, v->elements);
1785 if (v->data)
1787 switch(v->type->basetype)
1789 case D3D10_SVT_VERTEXSHADER:
1790 case D3D10_SVT_PIXELSHADER:
1791 case D3D10_SVT_GEOMETRYSHADER:
1792 shader_free_signature(&((struct d3d10_effect_shader_variable *)v->data)->input_signature);
1793 shader_free_signature(&((struct d3d10_effect_shader_variable *)v->data)->output_signature);
1794 break;
1796 default:
1797 break;
1799 HeapFree(GetProcessHeap(), 0, v->data);
1803 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p)
1805 unsigned int i;
1807 TRACE("pass %p\n", p);
1809 HeapFree(GetProcessHeap(), 0, p->name);
1810 HeapFree(GetProcessHeap(), 0, p->objects);
1812 if (p->annotations)
1814 for (i = 0; i < p->annotation_count; ++i)
1816 d3d10_effect_variable_destroy(&p->annotations[i]);
1818 HeapFree(GetProcessHeap(), 0, p->annotations);
1822 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
1824 unsigned int i;
1826 TRACE("technique %p\n", t);
1828 HeapFree(GetProcessHeap(), 0, t->name);
1829 if (t->passes)
1831 for (i = 0; i < t->pass_count; ++i)
1833 d3d10_effect_pass_destroy(&t->passes[i]);
1835 HeapFree(GetProcessHeap(), 0, t->passes);
1838 if (t->annotations)
1840 for (i = 0; i < t->annotation_count; ++i)
1842 d3d10_effect_variable_destroy(&t->annotations[i]);
1844 HeapFree(GetProcessHeap(), 0, t->annotations);
1848 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_variable *l)
1850 unsigned int i;
1852 TRACE("local buffer %p.\n", l);
1854 HeapFree(GetProcessHeap(), 0, l->name);
1855 if (l->members)
1857 for (i = 0; i < l->type->member_count; ++i)
1859 d3d10_effect_variable_destroy(&l->members[i]);
1861 HeapFree(GetProcessHeap(), 0, l->members);
1864 if (l->type->members)
1866 for (i = 0; i < l->type->member_count; ++i)
1868 /* Do not release l->type->members[i].type, it will be covered by d3d10_effect_type_destroy(). */
1869 HeapFree(GetProcessHeap(), 0, l->type->members[i].semantic);
1870 HeapFree(GetProcessHeap(), 0, l->type->members[i].name);
1872 HeapFree(GetProcessHeap(), 0, l->type->members);
1874 HeapFree(GetProcessHeap(), 0, l->type->name);
1875 HeapFree(GetProcessHeap(), 0, l->type);
1877 if (l->annotations)
1879 for (i = 0; i < l->annotation_count; ++i)
1881 d3d10_effect_variable_destroy(&l->annotations[i]);
1883 HeapFree(GetProcessHeap(), 0, l->annotations);
1887 /* IUnknown methods */
1889 static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
1891 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
1893 if (IsEqualGUID(riid, &IID_ID3D10Effect)
1894 || IsEqualGUID(riid, &IID_IUnknown))
1896 IUnknown_AddRef(iface);
1897 *object = iface;
1898 return S_OK;
1901 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
1903 *object = NULL;
1904 return E_NOINTERFACE;
1907 static ULONG STDMETHODCALLTYPE d3d10_effect_AddRef(ID3D10Effect *iface)
1909 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1910 ULONG refcount = InterlockedIncrement(&This->refcount);
1912 TRACE("%p increasing refcount to %u\n", This, refcount);
1914 return refcount;
1917 static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
1919 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1920 ULONG refcount = InterlockedDecrement(&This->refcount);
1922 TRACE("%p decreasing refcount to %u\n", This, refcount);
1924 if (!refcount)
1926 unsigned int i;
1928 if (This->techniques)
1930 for (i = 0; i < This->technique_count; ++i)
1932 d3d10_effect_technique_destroy(&This->techniques[i]);
1934 HeapFree(GetProcessHeap(), 0, This->techniques);
1937 if (This->local_variables)
1939 for (i = 0; i < This->local_variable_count; ++i)
1941 d3d10_effect_variable_destroy(&This->local_variables[i]);
1943 HeapFree(GetProcessHeap(), 0, This->local_variables);
1946 if (This->local_buffers)
1948 for (i = 0; i < This->local_buffer_count; ++i)
1950 d3d10_effect_local_buffer_destroy(&This->local_buffers[i]);
1952 HeapFree(GetProcessHeap(), 0, This->local_buffers);
1955 if (This->anonymous_shaders)
1957 for (i = 0; i < This->anonymous_shader_count; ++i)
1959 d3d10_effect_variable_destroy(&This->anonymous_shaders[i].shader);
1960 HeapFree(GetProcessHeap(), 0, This->anonymous_shaders[i].type.name);
1962 HeapFree(GetProcessHeap(), 0, This->anonymous_shaders);
1965 HeapFree(GetProcessHeap(), 0, This->used_shaders);
1967 wine_rb_destroy(&This->types, d3d10_effect_type_destroy, NULL);
1969 ID3D10Device_Release(This->device);
1970 HeapFree(GetProcessHeap(), 0, This);
1973 return refcount;
1976 /* ID3D10Effect methods */
1978 static BOOL STDMETHODCALLTYPE d3d10_effect_IsValid(ID3D10Effect *iface)
1980 FIXME("iface %p stub!\n", iface);
1982 return FALSE;
1985 static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
1987 FIXME("iface %p stub!\n", iface);
1989 return FALSE;
1992 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
1994 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1996 TRACE("iface %p, device %p\n", iface, device);
1998 ID3D10Device_AddRef(This->device);
1999 *device = This->device;
2001 return S_OK;
2004 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)
2006 FIXME("iface %p, desc %p stub!\n", iface, desc);
2008 return E_NOTIMPL;
2011 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface,
2012 UINT index)
2014 struct d3d10_effect *This = (struct d3d10_effect *)iface;
2015 struct d3d10_effect_variable *l;
2017 TRACE("iface %p, index %u\n", iface, index);
2019 if (index >= This->local_buffer_count)
2021 WARN("Invalid index specified\n");
2022 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
2025 l = &This->local_buffers[index];
2027 TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name));
2029 return (ID3D10EffectConstantBuffer *)l;
2032 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,
2033 LPCSTR name)
2035 struct d3d10_effect *This = (struct d3d10_effect *)iface;
2036 unsigned int i;
2038 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2040 for (i = 0; i < This->local_buffer_count; ++i)
2042 struct d3d10_effect_variable *l = &This->local_buffers[i];
2044 if (!strcmp(l->name, name))
2046 TRACE("Returning buffer %p.\n", l);
2047 return (ID3D10EffectConstantBuffer *)l;
2051 WARN("Invalid name specified\n");
2053 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
2056 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index)
2058 struct d3d10_effect *This = (struct d3d10_effect *)iface;
2059 unsigned int i;
2061 TRACE("iface %p, index %u\n", iface, index);
2063 for (i = 0; i < This->local_buffer_count; ++i)
2065 struct d3d10_effect_variable *l = &This->local_buffers[i];
2067 if (index < l->type->member_count)
2069 struct d3d10_effect_variable *v = &l->members[index];
2071 TRACE("Returning variable %p.\n", v);
2072 return (ID3D10EffectVariable *)v;
2074 index -= l->type->member_count;
2077 if (index < This->local_variable_count)
2079 struct d3d10_effect_variable *v = &This->local_variables[index];
2081 TRACE("Returning variable %p.\n", v);
2082 return (ID3D10EffectVariable *)v;
2085 WARN("Invalid index specified\n");
2087 return (ID3D10EffectVariable *)&null_variable;
2090 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name)
2092 struct d3d10_effect *This = (struct d3d10_effect *)iface;
2093 unsigned int i;
2095 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2097 if (!name)
2099 WARN("Invalid name specified\n");
2100 return (ID3D10EffectVariable *)&null_variable;
2103 for (i = 0; i < This->local_buffer_count; ++i)
2105 struct d3d10_effect_variable *l = &This->local_buffers[i];
2106 unsigned int j;
2108 for (j = 0; j < l->type->member_count; ++j)
2110 struct d3d10_effect_variable *v = &l->members[j];
2112 if (!strcmp(v->name, name))
2114 TRACE("Returning variable %p.\n", v);
2115 return (ID3D10EffectVariable *)v;
2120 for (i = 0; i < This->local_variable_count; ++i)
2122 struct d3d10_effect_variable *v = &This->local_variables[i];
2124 if (!strcmp(v->name, name))
2126 TRACE("Returning variable %p.\n", v);
2127 return (ID3D10EffectVariable *)v;
2131 WARN("Invalid name specified\n");
2133 return (ID3D10EffectVariable *)&null_variable;
2136 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface,
2137 LPCSTR semantic)
2139 struct d3d10_effect *This = (struct d3d10_effect *)iface;
2140 unsigned int i;
2142 TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
2144 if (!semantic)
2146 WARN("Invalid semantic specified\n");
2147 return (ID3D10EffectVariable *)&null_variable;
2150 for (i = 0; i < This->local_buffer_count; ++i)
2152 struct d3d10_effect_variable *l = &This->local_buffers[i];
2153 unsigned int j;
2155 for (j = 0; j < l->type->member_count; ++j)
2157 struct d3d10_effect_variable *v = &l->members[j];
2159 if (!strcmp(v->semantic, semantic))
2161 TRACE("Returning variable %p.\n", v);
2162 return (ID3D10EffectVariable *)v;
2167 for (i = 0; i < This->local_variable_count; ++i)
2169 struct d3d10_effect_variable *v = &This->local_variables[i];
2171 if (!strcmp(v->semantic, semantic))
2173 TRACE("Returning variable %p.\n", v);
2174 return (ID3D10EffectVariable *)v;
2178 WARN("Invalid semantic specified\n");
2180 return (ID3D10EffectVariable *)&null_variable;
2183 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByIndex(ID3D10Effect *iface,
2184 UINT index)
2186 struct d3d10_effect *This = (struct d3d10_effect *)iface;
2187 struct d3d10_effect_technique *t;
2189 TRACE("iface %p, index %u\n", iface, index);
2191 if (index >= This->technique_count)
2193 WARN("Invalid index specified\n");
2194 return (ID3D10EffectTechnique *)&null_technique;
2197 t = &This->techniques[index];
2199 TRACE("Returning technique %p, %s.\n", t, debugstr_a(t->name));
2201 return (ID3D10EffectTechnique *)t;
2204 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByName(ID3D10Effect *iface,
2205 LPCSTR name)
2207 struct d3d10_effect *This = (struct d3d10_effect *)iface;
2208 unsigned int i;
2210 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2212 if (!name)
2214 WARN("Invalid name specified\n");
2215 return (ID3D10EffectTechnique *)&null_technique;
2218 for (i = 0; i < This->technique_count; ++i)
2220 struct d3d10_effect_technique *t = &This->techniques[i];
2221 if (!strcmp(t->name, name))
2223 TRACE("Returning technique %p\n", t);
2224 return (ID3D10EffectTechnique *)t;
2228 WARN("Invalid name specified\n");
2230 return (ID3D10EffectTechnique *)&null_technique;
2233 static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
2235 FIXME("iface %p stub!\n", iface);
2237 return E_NOTIMPL;
2240 static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface)
2242 FIXME("iface %p stub!\n", iface);
2244 return FALSE;
2247 const struct ID3D10EffectVtbl d3d10_effect_vtbl =
2249 /* IUnknown methods */
2250 d3d10_effect_QueryInterface,
2251 d3d10_effect_AddRef,
2252 d3d10_effect_Release,
2253 /* ID3D10Effect methods */
2254 d3d10_effect_IsValid,
2255 d3d10_effect_IsPool,
2256 d3d10_effect_GetDevice,
2257 d3d10_effect_GetDesc,
2258 d3d10_effect_GetConstantBufferByIndex,
2259 d3d10_effect_GetConstantBufferByName,
2260 d3d10_effect_GetVariableByIndex,
2261 d3d10_effect_GetVariableByName,
2262 d3d10_effect_GetVariableBySemantic,
2263 d3d10_effect_GetTechniqueByIndex,
2264 d3d10_effect_GetTechniqueByName,
2265 d3d10_effect_Optimize,
2266 d3d10_effect_IsOptimized,
2269 /* ID3D10EffectTechnique methods */
2271 static BOOL STDMETHODCALLTYPE d3d10_effect_technique_IsValid(ID3D10EffectTechnique *iface)
2273 TRACE("iface %p\n", iface);
2275 return (struct d3d10_effect_technique *)iface != &null_technique;
2278 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_GetDesc(ID3D10EffectTechnique *iface,
2279 D3D10_TECHNIQUE_DESC *desc)
2281 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
2283 TRACE("iface %p, desc %p\n", iface, desc);
2285 if(This == &null_technique)
2287 WARN("Null technique specified\n");
2288 return E_FAIL;
2291 if(!desc)
2293 WARN("Invalid argument specified\n");
2294 return E_INVALIDARG;
2297 desc->Name = This->name;
2298 desc->Passes = This->pass_count;
2299 desc->Annotations = This->annotation_count;
2301 return S_OK;
2304 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByIndex(
2305 ID3D10EffectTechnique *iface, UINT index)
2307 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
2308 struct d3d10_effect_variable *a;
2310 TRACE("iface %p, index %u\n", iface, index);
2312 if (index >= This->annotation_count)
2314 WARN("Invalid index specified\n");
2315 return (ID3D10EffectVariable *)&null_variable;
2318 a = &This->annotations[index];
2320 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
2322 return (ID3D10EffectVariable *)a;
2325 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByName(
2326 ID3D10EffectTechnique *iface, LPCSTR name)
2328 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
2329 unsigned int i;
2331 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2333 for (i = 0; i < This->annotation_count; ++i)
2335 struct d3d10_effect_variable *a = &This->annotations[i];
2336 if (!strcmp(a->name, name))
2338 TRACE("Returning annotation %p\n", a);
2339 return (ID3D10EffectVariable *)a;
2343 WARN("Invalid name specified\n");
2345 return (ID3D10EffectVariable *)&null_variable;
2348 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique *iface,
2349 UINT index)
2351 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
2352 struct d3d10_effect_pass *p;
2354 TRACE("iface %p, index %u\n", iface, index);
2356 if (index >= This->pass_count)
2358 WARN("Invalid index specified\n");
2359 return (ID3D10EffectPass *)&null_pass;
2362 p = &This->passes[index];
2364 TRACE("Returning pass %p, %s.\n", p, debugstr_a(p->name));
2366 return (ID3D10EffectPass *)p;
2369 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique *iface,
2370 LPCSTR name)
2372 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
2373 unsigned int i;
2375 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2377 /* Do not check for name==NULL, W7/DX10 crashes in that case. */
2379 for (i = 0; i < This->pass_count; ++i)
2381 struct d3d10_effect_pass *p = &This->passes[i];
2382 if (!strcmp(p->name, name))
2384 TRACE("Returning pass %p\n", p);
2385 return (ID3D10EffectPass *)p;
2389 WARN("Invalid name specified\n");
2391 return (ID3D10EffectPass *)&null_pass;
2394 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique *iface,
2395 D3D10_STATE_BLOCK_MASK *mask)
2397 FIXME("iface %p,mask %p stub!\n", iface, mask);
2399 return E_NOTIMPL;
2402 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl =
2404 /* ID3D10EffectTechnique methods */
2405 d3d10_effect_technique_IsValid,
2406 d3d10_effect_technique_GetDesc,
2407 d3d10_effect_technique_GetAnnotationByIndex,
2408 d3d10_effect_technique_GetAnnotationByName,
2409 d3d10_effect_technique_GetPassByIndex,
2410 d3d10_effect_technique_GetPassByName,
2411 d3d10_effect_technique_ComputeStateBlockMask,
2414 /* ID3D10EffectPass methods */
2416 static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface)
2418 TRACE("iface %p\n", iface);
2420 return (struct d3d10_effect_pass *)iface != &null_pass;
2423 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface, D3D10_PASS_DESC *desc)
2425 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2426 unsigned int i;
2428 FIXME("iface %p, desc %p partial stub!\n", iface, desc);
2430 if(This == &null_pass)
2432 WARN("Null pass specified\n");
2433 return E_FAIL;
2436 if(!desc)
2438 WARN("Invalid argument specified\n");
2439 return E_INVALIDARG;
2442 memset(desc, 0, sizeof(*desc));
2443 desc->Name = This->name;
2444 for (i = 0; i < This->object_count; ++i)
2446 struct d3d10_effect_object *o = &This->objects[i];
2447 if (o->type == D3D10_EOT_VERTEXSHADER)
2449 struct d3d10_effect_variable *v = o->data;
2450 struct d3d10_effect_shader_variable *s = v->data;
2451 desc->pIAInputSignature = (BYTE *)s->input_signature.signature;
2452 desc->IAInputSignatureSize = s->input_signature.signature_size;
2453 break;
2457 return S_OK;
2460 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface,
2461 D3D10_PASS_SHADER_DESC *desc)
2463 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2464 unsigned int i;
2466 TRACE("iface %p, desc %p\n", iface, desc);
2468 if (This == &null_pass)
2470 WARN("Null pass specified\n");
2471 return E_FAIL;
2474 if (!desc)
2476 WARN("Invalid argument specified\n");
2477 return E_INVALIDARG;
2480 for (i = 0; i < This->object_count; ++i)
2482 struct d3d10_effect_object *o = &This->objects[i];
2484 if (o->type == D3D10_EOT_VERTEXSHADER)
2486 desc->pShaderVariable = o->data;
2487 desc->ShaderIndex = o->index;
2488 return S_OK;
2492 TRACE("Returning null_shader_variable\n");
2493 desc->pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable;
2494 desc->ShaderIndex = 0;
2496 return S_OK;
2499 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface,
2500 D3D10_PASS_SHADER_DESC *desc)
2502 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2503 unsigned int i;
2505 TRACE("iface %p, desc %p\n", iface, desc);
2507 if (This == &null_pass)
2509 WARN("Null pass specified\n");
2510 return E_FAIL;
2513 if (!desc)
2515 WARN("Invalid argument specified\n");
2516 return E_INVALIDARG;
2519 for (i = 0; i < This->object_count; ++i)
2521 struct d3d10_effect_object *o = &This->objects[i];
2523 if (o->type == D3D10_EOT_GEOMETRYSHADER)
2525 desc->pShaderVariable = o->data;
2526 desc->ShaderIndex = o->index;
2527 return S_OK;
2531 TRACE("Returning null_shader_variable\n");
2532 desc->pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable;
2533 desc->ShaderIndex = 0;
2535 return S_OK;
2538 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface,
2539 D3D10_PASS_SHADER_DESC *desc)
2541 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2542 unsigned int i;
2544 TRACE("iface %p, desc %p\n", iface, desc);
2546 if (This == &null_pass)
2548 WARN("Null pass specified\n");
2549 return E_FAIL;
2552 if (!desc)
2554 WARN("Invalid argument specified\n");
2555 return E_INVALIDARG;
2558 for (i = 0; i < This->object_count; ++i)
2560 struct d3d10_effect_object *o = &This->objects[i];
2562 if (o->type == D3D10_EOT_PIXELSHADER)
2564 desc->pShaderVariable = o->data;
2565 desc->ShaderIndex = o->index;
2566 return S_OK;
2570 TRACE("Returning null_shader_variable\n");
2571 desc->pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable;
2572 desc->ShaderIndex = 0;
2574 return S_OK;
2577 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass *iface,
2578 UINT index)
2580 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2581 struct d3d10_effect_variable *a;
2583 TRACE("iface %p, index %u\n", iface, index);
2585 if (index >= This->annotation_count)
2587 WARN("Invalid index specified\n");
2588 return (ID3D10EffectVariable *)&null_variable;
2591 a = &This->annotations[index];
2593 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
2595 return (ID3D10EffectVariable *)a;
2598 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass *iface,
2599 LPCSTR name)
2601 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2602 unsigned int i;
2604 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2606 for (i = 0; i < This->annotation_count; ++i)
2608 struct d3d10_effect_variable *a = &This->annotations[i];
2609 if (!strcmp(a->name, name))
2611 TRACE("Returning annotation %p\n", a);
2612 return (ID3D10EffectVariable *)a;
2616 WARN("Invalid name specified\n");
2618 return (ID3D10EffectVariable *)&null_variable;
2621 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
2623 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
2624 HRESULT hr = S_OK;
2625 unsigned int i;
2627 TRACE("iface %p, flags %#x\n", iface, flags);
2629 if (flags) FIXME("Ignoring flags (%#x)\n", flags);
2631 for (i = 0; i < This->object_count; ++i)
2633 hr = d3d10_effect_object_apply(&This->objects[i]);
2634 if (FAILED(hr)) break;
2637 return hr;
2640 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass *iface,
2641 D3D10_STATE_BLOCK_MASK *mask)
2643 FIXME("iface %p, mask %p stub!\n", iface, mask);
2645 return E_NOTIMPL;
2648 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl =
2650 /* ID3D10EffectPass methods */
2651 d3d10_effect_pass_IsValid,
2652 d3d10_effect_pass_GetDesc,
2653 d3d10_effect_pass_GetVertexShaderDesc,
2654 d3d10_effect_pass_GetGeometryShaderDesc,
2655 d3d10_effect_pass_GetPixelShaderDesc,
2656 d3d10_effect_pass_GetAnnotationByIndex,
2657 d3d10_effect_pass_GetAnnotationByName,
2658 d3d10_effect_pass_Apply,
2659 d3d10_effect_pass_ComputeStateBlockMask,
2662 /* ID3D10EffectVariable methods */
2664 static BOOL STDMETHODCALLTYPE d3d10_effect_variable_IsValid(ID3D10EffectVariable *iface)
2666 TRACE("iface %p\n", iface);
2668 return (struct d3d10_effect_variable *)iface != &null_variable;
2671 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_variable_GetType(ID3D10EffectVariable *iface)
2673 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2675 TRACE("iface %p\n", iface);
2677 return (ID3D10EffectType *)This->type;
2680 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetDesc(ID3D10EffectVariable *iface,
2681 D3D10_EFFECT_VARIABLE_DESC *desc)
2683 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2685 TRACE("iface %p, desc %p\n", iface, desc);
2687 if (!iface->lpVtbl->IsValid(iface))
2689 WARN("Null variable specified\n");
2690 return E_FAIL;
2693 if (!desc)
2695 WARN("Invalid argument specified\n");
2696 return E_INVALIDARG;
2699 /* FIXME: This isn't correct. Anonymous shaders let desc->ExplicitBindPoint untouched, but normal shaders set it! */
2700 memset(desc, 0, sizeof(*desc));
2701 desc->Name = This->name;
2702 desc->Semantic = This->semantic;
2703 desc->Flags = This->flag;
2704 desc->Annotations = This->annotation_count;
2705 desc->BufferOffset = This->buffer_offset;
2707 if (This->flag & D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT)
2709 desc->ExplicitBindPoint = This->buffer_offset;
2712 return S_OK;
2715 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByIndex(
2716 ID3D10EffectVariable *iface, UINT index)
2718 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2719 struct d3d10_effect_variable *a;
2721 TRACE("iface %p, index %u\n", iface, index);
2723 if (index >= This->annotation_count)
2725 WARN("Invalid index specified\n");
2726 return (ID3D10EffectVariable *)&null_variable;
2729 a = &This->annotations[index];
2731 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
2733 return (ID3D10EffectVariable *)a;
2736 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName(
2737 ID3D10EffectVariable *iface, LPCSTR name)
2739 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2740 unsigned int i;
2742 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2744 for (i = 0; i < This->annotation_count; ++i)
2746 struct d3d10_effect_variable *a = &This->annotations[i];
2747 if (!strcmp(a->name, name))
2749 TRACE("Returning annotation %p\n", a);
2750 return (ID3D10EffectVariable *)a;
2754 WARN("Invalid name specified\n");
2756 return (ID3D10EffectVariable *)&null_variable;
2759 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex(
2760 ID3D10EffectVariable *iface, UINT index)
2762 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2763 struct d3d10_effect_variable *m;
2765 TRACE("iface %p, index %u\n", iface, index);
2767 if (index >= This->type->member_count)
2769 WARN("Invalid index specified\n");
2770 return (ID3D10EffectVariable *)&null_variable;
2773 m = &This->members[index];
2775 TRACE("Returning member %p, %s\n", m, debugstr_a(m->name));
2777 return (ID3D10EffectVariable *)m;
2780 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName(
2781 ID3D10EffectVariable *iface, LPCSTR name)
2783 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2784 unsigned int i;
2786 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2788 if (!name)
2790 WARN("Invalid name specified\n");
2791 return (ID3D10EffectVariable *)&null_variable;
2794 for (i = 0; i < This->type->member_count; ++i)
2796 struct d3d10_effect_variable *m = &This->members[i];
2798 if (m->name)
2800 if (!strcmp(m->name, name))
2802 TRACE("Returning member %p\n", m);
2803 return (ID3D10EffectVariable *)m;
2808 WARN("Invalid name specified\n");
2810 return (ID3D10EffectVariable *)&null_variable;
2813 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic(
2814 ID3D10EffectVariable *iface, LPCSTR semantic)
2816 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2817 unsigned int i;
2819 TRACE("iface %p, semantic %s.\n", iface, debugstr_a(semantic));
2821 if (!semantic)
2823 WARN("Invalid semantic specified\n");
2824 return (ID3D10EffectVariable *)&null_variable;
2827 for (i = 0; i < This->type->member_count; ++i)
2829 struct d3d10_effect_variable *m = &This->members[i];
2831 if (m->semantic)
2833 if (!strcmp(m->semantic, semantic))
2835 TRACE("Returning member %p\n", m);
2836 return (ID3D10EffectVariable *)m;
2841 WARN("Invalid semantic specified\n");
2843 return (ID3D10EffectVariable *)&null_variable;
2846 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetElement(
2847 ID3D10EffectVariable *iface, UINT index)
2849 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2850 struct d3d10_effect_variable *v;
2852 TRACE("iface %p, index %u\n", iface, index);
2854 if (index >= This->type->element_count)
2856 WARN("Invalid index specified\n");
2857 return (ID3D10EffectVariable *)&null_variable;
2860 v = &This->elements[index];
2862 TRACE("Returning element %p, %s\n", v, debugstr_a(v->name));
2864 return (ID3D10EffectVariable *)v;
2867 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_GetParentConstantBuffer(
2868 ID3D10EffectVariable *iface)
2870 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2872 TRACE("iface %p\n", iface);
2874 return (ID3D10EffectConstantBuffer *)This->buffer;
2877 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsScalar(
2878 ID3D10EffectVariable *iface)
2880 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2882 TRACE("iface %p\n", iface);
2884 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl)
2885 return (ID3D10EffectScalarVariable *)This;
2887 return (ID3D10EffectScalarVariable *)&null_scalar_variable;
2890 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsVector(
2891 ID3D10EffectVariable *iface)
2893 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2895 TRACE("iface %p\n", iface);
2897 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl)
2898 return (ID3D10EffectVectorVariable *)This;
2900 return (ID3D10EffectVectorVariable *)&null_vector_variable;
2903 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix(
2904 ID3D10EffectVariable *iface)
2906 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2908 TRACE("iface %p\n", iface);
2910 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl)
2911 return (ID3D10EffectMatrixVariable *)This;
2913 return (ID3D10EffectMatrixVariable *)&null_matrix_variable;
2916 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsString(
2917 ID3D10EffectVariable *iface)
2919 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2921 TRACE("iface %p\n", iface);
2923 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl)
2924 return (ID3D10EffectStringVariable *)This;
2926 return (ID3D10EffectStringVariable *)&null_string_variable;
2929 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShaderResource(
2930 ID3D10EffectVariable *iface)
2932 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2934 TRACE("iface %p\n", iface);
2936 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl)
2937 return (ID3D10EffectShaderResourceVariable *)This;
2939 return (ID3D10EffectShaderResourceVariable *)&null_shader_resource_variable;
2942 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRenderTargetView(
2943 ID3D10EffectVariable *iface)
2945 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2947 TRACE("iface %p\n", iface);
2949 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl)
2950 return (ID3D10EffectRenderTargetViewVariable *)This;
2952 return (ID3D10EffectRenderTargetViewVariable *)&null_render_target_view_variable;
2955 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencilView(
2956 ID3D10EffectVariable *iface)
2958 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2960 TRACE("iface %p\n", iface);
2962 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl)
2963 return (ID3D10EffectDepthStencilViewVariable *)This;
2965 return (ID3D10EffectDepthStencilViewVariable *)&null_depth_stencil_view_variable;
2968 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_AsConstantBuffer(
2969 ID3D10EffectVariable *iface)
2971 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2973 TRACE("iface %p\n", iface);
2975 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl)
2976 return (ID3D10EffectConstantBuffer *)This;
2978 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
2981 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShader(
2982 ID3D10EffectVariable *iface)
2984 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2986 TRACE("iface %p\n", iface);
2988 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl)
2989 return (ID3D10EffectShaderVariable *)This;
2991 return (ID3D10EffectShaderVariable *)&null_shader_variable;
2994 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsBlend(ID3D10EffectVariable *iface)
2996 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2998 TRACE("iface %p\n", iface);
3000 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl)
3001 return (ID3D10EffectBlendVariable *)This;
3003 return (ID3D10EffectBlendVariable *)&null_blend_variable;
3006 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencil(
3007 ID3D10EffectVariable *iface)
3009 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
3011 TRACE("iface %p\n", iface);
3013 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl)
3014 return (ID3D10EffectDepthStencilVariable *)This;
3016 return (ID3D10EffectDepthStencilVariable *)&null_depth_stencil_variable;
3019 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRasterizer(
3020 ID3D10EffectVariable *iface)
3022 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
3024 TRACE("iface %p\n", iface);
3026 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl)
3027 return (ID3D10EffectRasterizerVariable *)This;
3029 return (ID3D10EffectRasterizerVariable *)&null_rasterizer_variable;
3032 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsSampler(
3033 ID3D10EffectVariable *iface)
3035 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
3037 TRACE("iface %p\n", iface);
3039 if (This->vtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl)
3040 return (ID3D10EffectSamplerVariable *)This;
3042 return (ID3D10EffectSamplerVariable *)&null_sampler_variable;
3045 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface,
3046 void *data, UINT offset, UINT count)
3048 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3050 return E_NOTIMPL;
3053 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface,
3054 void *data, UINT offset, UINT count)
3056 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3058 return E_NOTIMPL;
3061 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl =
3063 /* ID3D10EffectVariable methods */
3064 d3d10_effect_variable_IsValid,
3065 d3d10_effect_variable_GetType,
3066 d3d10_effect_variable_GetDesc,
3067 d3d10_effect_variable_GetAnnotationByIndex,
3068 d3d10_effect_variable_GetAnnotationByName,
3069 d3d10_effect_variable_GetMemberByIndex,
3070 d3d10_effect_variable_GetMemberByName,
3071 d3d10_effect_variable_GetMemberBySemantic,
3072 d3d10_effect_variable_GetElement,
3073 d3d10_effect_variable_GetParentConstantBuffer,
3074 d3d10_effect_variable_AsScalar,
3075 d3d10_effect_variable_AsVector,
3076 d3d10_effect_variable_AsMatrix,
3077 d3d10_effect_variable_AsString,
3078 d3d10_effect_variable_AsShaderResource,
3079 d3d10_effect_variable_AsRenderTargetView,
3080 d3d10_effect_variable_AsDepthStencilView,
3081 d3d10_effect_variable_AsConstantBuffer,
3082 d3d10_effect_variable_AsShader,
3083 d3d10_effect_variable_AsBlend,
3084 d3d10_effect_variable_AsDepthStencil,
3085 d3d10_effect_variable_AsRasterizer,
3086 d3d10_effect_variable_AsSampler,
3087 d3d10_effect_variable_SetRawValue,
3088 d3d10_effect_variable_GetRawValue,
3091 /* ID3D10EffectVariable methods */
3092 static BOOL STDMETHODCALLTYPE d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer *iface)
3094 TRACE("iface %p\n", iface);
3096 return (struct d3d10_effect_variable *)iface != &null_local_buffer;
3099 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer *iface)
3101 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3104 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer *iface,
3105 D3D10_EFFECT_VARIABLE_DESC *desc)
3107 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3110 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByIndex(
3111 ID3D10EffectConstantBuffer *iface, UINT index)
3113 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3116 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByName(
3117 ID3D10EffectConstantBuffer *iface, LPCSTR name)
3119 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3122 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByIndex(
3123 ID3D10EffectConstantBuffer *iface, UINT index)
3125 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3128 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByName(
3129 ID3D10EffectConstantBuffer *iface, LPCSTR name)
3131 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3134 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberBySemantic(
3135 ID3D10EffectConstantBuffer *iface, LPCSTR semantic)
3137 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3140 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetElement(
3141 ID3D10EffectConstantBuffer *iface, UINT index)
3143 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3146 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetParentConstantBuffer(
3147 ID3D10EffectConstantBuffer *iface)
3149 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3152 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsScalar(
3153 ID3D10EffectConstantBuffer *iface)
3155 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3158 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsVector(
3159 ID3D10EffectConstantBuffer *iface)
3161 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3164 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsMatrix(
3165 ID3D10EffectConstantBuffer *iface)
3167 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3170 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsString(
3171 ID3D10EffectConstantBuffer *iface)
3173 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3176 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShaderResource(
3177 ID3D10EffectConstantBuffer *iface)
3179 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3182 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRenderTargetView(
3183 ID3D10EffectConstantBuffer *iface)
3185 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3188 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencilView(
3189 ID3D10EffectConstantBuffer *iface)
3191 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3194 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsConstantBuffer(
3195 ID3D10EffectConstantBuffer *iface)
3197 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3200 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShader(
3201 ID3D10EffectConstantBuffer *iface)
3203 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3206 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer *iface)
3208 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3211 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencil(
3212 ID3D10EffectConstantBuffer *iface)
3214 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3217 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRasterizer(
3218 ID3D10EffectConstantBuffer *iface)
3220 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3223 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsSampler(
3224 ID3D10EffectConstantBuffer *iface)
3226 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3229 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer *iface,
3230 void *data, UINT offset, UINT count)
3232 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3235 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer *iface,
3236 void *data, UINT offset, UINT count)
3238 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3241 /* ID3D10EffectConstantBuffer methods */
3242 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer *iface,
3243 ID3D10Buffer *buffer)
3245 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
3247 return E_NOTIMPL;
3250 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer *iface,
3251 ID3D10Buffer **buffer)
3253 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
3255 return E_NOTIMPL;
3258 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer *iface,
3259 ID3D10ShaderResourceView *view)
3261 FIXME("iface %p, view %p stub!\n", iface, view);
3263 return E_NOTIMPL;
3266 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer *iface,
3267 ID3D10ShaderResourceView **view)
3269 FIXME("iface %p, view %p stub!\n", iface, view);
3271 return E_NOTIMPL;
3274 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl =
3276 /* ID3D10EffectVariable methods */
3277 d3d10_effect_constant_buffer_IsValid,
3278 d3d10_effect_constant_buffer_GetType,
3279 d3d10_effect_constant_buffer_GetDesc,
3280 d3d10_effect_constant_buffer_GetAnnotationByIndex,
3281 d3d10_effect_constant_buffer_GetAnnotationByName,
3282 d3d10_effect_constant_buffer_GetMemberByIndex,
3283 d3d10_effect_constant_buffer_GetMemberByName,
3284 d3d10_effect_constant_buffer_GetMemberBySemantic,
3285 d3d10_effect_constant_buffer_GetElement,
3286 d3d10_effect_constant_buffer_GetParentConstantBuffer,
3287 d3d10_effect_constant_buffer_AsScalar,
3288 d3d10_effect_constant_buffer_AsVector,
3289 d3d10_effect_constant_buffer_AsMatrix,
3290 d3d10_effect_constant_buffer_AsString,
3291 d3d10_effect_constant_buffer_AsShaderResource,
3292 d3d10_effect_constant_buffer_AsRenderTargetView,
3293 d3d10_effect_constant_buffer_AsDepthStencilView,
3294 d3d10_effect_constant_buffer_AsConstantBuffer,
3295 d3d10_effect_constant_buffer_AsShader,
3296 d3d10_effect_constant_buffer_AsBlend,
3297 d3d10_effect_constant_buffer_AsDepthStencil,
3298 d3d10_effect_constant_buffer_AsRasterizer,
3299 d3d10_effect_constant_buffer_AsSampler,
3300 d3d10_effect_constant_buffer_SetRawValue,
3301 d3d10_effect_constant_buffer_GetRawValue,
3302 /* ID3D10EffectConstantBuffer methods */
3303 d3d10_effect_constant_buffer_SetConstantBuffer,
3304 d3d10_effect_constant_buffer_GetConstantBuffer,
3305 d3d10_effect_constant_buffer_SetTextureBuffer,
3306 d3d10_effect_constant_buffer_GetTextureBuffer,
3309 /* ID3D10EffectVariable methods */
3311 static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
3313 TRACE("iface %p\n", iface);
3315 return (struct d3d10_effect_variable *)iface != &null_scalar_variable;
3318 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetType(
3319 ID3D10EffectScalarVariable *iface)
3321 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3324 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetDesc(ID3D10EffectScalarVariable *iface,
3325 D3D10_EFFECT_VARIABLE_DESC *desc)
3327 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3330 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByIndex(
3331 ID3D10EffectScalarVariable *iface, UINT index)
3333 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3336 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByName(
3337 ID3D10EffectScalarVariable *iface, LPCSTR name)
3339 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3342 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByIndex(
3343 ID3D10EffectScalarVariable *iface, UINT index)
3345 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3348 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByName(
3349 ID3D10EffectScalarVariable *iface, LPCSTR name)
3351 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3354 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberBySemantic(
3355 ID3D10EffectScalarVariable *iface, LPCSTR semantic)
3357 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3360 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetElement(
3361 ID3D10EffectScalarVariable *iface, UINT index)
3363 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3366 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetParentConstantBuffer(
3367 ID3D10EffectScalarVariable *iface)
3369 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3372 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsScalar(
3373 ID3D10EffectScalarVariable *iface)
3375 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3378 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsVector(
3379 ID3D10EffectScalarVariable *iface)
3381 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3384 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsMatrix(
3385 ID3D10EffectScalarVariable *iface)
3387 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3390 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsString(
3391 ID3D10EffectScalarVariable *iface)
3393 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3396 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShaderResource(
3397 ID3D10EffectScalarVariable *iface)
3399 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3402 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRenderTargetView(
3403 ID3D10EffectScalarVariable *iface)
3405 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3408 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencilView(
3409 ID3D10EffectScalarVariable *iface)
3411 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3414 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsConstantBuffer(
3415 ID3D10EffectScalarVariable *iface)
3417 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3420 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShader(
3421 ID3D10EffectScalarVariable *iface)
3423 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3426 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsBlend(
3427 ID3D10EffectScalarVariable *iface)
3429 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3432 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencil(
3433 ID3D10EffectScalarVariable *iface)
3435 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3438 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRasterizer(
3439 ID3D10EffectScalarVariable *iface)
3441 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3444 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsSampler(
3445 ID3D10EffectScalarVariable *iface)
3447 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3450 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetRawValue(ID3D10EffectScalarVariable *iface,
3451 void *data, UINT offset, UINT count)
3453 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3456 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetRawValue(ID3D10EffectScalarVariable *iface,
3457 void *data, UINT offset, UINT count)
3459 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3462 /* ID3D10EffectScalarVariable methods */
3464 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable *iface,
3465 float value)
3467 FIXME("iface %p, value %.8e stub!\n", iface, value);
3469 return E_NOTIMPL;
3472 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable *iface,
3473 float *value)
3475 FIXME("iface %p, value %p stub!\n", iface, value);
3477 return E_NOTIMPL;
3480 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable *iface,
3481 float *values, UINT offset, UINT count)
3483 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3485 return E_NOTIMPL;
3488 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable *iface,
3489 float *values, UINT offset, UINT count)
3491 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3493 return E_NOTIMPL;
3496 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable *iface,
3497 int value)
3499 FIXME("iface %p, value %d stub!\n", iface, value);
3501 return E_NOTIMPL;
3504 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable *iface,
3505 int *value)
3507 FIXME("iface %p, value %p stub!\n", iface, value);
3509 return E_NOTIMPL;
3512 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable *iface,
3513 int *values, UINT offset, UINT count)
3515 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3517 return E_NOTIMPL;
3520 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable *iface,
3521 int *values, UINT offset, UINT count)
3523 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3525 return E_NOTIMPL;
3528 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable *iface,
3529 BOOL value)
3531 FIXME("iface %p, value %d stub!\n", iface, value);
3533 return E_NOTIMPL;
3536 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable *iface,
3537 BOOL *value)
3539 FIXME("iface %p, value %p stub!\n", iface, value);
3541 return E_NOTIMPL;
3544 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable *iface,
3545 BOOL *values, UINT offset, UINT count)
3547 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3549 return E_NOTIMPL;
3552 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable *iface,
3553 BOOL *values, UINT offset, UINT count)
3555 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3557 return E_NOTIMPL;
3560 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl =
3562 /* ID3D10EffectVariable methods */
3563 d3d10_effect_scalar_variable_IsValid,
3564 d3d10_effect_scalar_variable_GetType,
3565 d3d10_effect_scalar_variable_GetDesc,
3566 d3d10_effect_scalar_variable_GetAnnotationByIndex,
3567 d3d10_effect_scalar_variable_GetAnnotationByName,
3568 d3d10_effect_scalar_variable_GetMemberByIndex,
3569 d3d10_effect_scalar_variable_GetMemberByName,
3570 d3d10_effect_scalar_variable_GetMemberBySemantic,
3571 d3d10_effect_scalar_variable_GetElement,
3572 d3d10_effect_scalar_variable_GetParentConstantBuffer,
3573 d3d10_effect_scalar_variable_AsScalar,
3574 d3d10_effect_scalar_variable_AsVector,
3575 d3d10_effect_scalar_variable_AsMatrix,
3576 d3d10_effect_scalar_variable_AsString,
3577 d3d10_effect_scalar_variable_AsShaderResource,
3578 d3d10_effect_scalar_variable_AsRenderTargetView,
3579 d3d10_effect_scalar_variable_AsDepthStencilView,
3580 d3d10_effect_scalar_variable_AsConstantBuffer,
3581 d3d10_effect_scalar_variable_AsShader,
3582 d3d10_effect_scalar_variable_AsBlend,
3583 d3d10_effect_scalar_variable_AsDepthStencil,
3584 d3d10_effect_scalar_variable_AsRasterizer,
3585 d3d10_effect_scalar_variable_AsSampler,
3586 d3d10_effect_scalar_variable_SetRawValue,
3587 d3d10_effect_scalar_variable_GetRawValue,
3588 /* ID3D10EffectScalarVariable methods */
3589 d3d10_effect_scalar_variable_SetFloat,
3590 d3d10_effect_scalar_variable_GetFloat,
3591 d3d10_effect_scalar_variable_SetFloatArray,
3592 d3d10_effect_scalar_variable_GetFloatArray,
3593 d3d10_effect_scalar_variable_SetInt,
3594 d3d10_effect_scalar_variable_GetInt,
3595 d3d10_effect_scalar_variable_SetIntArray,
3596 d3d10_effect_scalar_variable_GetIntArray,
3597 d3d10_effect_scalar_variable_SetBool,
3598 d3d10_effect_scalar_variable_GetBool,
3599 d3d10_effect_scalar_variable_SetBoolArray,
3600 d3d10_effect_scalar_variable_GetBoolArray,
3603 /* ID3D10EffectVariable methods */
3605 static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
3607 TRACE("iface %p\n", iface);
3609 return (struct d3d10_effect_variable *)iface != &null_vector_variable;
3612 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetType(
3613 ID3D10EffectVectorVariable *iface)
3615 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3618 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable *iface,
3619 D3D10_EFFECT_VARIABLE_DESC *desc)
3621 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3624 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByIndex(
3625 ID3D10EffectVectorVariable *iface, UINT index)
3627 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3630 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByName(
3631 ID3D10EffectVectorVariable *iface, LPCSTR name)
3633 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3636 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByIndex(
3637 ID3D10EffectVectorVariable *iface, UINT index)
3639 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3642 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByName(
3643 ID3D10EffectVectorVariable *iface, LPCSTR name)
3645 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3648 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberBySemantic(
3649 ID3D10EffectVectorVariable *iface, LPCSTR semantic)
3651 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3654 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetElement(
3655 ID3D10EffectVectorVariable *iface, UINT index)
3657 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3660 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetParentConstantBuffer(
3661 ID3D10EffectVectorVariable *iface)
3663 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3666 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsScalar(
3667 ID3D10EffectVectorVariable *iface)
3669 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3672 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsVector(
3673 ID3D10EffectVectorVariable *iface)
3675 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3678 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsMatrix(
3679 ID3D10EffectVectorVariable *iface)
3681 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3684 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsString(
3685 ID3D10EffectVectorVariable *iface)
3687 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3690 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShaderResource(
3691 ID3D10EffectVectorVariable *iface)
3693 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3696 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRenderTargetView(
3697 ID3D10EffectVectorVariable *iface)
3699 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3702 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencilView(
3703 ID3D10EffectVectorVariable *iface)
3705 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3708 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsConstantBuffer(
3709 ID3D10EffectVectorVariable *iface)
3711 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3714 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShader(
3715 ID3D10EffectVectorVariable *iface)
3717 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3720 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsBlend(
3721 ID3D10EffectVectorVariable *iface)
3723 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3726 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencil(
3727 ID3D10EffectVectorVariable *iface)
3729 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3732 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRasterizer(
3733 ID3D10EffectVectorVariable *iface)
3735 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3738 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsSampler(
3739 ID3D10EffectVectorVariable *iface)
3741 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3744 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable *iface,
3745 void *data, UINT offset, UINT count)
3747 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3750 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable *iface,
3751 void *data, UINT offset, UINT count)
3753 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3756 /* ID3D10EffectVectorVariable methods */
3758 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable *iface,
3759 BOOL *value)
3761 FIXME("iface %p, value %p stub!\n", iface, value);
3763 return E_NOTIMPL;
3766 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable *iface,
3767 int *value)
3769 FIXME("iface %p, value %p stub!\n", iface, value);
3771 return E_NOTIMPL;
3774 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable *iface,
3775 float *value)
3777 FIXME("iface %p, value %p stub!\n", iface, value);
3779 return E_NOTIMPL;
3782 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable *iface,
3783 BOOL *value)
3785 FIXME("iface %p, value %p stub!\n", iface, value);
3787 return E_NOTIMPL;
3790 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable *iface,
3791 int *value)
3793 FIXME("iface %p, value %p stub!\n", iface, value);
3795 return E_NOTIMPL;
3798 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable *iface,
3799 float *value)
3801 FIXME("iface %p, value %p stub!\n", iface, value);
3803 return E_NOTIMPL;
3806 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable *iface,
3807 BOOL *values, UINT offset, UINT count)
3809 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3811 return E_NOTIMPL;
3814 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable *iface,
3815 int *values, UINT offset, UINT count)
3817 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3819 return E_NOTIMPL;
3822 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable *iface,
3823 float *values, UINT offset, UINT count)
3825 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3827 return E_NOTIMPL;
3830 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable *iface,
3831 BOOL *values, UINT offset, UINT count)
3833 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3835 return E_NOTIMPL;
3838 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable *iface,
3839 int *values, UINT offset, UINT count)
3841 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3843 return E_NOTIMPL;
3846 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable *iface,
3847 float *values, UINT offset, UINT count)
3849 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3851 return E_NOTIMPL;
3854 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl =
3856 /* ID3D10EffectVariable methods */
3857 d3d10_effect_vector_variable_IsValid,
3858 d3d10_effect_vector_variable_GetType,
3859 d3d10_effect_vector_variable_GetDesc,
3860 d3d10_effect_vector_variable_GetAnnotationByIndex,
3861 d3d10_effect_vector_variable_GetAnnotationByName,
3862 d3d10_effect_vector_variable_GetMemberByIndex,
3863 d3d10_effect_vector_variable_GetMemberByName,
3864 d3d10_effect_vector_variable_GetMemberBySemantic,
3865 d3d10_effect_vector_variable_GetElement,
3866 d3d10_effect_vector_variable_GetParentConstantBuffer,
3867 d3d10_effect_vector_variable_AsScalar,
3868 d3d10_effect_vector_variable_AsVector,
3869 d3d10_effect_vector_variable_AsMatrix,
3870 d3d10_effect_vector_variable_AsString,
3871 d3d10_effect_vector_variable_AsShaderResource,
3872 d3d10_effect_vector_variable_AsRenderTargetView,
3873 d3d10_effect_vector_variable_AsDepthStencilView,
3874 d3d10_effect_vector_variable_AsConstantBuffer,
3875 d3d10_effect_vector_variable_AsShader,
3876 d3d10_effect_vector_variable_AsBlend,
3877 d3d10_effect_vector_variable_AsDepthStencil,
3878 d3d10_effect_vector_variable_AsRasterizer,
3879 d3d10_effect_vector_variable_AsSampler,
3880 d3d10_effect_vector_variable_SetRawValue,
3881 d3d10_effect_vector_variable_GetRawValue,
3882 /* ID3D10EffectVectorVariable methods */
3883 d3d10_effect_vector_variable_SetBoolVector,
3884 d3d10_effect_vector_variable_SetIntVector,
3885 d3d10_effect_vector_variable_SetFloatVector,
3886 d3d10_effect_vector_variable_GetBoolVector,
3887 d3d10_effect_vector_variable_GetIntVector,
3888 d3d10_effect_vector_variable_GetFloatVector,
3889 d3d10_effect_vector_variable_SetBoolVectorArray,
3890 d3d10_effect_vector_variable_SetIntVectorArray,
3891 d3d10_effect_vector_variable_SetFloatVectorArray,
3892 d3d10_effect_vector_variable_GetBoolVectorArray,
3893 d3d10_effect_vector_variable_GetIntVectorArray,
3894 d3d10_effect_vector_variable_GetFloatVectorArray,
3897 /* ID3D10EffectVariable methods */
3899 static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
3901 TRACE("iface %p\n", iface);
3903 return (struct d3d10_effect_variable *)iface != &null_matrix_variable;
3906 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetType(
3907 ID3D10EffectMatrixVariable *iface)
3909 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3912 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetDesc(ID3D10EffectMatrixVariable *iface,
3913 D3D10_EFFECT_VARIABLE_DESC *desc)
3915 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3918 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByIndex(
3919 ID3D10EffectMatrixVariable *iface, UINT index)
3921 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3924 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByName(
3925 ID3D10EffectMatrixVariable *iface, LPCSTR name)
3927 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3930 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByIndex(
3931 ID3D10EffectMatrixVariable *iface, UINT index)
3933 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3936 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByName(
3937 ID3D10EffectMatrixVariable *iface, LPCSTR name)
3939 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3942 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberBySemantic(
3943 ID3D10EffectMatrixVariable *iface, LPCSTR semantic)
3945 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3948 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetElement(
3949 ID3D10EffectMatrixVariable *iface, UINT index)
3951 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3954 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetParentConstantBuffer(
3955 ID3D10EffectMatrixVariable *iface)
3957 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3960 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsScalar(
3961 ID3D10EffectMatrixVariable *iface)
3963 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3966 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsVector(
3967 ID3D10EffectMatrixVariable *iface)
3969 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3972 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsMatrix(
3973 ID3D10EffectMatrixVariable *iface)
3975 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3978 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsString(
3979 ID3D10EffectMatrixVariable *iface)
3981 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3984 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShaderResource(
3985 ID3D10EffectMatrixVariable *iface)
3987 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3990 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRenderTargetView(
3991 ID3D10EffectMatrixVariable *iface)
3993 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3996 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencilView(
3997 ID3D10EffectMatrixVariable *iface)
3999 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4002 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsConstantBuffer(
4003 ID3D10EffectMatrixVariable *iface)
4005 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4008 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShader(
4009 ID3D10EffectMatrixVariable *iface)
4011 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4014 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsBlend(
4015 ID3D10EffectMatrixVariable *iface)
4017 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4020 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencil(
4021 ID3D10EffectMatrixVariable *iface)
4023 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4026 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRasterizer(
4027 ID3D10EffectMatrixVariable *iface)
4029 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4032 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsSampler(
4033 ID3D10EffectMatrixVariable *iface)
4035 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4038 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetRawValue(ID3D10EffectMatrixVariable *iface,
4039 void *data, UINT offset, UINT count)
4041 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4044 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetRawValue(ID3D10EffectMatrixVariable *iface,
4045 void *data, UINT offset, UINT count)
4047 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4050 /* ID3D10EffectMatrixVariable methods */
4052 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrix(ID3D10EffectMatrixVariable *iface,
4053 float *data)
4055 FIXME("iface %p, data %p stub!\n", iface, data);
4057 return E_NOTIMPL;
4060 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrix(ID3D10EffectMatrixVariable *iface,
4061 float *data)
4063 FIXME("iface %p, data %p stub!\n", iface, data);
4065 return E_NOTIMPL;
4068 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixArray(ID3D10EffectMatrixVariable *iface,
4069 float *data, UINT offset, UINT count)
4071 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4073 return E_NOTIMPL;
4076 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixArray(ID3D10EffectMatrixVariable *iface,
4077 float *data, UINT offset, UINT count)
4079 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4081 return E_NOTIMPL;
4084 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
4085 float *data)
4087 FIXME("iface %p, data %p stub!\n", iface, data);
4089 return E_NOTIMPL;
4092 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
4093 float *data)
4095 FIXME("iface %p, data %p stub!\n", iface, data);
4097 return E_NOTIMPL;
4100 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
4101 float *data, UINT offset, UINT count)
4103 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4105 return E_NOTIMPL;
4108 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
4109 float *data, UINT offset, UINT count)
4111 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4113 return E_NOTIMPL;
4117 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl =
4119 /* ID3D10EffectVariable methods */
4120 d3d10_effect_matrix_variable_IsValid,
4121 d3d10_effect_matrix_variable_GetType,
4122 d3d10_effect_matrix_variable_GetDesc,
4123 d3d10_effect_matrix_variable_GetAnnotationByIndex,
4124 d3d10_effect_matrix_variable_GetAnnotationByName,
4125 d3d10_effect_matrix_variable_GetMemberByIndex,
4126 d3d10_effect_matrix_variable_GetMemberByName,
4127 d3d10_effect_matrix_variable_GetMemberBySemantic,
4128 d3d10_effect_matrix_variable_GetElement,
4129 d3d10_effect_matrix_variable_GetParentConstantBuffer,
4130 d3d10_effect_matrix_variable_AsScalar,
4131 d3d10_effect_matrix_variable_AsVector,
4132 d3d10_effect_matrix_variable_AsMatrix,
4133 d3d10_effect_matrix_variable_AsString,
4134 d3d10_effect_matrix_variable_AsShaderResource,
4135 d3d10_effect_matrix_variable_AsRenderTargetView,
4136 d3d10_effect_matrix_variable_AsDepthStencilView,
4137 d3d10_effect_matrix_variable_AsConstantBuffer,
4138 d3d10_effect_matrix_variable_AsShader,
4139 d3d10_effect_matrix_variable_AsBlend,
4140 d3d10_effect_matrix_variable_AsDepthStencil,
4141 d3d10_effect_matrix_variable_AsRasterizer,
4142 d3d10_effect_matrix_variable_AsSampler,
4143 d3d10_effect_matrix_variable_SetRawValue,
4144 d3d10_effect_matrix_variable_GetRawValue,
4145 /* ID3D10EffectMatrixVariable methods */
4146 d3d10_effect_matrix_variable_SetMatrix,
4147 d3d10_effect_matrix_variable_GetMatrix,
4148 d3d10_effect_matrix_variable_SetMatrixArray,
4149 d3d10_effect_matrix_variable_GetMatrixArray,
4150 d3d10_effect_matrix_variable_SetMatrixTranspose,
4151 d3d10_effect_matrix_variable_GetMatrixTranspose,
4152 d3d10_effect_matrix_variable_SetMatrixTransposeArray,
4153 d3d10_effect_matrix_variable_GetMatrixTransposeArray,
4156 /* ID3D10EffectVariable methods */
4158 static BOOL STDMETHODCALLTYPE d3d10_effect_string_variable_IsValid(ID3D10EffectStringVariable *iface)
4160 TRACE("iface %p\n", iface);
4162 return (struct d3d10_effect_variable *)iface != &null_string_variable;
4165 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_string_variable_GetType(
4166 ID3D10EffectStringVariable *iface)
4168 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4171 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetDesc(ID3D10EffectStringVariable *iface,
4172 D3D10_EFFECT_VARIABLE_DESC *desc)
4174 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4177 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetAnnotationByIndex(
4178 ID3D10EffectStringVariable *iface, UINT index)
4180 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4183 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetAnnotationByName(
4184 ID3D10EffectStringVariable *iface, LPCSTR name)
4186 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4189 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberByIndex(
4190 ID3D10EffectStringVariable *iface, UINT index)
4192 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4195 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberByName(
4196 ID3D10EffectStringVariable *iface, LPCSTR name)
4198 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4201 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberBySemantic(
4202 ID3D10EffectStringVariable *iface, LPCSTR semantic)
4204 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4207 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetElement(
4208 ID3D10EffectStringVariable *iface, UINT index)
4210 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4213 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_string_variable_GetParentConstantBuffer(
4214 ID3D10EffectStringVariable *iface)
4216 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4219 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsScalar(
4220 ID3D10EffectStringVariable *iface)
4222 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4225 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsVector(
4226 ID3D10EffectStringVariable *iface)
4228 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4231 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsMatrix(
4232 ID3D10EffectStringVariable *iface)
4234 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4237 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsString(
4238 ID3D10EffectStringVariable *iface)
4240 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4243 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsShaderResource(
4244 ID3D10EffectStringVariable *iface)
4246 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4249 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsRenderTargetView(
4250 ID3D10EffectStringVariable *iface)
4252 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4255 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsDepthStencilView(
4256 ID3D10EffectStringVariable *iface)
4258 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4261 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_string_variable_AsConstantBuffer(
4262 ID3D10EffectStringVariable *iface)
4264 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4267 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsShader(
4268 ID3D10EffectStringVariable *iface)
4270 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4273 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsBlend(
4274 ID3D10EffectStringVariable *iface)
4276 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4279 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsDepthStencil(
4280 ID3D10EffectStringVariable *iface)
4282 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4285 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsRasterizer(
4286 ID3D10EffectStringVariable *iface)
4288 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4291 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsSampler(
4292 ID3D10EffectStringVariable *iface)
4294 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4297 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_SetRawValue(ID3D10EffectStringVariable *iface,
4298 void *data, UINT offset, UINT count)
4300 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4303 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetRawValue(ID3D10EffectStringVariable *iface,
4304 void *data, UINT offset, UINT count)
4306 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4309 /* ID3D10EffectStringVariable methods */
4311 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetString(ID3D10EffectStringVariable *iface,
4312 LPCSTR *str)
4314 FIXME("iface %p, str %p stub!\n", iface, str);
4316 return E_NOTIMPL;
4319 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetStringArray(ID3D10EffectStringVariable *iface,
4320 LPCSTR *strs, UINT offset, UINT count)
4322 FIXME("iface %p, strs %p, offset %u, count %u stub!\n", iface, strs, offset, count);
4324 return E_NOTIMPL;
4328 static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl =
4330 /* ID3D10EffectVariable methods */
4331 d3d10_effect_string_variable_IsValid,
4332 d3d10_effect_string_variable_GetType,
4333 d3d10_effect_string_variable_GetDesc,
4334 d3d10_effect_string_variable_GetAnnotationByIndex,
4335 d3d10_effect_string_variable_GetAnnotationByName,
4336 d3d10_effect_string_variable_GetMemberByIndex,
4337 d3d10_effect_string_variable_GetMemberByName,
4338 d3d10_effect_string_variable_GetMemberBySemantic,
4339 d3d10_effect_string_variable_GetElement,
4340 d3d10_effect_string_variable_GetParentConstantBuffer,
4341 d3d10_effect_string_variable_AsScalar,
4342 d3d10_effect_string_variable_AsVector,
4343 d3d10_effect_string_variable_AsMatrix,
4344 d3d10_effect_string_variable_AsString,
4345 d3d10_effect_string_variable_AsShaderResource,
4346 d3d10_effect_string_variable_AsRenderTargetView,
4347 d3d10_effect_string_variable_AsDepthStencilView,
4348 d3d10_effect_string_variable_AsConstantBuffer,
4349 d3d10_effect_string_variable_AsShader,
4350 d3d10_effect_string_variable_AsBlend,
4351 d3d10_effect_string_variable_AsDepthStencil,
4352 d3d10_effect_string_variable_AsRasterizer,
4353 d3d10_effect_string_variable_AsSampler,
4354 d3d10_effect_string_variable_SetRawValue,
4355 d3d10_effect_string_variable_GetRawValue,
4356 /* ID3D10EffectStringVariable methods */
4357 d3d10_effect_string_variable_GetString,
4358 d3d10_effect_string_variable_GetStringArray,
4361 /* ID3D10EffectVariable methods */
4363 static BOOL STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_IsValid(ID3D10EffectShaderResourceVariable *iface)
4365 TRACE("iface %p\n", iface);
4367 return (struct d3d10_effect_variable *)iface != &null_shader_resource_variable;
4370 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetType(
4371 ID3D10EffectShaderResourceVariable *iface)
4373 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4376 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetDesc(
4377 ID3D10EffectShaderResourceVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
4379 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4382 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetAnnotationByIndex(
4383 ID3D10EffectShaderResourceVariable *iface, UINT index)
4385 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4388 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetAnnotationByName(
4389 ID3D10EffectShaderResourceVariable *iface, LPCSTR name)
4391 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4394 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberByIndex(
4395 ID3D10EffectShaderResourceVariable *iface, UINT index)
4397 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4400 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberByName(
4401 ID3D10EffectShaderResourceVariable *iface, LPCSTR name)
4403 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4406 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberBySemantic(
4407 ID3D10EffectShaderResourceVariable *iface, LPCSTR semantic)
4409 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4412 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetElement(
4413 ID3D10EffectShaderResourceVariable *iface, UINT index)
4415 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4418 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetParentConstantBuffer(
4419 ID3D10EffectShaderResourceVariable *iface)
4421 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4424 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsScalar(
4425 ID3D10EffectShaderResourceVariable *iface)
4427 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4430 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsVector(
4431 ID3D10EffectShaderResourceVariable *iface)
4433 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4436 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsMatrix(
4437 ID3D10EffectShaderResourceVariable *iface)
4439 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4442 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsString(
4443 ID3D10EffectShaderResourceVariable *iface)
4445 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4448 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsShaderResource(
4449 ID3D10EffectShaderResourceVariable *iface)
4451 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4454 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsRenderTargetView(
4455 ID3D10EffectShaderResourceVariable *iface)
4457 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4460 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsDepthStencilView(
4461 ID3D10EffectShaderResourceVariable *iface)
4463 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4466 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsConstantBuffer(
4467 ID3D10EffectShaderResourceVariable *iface)
4469 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4472 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsShader(
4473 ID3D10EffectShaderResourceVariable *iface)
4475 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4478 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsBlend(
4479 ID3D10EffectShaderResourceVariable *iface)
4481 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4484 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsDepthStencil(
4485 ID3D10EffectShaderResourceVariable *iface)
4487 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4490 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsRasterizer(
4491 ID3D10EffectShaderResourceVariable *iface)
4493 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4496 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsSampler(
4497 ID3D10EffectShaderResourceVariable *iface)
4499 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4502 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetRawValue(
4503 ID3D10EffectShaderResourceVariable *iface, void *data, UINT offset, UINT count)
4505 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4508 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetRawValue(
4509 ID3D10EffectShaderResourceVariable *iface, void *data, UINT offset, UINT count)
4511 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4514 /* ID3D10EffectShaderResourceVariable methods */
4516 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetResource(
4517 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView *resource)
4519 FIXME("iface %p, resource %p stub!\n", iface, resource);
4521 return E_NOTIMPL;
4524 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetResource(
4525 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resource)
4527 FIXME("iface %p, resource %p stub!\n", iface, resource);
4529 return E_NOTIMPL;
4532 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetResourceArray(
4533 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resources, UINT offset, UINT count)
4535 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface, resources, offset, count);
4537 return E_NOTIMPL;
4540 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetResourceArray(
4541 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resources, UINT offset, UINT count)
4543 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface, resources, offset, count);
4545 return E_NOTIMPL;
4549 static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl =
4551 /* ID3D10EffectVariable methods */
4552 d3d10_effect_shader_resource_variable_IsValid,
4553 d3d10_effect_shader_resource_variable_GetType,
4554 d3d10_effect_shader_resource_variable_GetDesc,
4555 d3d10_effect_shader_resource_variable_GetAnnotationByIndex,
4556 d3d10_effect_shader_resource_variable_GetAnnotationByName,
4557 d3d10_effect_shader_resource_variable_GetMemberByIndex,
4558 d3d10_effect_shader_resource_variable_GetMemberByName,
4559 d3d10_effect_shader_resource_variable_GetMemberBySemantic,
4560 d3d10_effect_shader_resource_variable_GetElement,
4561 d3d10_effect_shader_resource_variable_GetParentConstantBuffer,
4562 d3d10_effect_shader_resource_variable_AsScalar,
4563 d3d10_effect_shader_resource_variable_AsVector,
4564 d3d10_effect_shader_resource_variable_AsMatrix,
4565 d3d10_effect_shader_resource_variable_AsString,
4566 d3d10_effect_shader_resource_variable_AsShaderResource,
4567 d3d10_effect_shader_resource_variable_AsRenderTargetView,
4568 d3d10_effect_shader_resource_variable_AsDepthStencilView,
4569 d3d10_effect_shader_resource_variable_AsConstantBuffer,
4570 d3d10_effect_shader_resource_variable_AsShader,
4571 d3d10_effect_shader_resource_variable_AsBlend,
4572 d3d10_effect_shader_resource_variable_AsDepthStencil,
4573 d3d10_effect_shader_resource_variable_AsRasterizer,
4574 d3d10_effect_shader_resource_variable_AsSampler,
4575 d3d10_effect_shader_resource_variable_SetRawValue,
4576 d3d10_effect_shader_resource_variable_GetRawValue,
4577 /* ID3D10EffectShaderResourceVariable methods */
4578 d3d10_effect_shader_resource_variable_SetResource,
4579 d3d10_effect_shader_resource_variable_GetResource,
4580 d3d10_effect_shader_resource_variable_SetResourceArray,
4581 d3d10_effect_shader_resource_variable_GetResourceArray,
4584 /* ID3D10EffectVariable methods */
4586 static BOOL STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_IsValid(
4587 ID3D10EffectRenderTargetViewVariable *iface)
4589 TRACE("iface %p\n", iface);
4591 return (struct d3d10_effect_variable *)iface != &null_render_target_view_variable;
4594 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetType(
4595 ID3D10EffectRenderTargetViewVariable *iface)
4597 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4600 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetDesc(
4601 ID3D10EffectRenderTargetViewVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
4603 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4606 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetAnnotationByIndex(
4607 ID3D10EffectRenderTargetViewVariable *iface, UINT index)
4609 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4612 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetAnnotationByName(
4613 ID3D10EffectRenderTargetViewVariable *iface, LPCSTR name)
4615 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4618 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberByIndex(
4619 ID3D10EffectRenderTargetViewVariable *iface, UINT index)
4621 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4624 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberByName(
4625 ID3D10EffectRenderTargetViewVariable *iface, LPCSTR name)
4627 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4630 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberBySemantic(
4631 ID3D10EffectRenderTargetViewVariable *iface, LPCSTR semantic)
4633 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4636 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetElement(
4637 ID3D10EffectRenderTargetViewVariable *iface, UINT index)
4639 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4642 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetParentConstantBuffer(
4643 ID3D10EffectRenderTargetViewVariable *iface)
4645 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4648 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsScalar(
4649 ID3D10EffectRenderTargetViewVariable *iface)
4651 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4654 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsVector(
4655 ID3D10EffectRenderTargetViewVariable *iface)
4657 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4660 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsMatrix(
4661 ID3D10EffectRenderTargetViewVariable *iface)
4663 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4666 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsString(
4667 ID3D10EffectRenderTargetViewVariable *iface)
4669 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4672 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsShaderResource(
4673 ID3D10EffectRenderTargetViewVariable *iface)
4675 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4678 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsRenderTargetView(
4679 ID3D10EffectRenderTargetViewVariable *iface)
4681 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4684 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsDepthStencilView(
4685 ID3D10EffectRenderTargetViewVariable *iface)
4687 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4690 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsConstantBuffer(
4691 ID3D10EffectRenderTargetViewVariable *iface)
4693 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4696 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsShader(
4697 ID3D10EffectRenderTargetViewVariable *iface)
4699 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4702 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsBlend(
4703 ID3D10EffectRenderTargetViewVariable *iface)
4705 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4708 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsDepthStencil(
4709 ID3D10EffectRenderTargetViewVariable *iface)
4711 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4714 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsRasterizer(
4715 ID3D10EffectRenderTargetViewVariable *iface)
4717 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4720 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsSampler(
4721 ID3D10EffectRenderTargetViewVariable *iface)
4723 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4726 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRawValue(
4727 ID3D10EffectRenderTargetViewVariable *iface, void *data, UINT offset, UINT count)
4729 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4732 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRawValue(
4733 ID3D10EffectRenderTargetViewVariable *iface, void *data, UINT offset, UINT count)
4735 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4738 /* ID3D10EffectRenderTargetViewVariable methods */
4740 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRenderTarget(
4741 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView *view)
4743 FIXME("iface %p, view %p stub!\n", iface, view);
4745 return E_NOTIMPL;
4748 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRenderTarget(
4749 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **view)
4751 FIXME("iface %p, view %p stub!\n", iface, view);
4753 return E_NOTIMPL;
4756 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRenderTargetArray(
4757 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **views, UINT offset, UINT count)
4759 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
4761 return E_NOTIMPL;
4764 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRenderTargetArray(
4765 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **views, UINT offset, UINT count)
4767 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
4769 return E_NOTIMPL;
4773 static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl =
4775 /* ID3D10EffectVariable methods */
4776 d3d10_effect_render_target_view_variable_IsValid,
4777 d3d10_effect_render_target_view_variable_GetType,
4778 d3d10_effect_render_target_view_variable_GetDesc,
4779 d3d10_effect_render_target_view_variable_GetAnnotationByIndex,
4780 d3d10_effect_render_target_view_variable_GetAnnotationByName,
4781 d3d10_effect_render_target_view_variable_GetMemberByIndex,
4782 d3d10_effect_render_target_view_variable_GetMemberByName,
4783 d3d10_effect_render_target_view_variable_GetMemberBySemantic,
4784 d3d10_effect_render_target_view_variable_GetElement,
4785 d3d10_effect_render_target_view_variable_GetParentConstantBuffer,
4786 d3d10_effect_render_target_view_variable_AsScalar,
4787 d3d10_effect_render_target_view_variable_AsVector,
4788 d3d10_effect_render_target_view_variable_AsMatrix,
4789 d3d10_effect_render_target_view_variable_AsString,
4790 d3d10_effect_render_target_view_variable_AsShaderResource,
4791 d3d10_effect_render_target_view_variable_AsRenderTargetView,
4792 d3d10_effect_render_target_view_variable_AsDepthStencilView,
4793 d3d10_effect_render_target_view_variable_AsConstantBuffer,
4794 d3d10_effect_render_target_view_variable_AsShader,
4795 d3d10_effect_render_target_view_variable_AsBlend,
4796 d3d10_effect_render_target_view_variable_AsDepthStencil,
4797 d3d10_effect_render_target_view_variable_AsRasterizer,
4798 d3d10_effect_render_target_view_variable_AsSampler,
4799 d3d10_effect_render_target_view_variable_SetRawValue,
4800 d3d10_effect_render_target_view_variable_GetRawValue,
4801 /* ID3D10EffectRenderTargetViewVariable methods */
4802 d3d10_effect_render_target_view_variable_SetRenderTarget,
4803 d3d10_effect_render_target_view_variable_GetRenderTarget,
4804 d3d10_effect_render_target_view_variable_SetRenderTargetArray,
4805 d3d10_effect_render_target_view_variable_GetRenderTargetArray,
4808 /* ID3D10EffectVariable methods */
4810 static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_IsValid(
4811 ID3D10EffectDepthStencilViewVariable *iface)
4813 TRACE("iface %p\n", iface);
4815 return (struct d3d10_effect_variable *)iface != &null_depth_stencil_view_variable;
4818 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetType(
4819 ID3D10EffectDepthStencilViewVariable *iface)
4821 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4824 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDesc(
4825 ID3D10EffectDepthStencilViewVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
4827 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4830 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex(
4831 ID3D10EffectDepthStencilViewVariable *iface, UINT index)
4833 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4836 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetAnnotationByName(
4837 ID3D10EffectDepthStencilViewVariable *iface, LPCSTR name)
4839 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4842 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberByIndex(
4843 ID3D10EffectDepthStencilViewVariable *iface, UINT index)
4845 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4848 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberByName(
4849 ID3D10EffectDepthStencilViewVariable *iface, LPCSTR name)
4851 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4854 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic(
4855 ID3D10EffectDepthStencilViewVariable *iface, LPCSTR semantic)
4857 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4860 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetElement(
4861 ID3D10EffectDepthStencilViewVariable *iface, UINT index)
4863 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4866 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer(
4867 ID3D10EffectDepthStencilViewVariable *iface)
4869 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4872 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsScalar(
4873 ID3D10EffectDepthStencilViewVariable *iface)
4875 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4878 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsVector(
4879 ID3D10EffectDepthStencilViewVariable *iface)
4881 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4884 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsMatrix(
4885 ID3D10EffectDepthStencilViewVariable *iface)
4887 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4890 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsString(
4891 ID3D10EffectDepthStencilViewVariable *iface)
4893 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4896 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsShaderResource(
4897 ID3D10EffectDepthStencilViewVariable *iface)
4899 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4902 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsRenderTargetView(
4903 ID3D10EffectDepthStencilViewVariable *iface)
4905 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4908 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsDepthStencilView(
4909 ID3D10EffectDepthStencilViewVariable *iface)
4911 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4914 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsConstantBuffer(
4915 ID3D10EffectDepthStencilViewVariable *iface)
4917 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4920 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsShader(
4921 ID3D10EffectDepthStencilViewVariable *iface)
4923 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4926 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsBlend(
4927 ID3D10EffectDepthStencilViewVariable *iface)
4929 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4932 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsDepthStencil(
4933 ID3D10EffectDepthStencilViewVariable *iface)
4935 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4938 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsRasterizer(
4939 ID3D10EffectDepthStencilViewVariable *iface)
4941 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4944 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsSampler(
4945 ID3D10EffectDepthStencilViewVariable *iface)
4947 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4950 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetRawValue(
4951 ID3D10EffectDepthStencilViewVariable *iface, void *data, UINT offset, UINT count)
4953 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4956 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetRawValue(
4957 ID3D10EffectDepthStencilViewVariable *iface, void *data, UINT offset, UINT count)
4959 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4962 /* ID3D10EffectDepthStencilViewVariable methods */
4964 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetDepthStencil(
4965 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView *view)
4967 FIXME("iface %p, view %p stub!\n", iface, view);
4969 return E_NOTIMPL;
4972 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDepthStencil(
4973 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **view)
4975 FIXME("iface %p, view %p stub!\n", iface, view);
4977 return E_NOTIMPL;
4980 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray(
4981 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **views, UINT offset, UINT count)
4983 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
4985 return E_NOTIMPL;
4988 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray(
4989 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **views, UINT offset, UINT count)
4991 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
4993 return E_NOTIMPL;
4997 static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl =
4999 /* ID3D10EffectVariable methods */
5000 d3d10_effect_depth_stencil_view_variable_IsValid,
5001 d3d10_effect_depth_stencil_view_variable_GetType,
5002 d3d10_effect_depth_stencil_view_variable_GetDesc,
5003 d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex,
5004 d3d10_effect_depth_stencil_view_variable_GetAnnotationByName,
5005 d3d10_effect_depth_stencil_view_variable_GetMemberByIndex,
5006 d3d10_effect_depth_stencil_view_variable_GetMemberByName,
5007 d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic,
5008 d3d10_effect_depth_stencil_view_variable_GetElement,
5009 d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer,
5010 d3d10_effect_depth_stencil_view_variable_AsScalar,
5011 d3d10_effect_depth_stencil_view_variable_AsVector,
5012 d3d10_effect_depth_stencil_view_variable_AsMatrix,
5013 d3d10_effect_depth_stencil_view_variable_AsString,
5014 d3d10_effect_depth_stencil_view_variable_AsShaderResource,
5015 d3d10_effect_depth_stencil_view_variable_AsRenderTargetView,
5016 d3d10_effect_depth_stencil_view_variable_AsDepthStencilView,
5017 d3d10_effect_depth_stencil_view_variable_AsConstantBuffer,
5018 d3d10_effect_depth_stencil_view_variable_AsShader,
5019 d3d10_effect_depth_stencil_view_variable_AsBlend,
5020 d3d10_effect_depth_stencil_view_variable_AsDepthStencil,
5021 d3d10_effect_depth_stencil_view_variable_AsRasterizer,
5022 d3d10_effect_depth_stencil_view_variable_AsSampler,
5023 d3d10_effect_depth_stencil_view_variable_SetRawValue,
5024 d3d10_effect_depth_stencil_view_variable_GetRawValue,
5025 /* ID3D10EffectDepthStencilViewVariable methods */
5026 d3d10_effect_depth_stencil_view_variable_SetDepthStencil,
5027 d3d10_effect_depth_stencil_view_variable_GetDepthStencil,
5028 d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray,
5029 d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray,
5032 /* ID3D10EffectVariable methods */
5034 static BOOL STDMETHODCALLTYPE d3d10_effect_shader_variable_IsValid(ID3D10EffectShaderVariable *iface)
5036 TRACE("iface %p\n", iface);
5038 return (struct d3d10_effect_variable *)iface != &null_shader_variable;
5041 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetType(
5042 ID3D10EffectShaderVariable *iface)
5044 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5047 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetDesc(ID3D10EffectShaderVariable *iface,
5048 D3D10_EFFECT_VARIABLE_DESC *desc)
5050 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5053 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetAnnotationByIndex(
5054 ID3D10EffectShaderVariable *iface, UINT index)
5056 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5059 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetAnnotationByName(
5060 ID3D10EffectShaderVariable *iface, LPCSTR name)
5062 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5065 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberByIndex(
5066 ID3D10EffectShaderVariable *iface, UINT index)
5068 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5071 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberByName(
5072 ID3D10EffectShaderVariable *iface, LPCSTR name)
5074 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5077 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberBySemantic(
5078 ID3D10EffectShaderVariable *iface, LPCSTR semantic)
5080 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5083 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetElement(
5084 ID3D10EffectShaderVariable *iface, UINT index)
5086 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5089 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetParentConstantBuffer(
5090 ID3D10EffectShaderVariable *iface)
5092 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5095 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsScalar(
5096 ID3D10EffectShaderVariable *iface)
5098 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5101 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsVector(
5102 ID3D10EffectShaderVariable *iface)
5104 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5107 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsMatrix(
5108 ID3D10EffectShaderVariable *iface)
5110 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5113 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsString(
5114 ID3D10EffectShaderVariable *iface)
5116 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5119 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsShaderResource(
5120 ID3D10EffectShaderVariable *iface)
5122 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5125 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsRenderTargetView(
5126 ID3D10EffectShaderVariable *iface)
5128 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5131 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsDepthStencilView(
5132 ID3D10EffectShaderVariable *iface)
5134 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5137 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsConstantBuffer(
5138 ID3D10EffectShaderVariable *iface)
5140 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5143 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsShader(
5144 ID3D10EffectShaderVariable *iface)
5146 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5149 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsBlend(
5150 ID3D10EffectShaderVariable *iface)
5152 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5155 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsDepthStencil(
5156 ID3D10EffectShaderVariable *iface)
5158 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5161 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsRasterizer(
5162 ID3D10EffectShaderVariable *iface)
5164 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5167 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsSampler(
5168 ID3D10EffectShaderVariable *iface)
5170 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5173 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_SetRawValue(
5174 ID3D10EffectShaderVariable *iface, void *data, UINT offset, UINT count)
5176 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5179 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetRawValue(
5180 ID3D10EffectShaderVariable *iface, void *data, UINT offset, UINT count)
5182 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5185 /* ID3D10EffectShaderVariable methods */
5187 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetShaderDesc(
5188 ID3D10EffectShaderVariable *iface, UINT index, D3D10_EFFECT_SHADER_DESC *desc)
5190 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5192 return E_NOTIMPL;
5195 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetVertexShader(
5196 ID3D10EffectShaderVariable *iface, UINT index, ID3D10VertexShader **shader)
5198 FIXME("iface %p, index %u, shader %p stub!\n", iface, index, shader);
5200 return E_NOTIMPL;
5203 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetGeometryShader(
5204 ID3D10EffectShaderVariable *iface, UINT index, ID3D10GeometryShader **shader)
5206 FIXME("iface %p, index %u, shader %p stub!\n", iface, index, shader);
5208 return E_NOTIMPL;
5211 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetPixelShader(
5212 ID3D10EffectShaderVariable *iface, UINT index, ID3D10PixelShader **shader)
5214 FIXME("iface %p, index %u, shader %p stub!\n", iface, index, shader);
5216 return E_NOTIMPL;
5219 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetInputSignatureElementDesc(
5220 ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index,
5221 D3D10_SIGNATURE_PARAMETER_DESC *desc)
5223 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
5224 struct d3d10_effect_shader_variable *s;
5225 D3D10_SIGNATURE_PARAMETER_DESC *d;
5227 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5228 iface, shader_index, element_index, desc);
5230 if (!iface->lpVtbl->IsValid(iface))
5232 WARN("Null variable specified\n");
5233 return E_FAIL;
5236 /* Check shader_index, this crashes on W7/DX10 */
5237 if (shader_index >= This->effect->used_shader_count)
5239 WARN("This should crash on W7/DX10!\n");
5240 return E_FAIL;
5243 s = This->effect->used_shaders[shader_index]->data;
5244 if (!s->input_signature.signature)
5246 WARN("No shader signature\n");
5247 return D3DERR_INVALIDCALL;
5250 /* Check desc for NULL, this crashes on W7/DX10 */
5251 if (!desc)
5253 WARN("This should crash on W7/DX10!\n");
5254 return E_FAIL;
5257 if (element_index >= s->input_signature.element_count)
5259 WARN("Invalid element index specified\n");
5260 return E_INVALIDARG;
5263 d = &s->input_signature.elements[element_index];
5264 desc->SemanticName = d->SemanticName;
5265 desc->SemanticIndex = d->SemanticIndex;
5266 desc->SystemValueType = d->SystemValueType;
5267 desc->ComponentType = d->ComponentType;
5268 desc->Register = d->Register;
5269 desc->ReadWriteMask = d->ReadWriteMask;
5270 desc->Mask = d->Mask;
5272 return S_OK;
5275 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetOutputSignatureElementDesc(
5276 ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index,
5277 D3D10_SIGNATURE_PARAMETER_DESC *desc)
5279 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
5280 struct d3d10_effect_shader_variable *s;
5281 D3D10_SIGNATURE_PARAMETER_DESC *d;
5283 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5284 iface, shader_index, element_index, desc);
5286 if (!iface->lpVtbl->IsValid(iface))
5288 WARN("Null variable specified\n");
5289 return E_FAIL;
5292 /* Check shader_index, this crashes on W7/DX10 */
5293 if (shader_index >= This->effect->used_shader_count)
5295 WARN("This should crash on W7/DX10!\n");
5296 return E_FAIL;
5299 s = This->effect->used_shaders[shader_index]->data;
5300 if (!s->output_signature.signature)
5302 WARN("No shader signature\n");
5303 return D3DERR_INVALIDCALL;
5306 /* Check desc for NULL, this crashes on W7/DX10 */
5307 if (!desc)
5309 WARN("This should crash on W7/DX10!\n");
5310 return E_FAIL;
5313 if (element_index >= s->output_signature.element_count)
5315 WARN("Invalid element index specified\n");
5316 return E_INVALIDARG;
5319 d = &s->output_signature.elements[element_index];
5320 desc->SemanticName = d->SemanticName;
5321 desc->SemanticIndex = d->SemanticIndex;
5322 desc->SystemValueType = d->SystemValueType;
5323 desc->ComponentType = d->ComponentType;
5324 desc->Register = d->Register;
5325 desc->ReadWriteMask = d->ReadWriteMask;
5326 desc->Mask = d->Mask;
5328 return S_OK;
5332 static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl =
5334 /* ID3D10EffectVariable methods */
5335 d3d10_effect_shader_variable_IsValid,
5336 d3d10_effect_shader_variable_GetType,
5337 d3d10_effect_shader_variable_GetDesc,
5338 d3d10_effect_shader_variable_GetAnnotationByIndex,
5339 d3d10_effect_shader_variable_GetAnnotationByName,
5340 d3d10_effect_shader_variable_GetMemberByIndex,
5341 d3d10_effect_shader_variable_GetMemberByName,
5342 d3d10_effect_shader_variable_GetMemberBySemantic,
5343 d3d10_effect_shader_variable_GetElement,
5344 d3d10_effect_shader_variable_GetParentConstantBuffer,
5345 d3d10_effect_shader_variable_AsScalar,
5346 d3d10_effect_shader_variable_AsVector,
5347 d3d10_effect_shader_variable_AsMatrix,
5348 d3d10_effect_shader_variable_AsString,
5349 d3d10_effect_shader_variable_AsShaderResource,
5350 d3d10_effect_shader_variable_AsRenderTargetView,
5351 d3d10_effect_shader_variable_AsDepthStencilView,
5352 d3d10_effect_shader_variable_AsConstantBuffer,
5353 d3d10_effect_shader_variable_AsShader,
5354 d3d10_effect_shader_variable_AsBlend,
5355 d3d10_effect_shader_variable_AsDepthStencil,
5356 d3d10_effect_shader_variable_AsRasterizer,
5357 d3d10_effect_shader_variable_AsSampler,
5358 d3d10_effect_shader_variable_SetRawValue,
5359 d3d10_effect_shader_variable_GetRawValue,
5360 /* ID3D10EffectShaderVariable methods */
5361 d3d10_effect_shader_variable_GetShaderDesc,
5362 d3d10_effect_shader_variable_GetVertexShader,
5363 d3d10_effect_shader_variable_GetGeometryShader,
5364 d3d10_effect_shader_variable_GetPixelShader,
5365 d3d10_effect_shader_variable_GetInputSignatureElementDesc,
5366 d3d10_effect_shader_variable_GetOutputSignatureElementDesc,
5369 /* ID3D10EffectVariable methods */
5371 static BOOL STDMETHODCALLTYPE d3d10_effect_blend_variable_IsValid(ID3D10EffectBlendVariable *iface)
5373 TRACE("iface %p\n", iface);
5375 return (struct d3d10_effect_variable *)iface != &null_blend_variable;
5378 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetType(
5379 ID3D10EffectBlendVariable *iface)
5381 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5384 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetDesc(ID3D10EffectBlendVariable *iface,
5385 D3D10_EFFECT_VARIABLE_DESC *desc)
5387 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5390 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetAnnotationByIndex(
5391 ID3D10EffectBlendVariable *iface, UINT index)
5393 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5396 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetAnnotationByName(
5397 ID3D10EffectBlendVariable *iface, LPCSTR name)
5399 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5402 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberByIndex(
5403 ID3D10EffectBlendVariable *iface, UINT index)
5405 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5408 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberByName(
5409 ID3D10EffectBlendVariable *iface, LPCSTR name)
5411 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5414 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberBySemantic(
5415 ID3D10EffectBlendVariable *iface, LPCSTR semantic)
5417 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5420 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetElement(
5421 ID3D10EffectBlendVariable *iface, UINT index)
5423 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5426 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetParentConstantBuffer(
5427 ID3D10EffectBlendVariable *iface)
5429 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5432 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsScalar(
5433 ID3D10EffectBlendVariable *iface)
5435 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5438 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsVector(
5439 ID3D10EffectBlendVariable *iface)
5441 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5444 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsMatrix(
5445 ID3D10EffectBlendVariable *iface)
5447 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5450 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsString(
5451 ID3D10EffectBlendVariable *iface)
5453 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5456 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsShaderResource(
5457 ID3D10EffectBlendVariable *iface)
5459 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5462 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsRenderTargetView(
5463 ID3D10EffectBlendVariable *iface)
5465 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5468 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsDepthStencilView(
5469 ID3D10EffectBlendVariable *iface)
5471 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5474 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsConstantBuffer(
5475 ID3D10EffectBlendVariable *iface)
5477 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5480 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsShader(
5481 ID3D10EffectBlendVariable *iface)
5483 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5486 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsBlend(
5487 ID3D10EffectBlendVariable *iface)
5489 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5492 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsDepthStencil(
5493 ID3D10EffectBlendVariable *iface)
5495 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5498 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsRasterizer(
5499 ID3D10EffectBlendVariable *iface)
5501 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5504 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsSampler(
5505 ID3D10EffectBlendVariable *iface)
5507 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5510 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_SetRawValue(ID3D10EffectBlendVariable *iface,
5511 void *data, UINT offset, UINT count)
5513 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5516 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetRawValue(ID3D10EffectBlendVariable *iface,
5517 void *data, UINT offset, UINT count)
5519 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5522 /* ID3D10EffectBlendVariable methods */
5524 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBlendState(ID3D10EffectBlendVariable *iface,
5525 UINT index, ID3D10BlendState **blend_state)
5527 FIXME("iface %p, index %u, blend_state %p stub!\n", iface, index, blend_state);
5529 return E_NOTIMPL;
5532 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBackingStore(ID3D10EffectBlendVariable *iface,
5533 UINT index, D3D10_BLEND_DESC *desc)
5535 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5537 return E_NOTIMPL;
5541 static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl =
5543 /* ID3D10EffectVariable methods */
5544 d3d10_effect_blend_variable_IsValid,
5545 d3d10_effect_blend_variable_GetType,
5546 d3d10_effect_blend_variable_GetDesc,
5547 d3d10_effect_blend_variable_GetAnnotationByIndex,
5548 d3d10_effect_blend_variable_GetAnnotationByName,
5549 d3d10_effect_blend_variable_GetMemberByIndex,
5550 d3d10_effect_blend_variable_GetMemberByName,
5551 d3d10_effect_blend_variable_GetMemberBySemantic,
5552 d3d10_effect_blend_variable_GetElement,
5553 d3d10_effect_blend_variable_GetParentConstantBuffer,
5554 d3d10_effect_blend_variable_AsScalar,
5555 d3d10_effect_blend_variable_AsVector,
5556 d3d10_effect_blend_variable_AsMatrix,
5557 d3d10_effect_blend_variable_AsString,
5558 d3d10_effect_blend_variable_AsShaderResource,
5559 d3d10_effect_blend_variable_AsRenderTargetView,
5560 d3d10_effect_blend_variable_AsDepthStencilView,
5561 d3d10_effect_blend_variable_AsConstantBuffer,
5562 d3d10_effect_blend_variable_AsShader,
5563 d3d10_effect_blend_variable_AsBlend,
5564 d3d10_effect_blend_variable_AsDepthStencil,
5565 d3d10_effect_blend_variable_AsRasterizer,
5566 d3d10_effect_blend_variable_AsSampler,
5567 d3d10_effect_blend_variable_SetRawValue,
5568 d3d10_effect_blend_variable_GetRawValue,
5569 /* ID3D10EffectBlendVariable methods */
5570 d3d10_effect_blend_variable_GetBlendState,
5571 d3d10_effect_blend_variable_GetBackingStore,
5574 /* ID3D10EffectVariable methods */
5576 static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_IsValid(ID3D10EffectDepthStencilVariable *iface)
5578 TRACE("iface %p\n", iface);
5580 return (struct d3d10_effect_variable *)iface != &null_depth_stencil_variable;
5583 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetType(
5584 ID3D10EffectDepthStencilVariable *iface)
5586 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5589 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetDesc(ID3D10EffectDepthStencilVariable *iface,
5590 D3D10_EFFECT_VARIABLE_DESC *desc)
5592 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5595 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetAnnotationByIndex(
5596 ID3D10EffectDepthStencilVariable *iface, UINT index)
5598 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5601 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetAnnotationByName(
5602 ID3D10EffectDepthStencilVariable *iface, LPCSTR name)
5604 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5607 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberByIndex(
5608 ID3D10EffectDepthStencilVariable *iface, UINT index)
5610 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5613 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberByName(
5614 ID3D10EffectDepthStencilVariable *iface, LPCSTR name)
5616 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5619 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberBySemantic(
5620 ID3D10EffectDepthStencilVariable *iface, LPCSTR semantic)
5622 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5625 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetElement(
5626 ID3D10EffectDepthStencilVariable *iface, UINT index)
5628 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5631 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetParentConstantBuffer(
5632 ID3D10EffectDepthStencilVariable *iface)
5634 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5637 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsScalar(
5638 ID3D10EffectDepthStencilVariable *iface)
5640 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5643 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsVector(
5644 ID3D10EffectDepthStencilVariable *iface)
5646 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5649 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsMatrix(
5650 ID3D10EffectDepthStencilVariable *iface)
5652 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5655 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsString(
5656 ID3D10EffectDepthStencilVariable *iface)
5658 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5661 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsShaderResource(
5662 ID3D10EffectDepthStencilVariable *iface)
5664 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5667 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsRenderTargetView(
5668 ID3D10EffectDepthStencilVariable *iface)
5670 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5673 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsDepthStencilView(
5674 ID3D10EffectDepthStencilVariable *iface)
5676 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5679 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsConstantBuffer(
5680 ID3D10EffectDepthStencilVariable *iface)
5682 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5685 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsShader(
5686 ID3D10EffectDepthStencilVariable *iface)
5688 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5691 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsBlend(
5692 ID3D10EffectDepthStencilVariable *iface)
5694 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5697 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsDepthStencil(
5698 ID3D10EffectDepthStencilVariable *iface)
5700 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5703 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsRasterizer(
5704 ID3D10EffectDepthStencilVariable *iface)
5706 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5709 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsSampler(
5710 ID3D10EffectDepthStencilVariable *iface)
5712 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5715 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_SetRawValue(ID3D10EffectDepthStencilVariable *iface,
5716 void *data, UINT offset, UINT count)
5718 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5721 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetRawValue(ID3D10EffectDepthStencilVariable *iface,
5722 void *data, UINT offset, UINT count)
5724 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5727 /* ID3D10EffectDepthStencilVariable methods */
5729 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetDepthStencilState(ID3D10EffectDepthStencilVariable *iface,
5730 UINT index, ID3D10DepthStencilState **depth_stencil_state)
5732 FIXME("iface %p, index %u, depth_stencil_state %p stub!\n", iface, index, depth_stencil_state);
5734 return E_NOTIMPL;
5737 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetBackingStore(ID3D10EffectDepthStencilVariable *iface,
5738 UINT index, D3D10_DEPTH_STENCIL_DESC *desc)
5740 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5742 return E_NOTIMPL;
5746 static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl =
5748 /* ID3D10EffectVariable methods */
5749 d3d10_effect_depth_stencil_variable_IsValid,
5750 d3d10_effect_depth_stencil_variable_GetType,
5751 d3d10_effect_depth_stencil_variable_GetDesc,
5752 d3d10_effect_depth_stencil_variable_GetAnnotationByIndex,
5753 d3d10_effect_depth_stencil_variable_GetAnnotationByName,
5754 d3d10_effect_depth_stencil_variable_GetMemberByIndex,
5755 d3d10_effect_depth_stencil_variable_GetMemberByName,
5756 d3d10_effect_depth_stencil_variable_GetMemberBySemantic,
5757 d3d10_effect_depth_stencil_variable_GetElement,
5758 d3d10_effect_depth_stencil_variable_GetParentConstantBuffer,
5759 d3d10_effect_depth_stencil_variable_AsScalar,
5760 d3d10_effect_depth_stencil_variable_AsVector,
5761 d3d10_effect_depth_stencil_variable_AsMatrix,
5762 d3d10_effect_depth_stencil_variable_AsString,
5763 d3d10_effect_depth_stencil_variable_AsShaderResource,
5764 d3d10_effect_depth_stencil_variable_AsRenderTargetView,
5765 d3d10_effect_depth_stencil_variable_AsDepthStencilView,
5766 d3d10_effect_depth_stencil_variable_AsConstantBuffer,
5767 d3d10_effect_depth_stencil_variable_AsShader,
5768 d3d10_effect_depth_stencil_variable_AsBlend,
5769 d3d10_effect_depth_stencil_variable_AsDepthStencil,
5770 d3d10_effect_depth_stencil_variable_AsRasterizer,
5771 d3d10_effect_depth_stencil_variable_AsSampler,
5772 d3d10_effect_depth_stencil_variable_SetRawValue,
5773 d3d10_effect_depth_stencil_variable_GetRawValue,
5774 /* ID3D10EffectDepthStencilVariable methods */
5775 d3d10_effect_depth_stencil_variable_GetDepthStencilState,
5776 d3d10_effect_depth_stencil_variable_GetBackingStore,
5779 /* ID3D10EffectVariable methods */
5781 static BOOL STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_IsValid(ID3D10EffectRasterizerVariable *iface)
5783 TRACE("iface %p\n", iface);
5785 return (struct d3d10_effect_variable *)iface != &null_rasterizer_variable;
5788 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetType(
5789 ID3D10EffectRasterizerVariable *iface)
5791 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5794 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetDesc(ID3D10EffectRasterizerVariable *iface,
5795 D3D10_EFFECT_VARIABLE_DESC *desc)
5797 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5800 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetAnnotationByIndex(
5801 ID3D10EffectRasterizerVariable *iface, UINT index)
5803 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5806 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetAnnotationByName(
5807 ID3D10EffectRasterizerVariable *iface, LPCSTR name)
5809 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5812 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberByIndex(
5813 ID3D10EffectRasterizerVariable *iface, UINT index)
5815 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5818 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberByName(
5819 ID3D10EffectRasterizerVariable *iface, LPCSTR name)
5821 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5824 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberBySemantic(
5825 ID3D10EffectRasterizerVariable *iface, LPCSTR semantic)
5827 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5830 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetElement(
5831 ID3D10EffectRasterizerVariable *iface, UINT index)
5833 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5836 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetParentConstantBuffer(
5837 ID3D10EffectRasterizerVariable *iface)
5839 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5842 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsScalar(
5843 ID3D10EffectRasterizerVariable *iface)
5845 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5848 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsVector(
5849 ID3D10EffectRasterizerVariable *iface)
5851 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5854 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsMatrix(
5855 ID3D10EffectRasterizerVariable *iface)
5857 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5860 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsString(
5861 ID3D10EffectRasterizerVariable *iface)
5863 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5866 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsShaderResource(
5867 ID3D10EffectRasterizerVariable *iface)
5869 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5872 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsRenderTargetView(
5873 ID3D10EffectRasterizerVariable *iface)
5875 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5878 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsDepthStencilView(
5879 ID3D10EffectRasterizerVariable *iface)
5881 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5884 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsConstantBuffer(
5885 ID3D10EffectRasterizerVariable *iface)
5887 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5890 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsShader(
5891 ID3D10EffectRasterizerVariable *iface)
5893 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5896 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsBlend(
5897 ID3D10EffectRasterizerVariable *iface)
5899 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5902 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsDepthStencil(
5903 ID3D10EffectRasterizerVariable *iface)
5905 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5908 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsRasterizer(
5909 ID3D10EffectRasterizerVariable *iface)
5911 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5914 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsSampler(
5915 ID3D10EffectRasterizerVariable *iface)
5917 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5920 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_SetRawValue(ID3D10EffectRasterizerVariable *iface,
5921 void *data, UINT offset, UINT count)
5923 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5926 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetRawValue(ID3D10EffectRasterizerVariable *iface,
5927 void *data, UINT offset, UINT count)
5929 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5932 /* ID3D10EffectRasterizerVariable methods */
5934 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetRasterizerState(ID3D10EffectRasterizerVariable *iface,
5935 UINT index, ID3D10RasterizerState **rasterizer_state)
5937 FIXME("iface %p, index %u, rasterizer_state %p stub!\n", iface, index, rasterizer_state);
5939 return E_NOTIMPL;
5942 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetBackingStore(ID3D10EffectRasterizerVariable *iface,
5943 UINT index, D3D10_RASTERIZER_DESC *desc)
5945 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5947 return E_NOTIMPL;
5951 static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl =
5953 /* ID3D10EffectVariable methods */
5954 d3d10_effect_rasterizer_variable_IsValid,
5955 d3d10_effect_rasterizer_variable_GetType,
5956 d3d10_effect_rasterizer_variable_GetDesc,
5957 d3d10_effect_rasterizer_variable_GetAnnotationByIndex,
5958 d3d10_effect_rasterizer_variable_GetAnnotationByName,
5959 d3d10_effect_rasterizer_variable_GetMemberByIndex,
5960 d3d10_effect_rasterizer_variable_GetMemberByName,
5961 d3d10_effect_rasterizer_variable_GetMemberBySemantic,
5962 d3d10_effect_rasterizer_variable_GetElement,
5963 d3d10_effect_rasterizer_variable_GetParentConstantBuffer,
5964 d3d10_effect_rasterizer_variable_AsScalar,
5965 d3d10_effect_rasterizer_variable_AsVector,
5966 d3d10_effect_rasterizer_variable_AsMatrix,
5967 d3d10_effect_rasterizer_variable_AsString,
5968 d3d10_effect_rasterizer_variable_AsShaderResource,
5969 d3d10_effect_rasterizer_variable_AsRenderTargetView,
5970 d3d10_effect_rasterizer_variable_AsDepthStencilView,
5971 d3d10_effect_rasterizer_variable_AsConstantBuffer,
5972 d3d10_effect_rasterizer_variable_AsShader,
5973 d3d10_effect_rasterizer_variable_AsBlend,
5974 d3d10_effect_rasterizer_variable_AsDepthStencil,
5975 d3d10_effect_rasterizer_variable_AsRasterizer,
5976 d3d10_effect_rasterizer_variable_AsSampler,
5977 d3d10_effect_rasterizer_variable_SetRawValue,
5978 d3d10_effect_rasterizer_variable_GetRawValue,
5979 /* ID3D10EffectRasterizerVariable methods */
5980 d3d10_effect_rasterizer_variable_GetRasterizerState,
5981 d3d10_effect_rasterizer_variable_GetBackingStore,
5984 /* ID3D10EffectVariable methods */
5986 static BOOL STDMETHODCALLTYPE d3d10_effect_sampler_variable_IsValid(ID3D10EffectSamplerVariable *iface)
5988 TRACE("iface %p\n", iface);
5990 return (struct d3d10_effect_variable *)iface != &null_sampler_variable;
5993 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetType(
5994 ID3D10EffectSamplerVariable *iface)
5996 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5999 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetDesc(ID3D10EffectSamplerVariable *iface,
6000 D3D10_EFFECT_VARIABLE_DESC *desc)
6002 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
6005 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetAnnotationByIndex(
6006 ID3D10EffectSamplerVariable *iface, UINT index)
6008 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
6011 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetAnnotationByName(
6012 ID3D10EffectSamplerVariable *iface, LPCSTR name)
6014 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
6017 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberByIndex(
6018 ID3D10EffectSamplerVariable *iface, UINT index)
6020 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
6023 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberByName(
6024 ID3D10EffectSamplerVariable *iface, LPCSTR name)
6026 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
6029 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberBySemantic(
6030 ID3D10EffectSamplerVariable *iface, LPCSTR semantic)
6032 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
6035 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetElement(
6036 ID3D10EffectSamplerVariable *iface, UINT index)
6038 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
6041 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetParentConstantBuffer(
6042 ID3D10EffectSamplerVariable *iface)
6044 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
6047 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsScalar(
6048 ID3D10EffectSamplerVariable *iface)
6050 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
6053 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsVector(
6054 ID3D10EffectSamplerVariable *iface)
6056 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
6059 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsMatrix(
6060 ID3D10EffectSamplerVariable *iface)
6062 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
6065 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsString(
6066 ID3D10EffectSamplerVariable *iface)
6068 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
6071 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsShaderResource(
6072 ID3D10EffectSamplerVariable *iface)
6074 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
6077 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsRenderTargetView(
6078 ID3D10EffectSamplerVariable *iface)
6080 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
6083 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsDepthStencilView(
6084 ID3D10EffectSamplerVariable *iface)
6086 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
6089 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsConstantBuffer(
6090 ID3D10EffectSamplerVariable *iface)
6092 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
6095 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsShader(
6096 ID3D10EffectSamplerVariable *iface)
6098 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
6101 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsBlend(
6102 ID3D10EffectSamplerVariable *iface)
6104 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
6107 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsDepthStencil(
6108 ID3D10EffectSamplerVariable *iface)
6110 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
6113 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsRasterizer(
6114 ID3D10EffectSamplerVariable *iface)
6116 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
6119 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsSampler(
6120 ID3D10EffectSamplerVariable *iface)
6122 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
6125 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_SetRawValue(ID3D10EffectSamplerVariable *iface,
6126 void *data, UINT offset, UINT count)
6128 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6131 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetRawValue(ID3D10EffectSamplerVariable *iface,
6132 void *data, UINT offset, UINT count)
6134 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6137 /* ID3D10EffectSamplerVariable methods */
6139 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetSampler(ID3D10EffectSamplerVariable *iface,
6140 UINT index, ID3D10SamplerState **sampler)
6142 FIXME("iface %p, index %u, sampler %p stub!\n", iface, index, sampler);
6144 return E_NOTIMPL;
6147 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetBackingStore(ID3D10EffectSamplerVariable *iface,
6148 UINT index, D3D10_SAMPLER_DESC *desc)
6150 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
6152 return E_NOTIMPL;
6156 static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl =
6158 /* ID3D10EffectVariable methods */
6159 d3d10_effect_sampler_variable_IsValid,
6160 d3d10_effect_sampler_variable_GetType,
6161 d3d10_effect_sampler_variable_GetDesc,
6162 d3d10_effect_sampler_variable_GetAnnotationByIndex,
6163 d3d10_effect_sampler_variable_GetAnnotationByName,
6164 d3d10_effect_sampler_variable_GetMemberByIndex,
6165 d3d10_effect_sampler_variable_GetMemberByName,
6166 d3d10_effect_sampler_variable_GetMemberBySemantic,
6167 d3d10_effect_sampler_variable_GetElement,
6168 d3d10_effect_sampler_variable_GetParentConstantBuffer,
6169 d3d10_effect_sampler_variable_AsScalar,
6170 d3d10_effect_sampler_variable_AsVector,
6171 d3d10_effect_sampler_variable_AsMatrix,
6172 d3d10_effect_sampler_variable_AsString,
6173 d3d10_effect_sampler_variable_AsShaderResource,
6174 d3d10_effect_sampler_variable_AsRenderTargetView,
6175 d3d10_effect_sampler_variable_AsDepthStencilView,
6176 d3d10_effect_sampler_variable_AsConstantBuffer,
6177 d3d10_effect_sampler_variable_AsShader,
6178 d3d10_effect_sampler_variable_AsBlend,
6179 d3d10_effect_sampler_variable_AsDepthStencil,
6180 d3d10_effect_sampler_variable_AsRasterizer,
6181 d3d10_effect_sampler_variable_AsSampler,
6182 d3d10_effect_sampler_variable_SetRawValue,
6183 d3d10_effect_sampler_variable_GetRawValue,
6184 /* ID3D10EffectSamplerVariable methods */
6185 d3d10_effect_sampler_variable_GetSampler,
6186 d3d10_effect_sampler_variable_GetBackingStore,
6189 /* ID3D10EffectType methods */
6191 static BOOL STDMETHODCALLTYPE d3d10_effect_type_IsValid(ID3D10EffectType *iface)
6193 TRACE("iface %p\n", iface);
6195 return (struct d3d10_effect_type *)iface != &null_type;
6198 static HRESULT STDMETHODCALLTYPE d3d10_effect_type_GetDesc(ID3D10EffectType *iface, D3D10_EFFECT_TYPE_DESC *desc)
6200 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6202 TRACE("iface %p, desc %p\n", iface, desc);
6204 if (This == &null_type)
6206 WARN("Null type specified\n");
6207 return E_FAIL;
6210 if (!desc)
6212 WARN("Invalid argument specified\n");
6213 return E_INVALIDARG;
6216 desc->TypeName = This->name;
6217 desc->Class = This->type_class;
6218 desc->Type = This->basetype;
6219 desc->Elements = This->element_count;
6220 desc->Members = This->member_count;
6221 desc->Rows = This->row_count;
6222 desc->Columns = This->column_count;
6223 desc->PackedSize = This->size_packed;
6224 desc->UnpackedSize = This->size_unpacked;
6225 desc->Stride = This->stride;
6227 return S_OK;
6230 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByIndex(ID3D10EffectType *iface,
6231 UINT index)
6233 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6234 struct d3d10_effect_type *t;
6236 TRACE("iface %p, index %u\n", iface, index);
6238 if (index >= This->member_count)
6240 WARN("Invalid index specified\n");
6241 return (ID3D10EffectType *)&null_type;
6244 t = (&This->members[index])->type;
6246 TRACE("Returning member %p, %s\n", t, debugstr_a(t->name));
6248 return (ID3D10EffectType *)t;
6251 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByName(ID3D10EffectType *iface,
6252 LPCSTR name)
6254 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6255 unsigned int i;
6257 TRACE("iface %p, name %s\n", iface, debugstr_a(name));
6259 if (!name)
6261 WARN("Invalid name specified\n");
6262 return (ID3D10EffectType *)&null_type;
6265 for (i = 0; i < This->member_count; ++i)
6267 struct d3d10_effect_type_member *typem = &This->members[i];
6269 if (typem->name)
6271 if (!strcmp(typem->name, name))
6273 TRACE("Returning type %p.\n", typem->type);
6274 return (ID3D10EffectType *)typem->type;
6279 WARN("Invalid name specified\n");
6281 return (ID3D10EffectType *)&null_type;
6284 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeBySemantic(ID3D10EffectType *iface,
6285 LPCSTR semantic)
6287 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6288 unsigned int i;
6290 TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
6292 if (!semantic)
6294 WARN("Invalid semantic specified\n");
6295 return (ID3D10EffectType *)&null_type;
6298 for (i = 0; i < This->member_count; ++i)
6300 struct d3d10_effect_type_member *typem = &This->members[i];
6302 if (typem->semantic)
6304 if (!strcmp(typem->semantic, semantic))
6306 TRACE("Returning type %p.\n", typem->type);
6307 return (ID3D10EffectType *)typem->type;
6312 WARN("Invalid semantic specified\n");
6314 return (ID3D10EffectType *)&null_type;
6317 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberName(ID3D10EffectType *iface, UINT index)
6319 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6320 struct d3d10_effect_type_member *typem;
6322 TRACE("iface %p, index %u\n", iface, index);
6324 if (index >= This->member_count)
6326 WARN("Invalid index specified\n");
6327 return NULL;
6330 typem = &This->members[index];
6332 TRACE("Returning name %s\n", debugstr_a(typem->name));
6334 return typem->name;
6337 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberSemantic(ID3D10EffectType *iface, UINT index)
6339 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
6340 struct d3d10_effect_type_member *typem;
6342 TRACE("iface %p, index %u\n", iface, index);
6344 if (index >= This->member_count)
6346 WARN("Invalid index specified\n");
6347 return NULL;
6350 typem = &This->members[index];
6352 TRACE("Returning semantic %s\n", debugstr_a(typem->semantic));
6354 return typem->semantic;
6357 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl =
6359 /* ID3D10EffectType */
6360 d3d10_effect_type_IsValid,
6361 d3d10_effect_type_GetDesc,
6362 d3d10_effect_type_GetMemberTypeByIndex,
6363 d3d10_effect_type_GetMemberTypeByName,
6364 d3d10_effect_type_GetMemberTypeBySemantic,
6365 d3d10_effect_type_GetMemberName,
6366 d3d10_effect_type_GetMemberSemantic,