d3d10: Implement ID3D10EffectType::GetMemberTypeBySemantic().
[wine.git] / dlls / d3d10 / effect.c
blob6a04e4a91801931afbdb5b1d9249f2af08037db3
1 /*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "config.h"
21 #include "wine/port.h"
23 #include "d3d10_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
27 #define MAKE_TAG(ch0, ch1, ch2, ch3) \
28 ((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \
29 ((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
30 #define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C')
31 #define TAG_FX10 MAKE_TAG('F', 'X', '1', '0')
32 #define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
34 #define D3D10_FX10_TYPE_COLUMN_SHIFT 11
35 #define D3D10_FX10_TYPE_COLUMN_MASK (0x7 << D3D10_FX10_TYPE_COLUMN_SHIFT)
37 #define D3D10_FX10_TYPE_ROW_SHIFT 8
38 #define D3D10_FX10_TYPE_ROW_MASK (0x7 << D3D10_FX10_TYPE_ROW_SHIFT)
40 #define D3D10_FX10_TYPE_BASETYPE_SHIFT 3
41 #define D3D10_FX10_TYPE_BASETYPE_MASK (0x1f << D3D10_FX10_TYPE_BASETYPE_SHIFT)
43 #define D3D10_FX10_TYPE_CLASS_SHIFT 0
44 #define D3D10_FX10_TYPE_CLASS_MASK (0x7 << D3D10_FX10_TYPE_CLASS_SHIFT)
46 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl;
47 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl;
48 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl;
49 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl;
50 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl;
51 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl;
52 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl;
53 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl;
55 /* null objects - needed for invalid calls */
56 static struct d3d10_effect_technique null_technique =
57 {&d3d10_effect_technique_vtbl, NULL, NULL, 0, 0, NULL, NULL};
58 static struct d3d10_effect_pass null_pass =
59 {&d3d10_effect_pass_vtbl, NULL, NULL, 0, 0, 0, NULL, NULL};
60 static struct d3d10_effect_type null_type =
61 {&d3d10_effect_type_vtbl, 0, {NULL, NULL, 0}, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL};
62 static struct d3d10_effect_variable null_local_buffer =
63 {(ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl,
64 NULL, NULL, NULL, NULL, 0, 0, 0, 0, &null_type, NULL, NULL};
65 static struct d3d10_effect_variable null_variable =
66 {&d3d10_effect_variable_vtbl, NULL, NULL, NULL, NULL, 0, 0, 0, 0, &null_type, NULL, NULL};
67 static struct d3d10_effect_variable null_scalar_variable =
68 {(ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl,
69 NULL, NULL, NULL, NULL, 0, 0, 0, 0, &null_type, NULL, NULL};
70 static struct d3d10_effect_variable null_vector_variable =
71 {(ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl,
72 NULL, NULL, NULL, NULL, 0, 0, 0, 0, &null_type, NULL, NULL};
73 static struct d3d10_effect_variable null_matrix_variable =
74 {(ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl,
75 NULL, NULL, NULL, NULL, 0, 0, 0, 0, &null_type, NULL, NULL};
77 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset);
79 static inline void read_dword(const char **ptr, DWORD *d)
81 memcpy(d, *ptr, sizeof(*d));
82 *ptr += sizeof(*d);
85 static inline void skip_dword_unknown(const char **ptr, unsigned int count)
87 unsigned int i;
88 DWORD d;
90 FIXME("Skipping %u unknown DWORDs:\n", count);
91 for (i = 0; i < count; ++i)
93 read_dword(ptr, &d);
94 FIXME("\t0x%08x\n", d);
98 static inline void write_dword(char **ptr, DWORD d)
100 memcpy(*ptr, &d, sizeof(d));
101 *ptr += sizeof(d);
104 static inline void write_dword_unknown(char **ptr, DWORD d)
106 FIXME("Writing unknown DWORD 0x%08x\n", d);
107 write_dword(ptr, d);
110 static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
111 HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx)
113 const char *ptr = data;
114 HRESULT hr = S_OK;
115 DWORD chunk_count;
116 DWORD total_size;
117 unsigned int i;
118 DWORD tag;
120 read_dword(&ptr, &tag);
121 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
123 if (tag != TAG_DXBC)
125 WARN("Wrong tag.\n");
126 return E_FAIL;
129 /* checksum? */
130 skip_dword_unknown(&ptr, 4);
132 skip_dword_unknown(&ptr, 1);
134 read_dword(&ptr, &total_size);
135 TRACE("total size: %#x\n", total_size);
137 read_dword(&ptr, &chunk_count);
138 TRACE("chunk count: %#x\n", chunk_count);
140 for (i = 0; i < chunk_count; ++i)
142 DWORD chunk_tag, chunk_size;
143 const char *chunk_ptr;
144 DWORD chunk_offset;
146 read_dword(&ptr, &chunk_offset);
147 TRACE("chunk %u at offset %#x\n", i, chunk_offset);
149 chunk_ptr = data + chunk_offset;
151 read_dword(&chunk_ptr, &chunk_tag);
152 read_dword(&chunk_ptr, &chunk_size);
154 hr = chunk_handler(chunk_ptr, chunk_size, chunk_tag, ctx);
155 if (FAILED(hr)) break;
158 return hr;
161 static BOOL copy_name(const char *ptr, char **name)
163 size_t name_len;
165 if (!ptr) return TRUE;
167 name_len = strlen(ptr) + 1;
168 if (name_len == 1)
170 return TRUE;
173 *name = HeapAlloc(GetProcessHeap(), 0, name_len);
174 if (!*name)
176 ERR("Failed to allocate name memory.\n");
177 return FALSE;
180 memcpy(*name, ptr, name_len);
182 return TRUE;
185 static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
187 struct d3d10_effect_shader_variable *s = ctx;
189 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
191 TRACE("chunk size: %#x\n", data_size);
193 switch(tag)
195 case TAG_ISGN:
197 /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */
198 UINT size = 44 + data_size;
199 char *ptr;
201 s->input_signature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
202 if (!s->input_signature)
204 ERR("Failed to allocate input signature data\n");
205 return E_OUTOFMEMORY;
207 s->input_signature_size = size;
209 ptr = s->input_signature;
211 write_dword(&ptr, TAG_DXBC);
213 /* signature(?) */
214 write_dword_unknown(&ptr, 0);
215 write_dword_unknown(&ptr, 0);
216 write_dword_unknown(&ptr, 0);
217 write_dword_unknown(&ptr, 0);
219 /* seems to be always 1 */
220 write_dword_unknown(&ptr, 1);
222 /* DXBC size */
223 write_dword(&ptr, size);
225 /* chunk count */
226 write_dword(&ptr, 1);
228 /* chunk index */
229 write_dword(&ptr, (ptr - s->input_signature) + 4);
231 /* chunk */
232 write_dword(&ptr, TAG_ISGN);
233 write_dword(&ptr, data_size);
234 memcpy(ptr, data, data_size);
235 break;
238 default:
239 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
240 break;
243 return S_OK;
246 static HRESULT parse_shader(struct d3d10_effect_object *o, const char *data)
248 ID3D10Device *device = o->pass->technique->effect->device;
249 struct d3d10_effect_shader_variable *s;
250 const char *ptr = data;
251 DWORD dxbc_size;
252 HRESULT hr;
254 o->data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3d10_effect_shader_variable));
255 if (!o->data)
257 ERR("Failed to allocate shader variable memory\n");
258 return E_OUTOFMEMORY;
261 if (!ptr) return S_OK;
263 s = o->data;
265 read_dword(&ptr, &dxbc_size);
266 TRACE("dxbc size: %#x\n", dxbc_size);
268 switch (o->type)
270 case D3D10_EOT_VERTEXSHADER:
271 hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &s->shader.vs);
272 if (FAILED(hr)) return hr;
273 break;
275 case D3D10_EOT_PIXELSHADER:
276 hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &s->shader.ps);
277 if (FAILED(hr)) return hr;
278 break;
279 case D3D10_EOT_GEOMETRYSHADER:
280 hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &s->shader.gs);
281 if (FAILED(hr)) return hr;
282 break;
285 return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, s);
288 static D3D10_SHADER_VARIABLE_CLASS d3d10_variable_class(DWORD c)
290 switch (c)
292 case 1: return D3D10_SVC_SCALAR;
293 case 2: return D3D10_SVC_VECTOR;
294 case 3: return D3D10_SVC_MATRIX_ROWS;
295 default:
296 FIXME("Unknown variable class %#x.\n", c);
297 return 0;
301 static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(DWORD t)
303 switch (t)
305 case 1: return D3D10_SVT_FLOAT;
306 case 2: return D3D10_SVT_INT;
307 case 3: return D3D10_SVT_UINT;
308 case 4: return D3D10_SVT_BOOL;
309 default:
310 FIXME("Unknown variable type %#x.\n", t);
311 return 0;
315 static HRESULT parse_fx10_type(struct d3d10_effect_type *t, const char *ptr, const char *data)
317 DWORD unknown0;
318 DWORD offset;
320 read_dword(&ptr, &offset);
321 TRACE("Type name at offset %#x.\n", offset);
323 if (!copy_name(data + offset, &t->name))
325 ERR("Failed to copy name.\n");
326 return E_OUTOFMEMORY;
328 TRACE("Type name: %s.\n", debugstr_a(t->name));
330 read_dword(&ptr, &unknown0);
331 TRACE("Unknown 0: %u.\n", unknown0);
333 read_dword(&ptr, &t->element_count);
334 TRACE("Element count: %u.\n", t->element_count);
336 read_dword(&ptr, &t->size_unpacked);
337 TRACE("Unpacked size: %#x.\n", t->size_unpacked);
339 read_dword(&ptr, &t->stride);
340 TRACE("Stride: %#x.\n", t->stride);
342 read_dword(&ptr, &t->size_packed);
343 TRACE("Packed size %#x.\n", t->size_packed);
345 if (unknown0 == 1)
347 DWORD tmp;
349 t->member_count = 0;
351 read_dword(&ptr, &tmp);
352 t->column_count = (tmp & D3D10_FX10_TYPE_COLUMN_MASK) >> D3D10_FX10_TYPE_COLUMN_SHIFT;
353 t->row_count = (tmp & D3D10_FX10_TYPE_ROW_MASK) >> D3D10_FX10_TYPE_ROW_SHIFT;
354 t->basetype = d3d10_variable_type((tmp & D3D10_FX10_TYPE_BASETYPE_MASK) >> D3D10_FX10_TYPE_BASETYPE_SHIFT);
355 t->type_class = d3d10_variable_class((tmp & D3D10_FX10_TYPE_CLASS_MASK) >> D3D10_FX10_TYPE_CLASS_SHIFT);
357 TRACE("Type description: %#x.\n", tmp);
358 TRACE("\tcolumns: %u.\n", t->column_count);
359 TRACE("\trows: %u.\n", t->row_count);
360 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
361 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
362 TRACE("\tunknown bits: %#x.\n", tmp & ~(D3D10_FX10_TYPE_COLUMN_MASK | D3D10_FX10_TYPE_ROW_MASK
363 | D3D10_FX10_TYPE_BASETYPE_MASK | D3D10_FX10_TYPE_CLASS_MASK));
365 else if (unknown0 == 3)
367 unsigned int i;
369 TRACE("Type is a structure.\n");
371 read_dword(&ptr, &t->member_count);
372 TRACE("Member count: %u.\n", t->member_count);
374 t->column_count = 0;
375 t->row_count = 0;
376 t->basetype = 0;
377 t->type_class = D3D10_SVC_STRUCT;
379 t->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->member_count * sizeof(*t->members));
380 if (!t->members)
382 ERR("Failed to allocate members memory.\n");
383 return E_OUTOFMEMORY;
386 for (i = 0; i < t->member_count; ++i)
388 struct d3d10_effect_type_member *typem = &t->members[i];
390 read_dword(&ptr, &offset);
391 TRACE("Member name at offset %#x.\n", offset);
393 if (!copy_name(data + offset, &typem->name))
395 ERR("Failed to copy name.\n");
396 return E_OUTOFMEMORY;
398 TRACE("Member name: %s.\n", debugstr_a(typem->name));
400 read_dword(&ptr, &offset);
401 TRACE("Member semantic at offset %#x.\n", offset);
403 if (!copy_name(data + offset, &typem->semantic))
405 ERR("Failed to copy semantic.\n");
406 return E_OUTOFMEMORY;
408 TRACE("Member semantic: %s.\n", debugstr_a(typem->semantic));
410 read_dword(&ptr, &typem->buffer_offset);
411 TRACE("Member offset in struct: %#x.\n", typem->buffer_offset);
413 read_dword(&ptr, &offset);
414 TRACE("Member type info at offset %#x.\n", offset);
416 typem->type = get_fx10_type(t->effect, data, offset);
417 if (!typem->type)
419 ERR("Failed to get variable type.\n");
420 return E_FAIL;
425 return S_OK;
428 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset)
430 struct d3d10_effect_type *type;
431 struct wine_rb_entry *entry;
432 HRESULT hr;
434 entry = wine_rb_get(&effect->types, &offset);
435 if (entry)
437 TRACE("Returning existing type.\n");
438 return WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
441 type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*type));
442 if (!type)
444 ERR("Failed to allocate type memory.\n");
445 return NULL;
448 type->vtbl = &d3d10_effect_type_vtbl;
449 type->id = offset;
450 type->effect = effect;
451 hr = parse_fx10_type(type, data + offset, data);
452 if (FAILED(hr))
454 ERR("Failed to parse type info, hr %#x.\n", hr);
455 HeapFree(GetProcessHeap(), 0, type);
456 return NULL;
459 if (wine_rb_put(&effect->types, &offset, &type->entry) == -1)
461 ERR("Failed to insert type entry.\n");
462 HeapFree(GetProcessHeap(), 0, type);
463 return NULL;
466 return type;
469 static void set_variable_vtbl(struct d3d10_effect_variable *v)
471 switch (v->type->type_class)
473 case D3D10_SVC_SCALAR:
474 v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl;
475 break;
477 case D3D10_SVC_VECTOR:
478 v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl;
479 break;
481 case D3D10_SVC_MATRIX_ROWS:
482 case D3D10_SVC_MATRIX_COLUMNS:
483 v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl;
484 break;
486 default:
487 FIXME("Unhandled type class %s.\n", debug_d3d10_shader_variable_class(v->type->type_class));
488 v->vtbl = &d3d10_effect_variable_vtbl;
489 break;
493 static HRESULT copy_variableinfo_from_type(struct d3d10_effect_variable *v)
495 unsigned int i;
497 if (v->type->member_count == 0) return S_OK;
499 v->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->member_count * sizeof(*v->members));
500 if (!v->members)
502 ERR("Failed to allocate members memory.\n");
503 return E_OUTOFMEMORY;
506 for (i = 0; i < v->type->member_count; ++i)
508 struct d3d10_effect_variable *var = &v->members[i];
509 struct d3d10_effect_type_member *typem = &v->type->members[i];
510 HRESULT hr;
512 var->buffer = v;
513 var->effect = v->effect;
514 var->type = typem->type;
515 set_variable_vtbl(var);
517 if (!copy_name(typem->name, &var->name))
519 ERR("Failed to copy name.\n");
520 return E_OUTOFMEMORY;
522 TRACE("Variable name: %s.\n", debugstr_a(var->name));
524 if (!copy_name(typem->semantic, &var->semantic))
526 ERR("Failed to copy name.\n");
527 return E_OUTOFMEMORY;
529 TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
531 var->buffer_offset = typem->buffer_offset;
532 TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
534 hr = copy_variableinfo_from_type(var);
535 if (FAILED(hr)) return hr;
538 return S_OK;
541 static HRESULT parse_fx10_variable_head(struct d3d10_effect_variable *v, const char **ptr, const char *data)
543 DWORD offset;
545 read_dword(ptr, &offset);
546 TRACE("Variable name at offset %#x.\n", offset);
548 if (!copy_name(data + offset, &v->name))
550 ERR("Failed to copy name.\n");
551 return E_OUTOFMEMORY;
553 TRACE("Variable name: %s.\n", debugstr_a(v->name));
555 read_dword(ptr, &offset);
556 TRACE("Variable type info at offset %#x.\n", offset);
558 v->type = get_fx10_type(v->effect, data, offset);
559 if (!v->type)
561 ERR("Failed to get variable type.\n");
562 return E_FAIL;
564 set_variable_vtbl(v);
566 return copy_variableinfo_from_type(v);
569 static HRESULT parse_fx10_annotation(struct d3d10_effect_variable *a, const char **ptr, const char *data)
571 HRESULT hr;
573 hr = parse_fx10_variable_head(a, ptr, data);
574 if (FAILED(hr)) return hr;
576 skip_dword_unknown(ptr, 1);
578 return S_OK;
581 static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr, const char *data)
583 const char *data_ptr;
584 DWORD offset;
585 HRESULT hr;
587 read_dword(ptr, &o->type);
588 TRACE("Effect object is of type %#x.\n", o->type);
590 skip_dword_unknown(ptr, 2);
592 read_dword(ptr, &offset);
593 TRACE("Effect object idx is at offset %#x.\n", offset);
595 data_ptr = data + offset;
596 read_dword(&data_ptr, &offset);
598 TRACE("Effect object starts at offset %#x.\n", offset);
600 /* FIXME: This probably isn't completely correct. */
601 if (offset == 1)
603 WARN("Skipping effect object.\n");
604 data_ptr = NULL;
606 else
608 data_ptr = data + offset;
611 switch (o->type)
613 case D3D10_EOT_VERTEXSHADER:
614 TRACE("Vertex shader\n");
615 hr = parse_shader(o, data_ptr);
616 break;
618 case D3D10_EOT_PIXELSHADER:
619 TRACE("Pixel shader\n");
620 hr = parse_shader(o, data_ptr);
621 break;
623 case D3D10_EOT_GEOMETRYSHADER:
624 TRACE("Geometry shader\n");
625 hr = parse_shader(o, data_ptr);
626 break;
628 default:
629 FIXME("Unhandled object type %#x\n", o->type);
630 hr = E_FAIL;
631 break;
634 return hr;
637 static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, const char *data)
639 HRESULT hr = S_OK;
640 unsigned int i;
641 DWORD offset;
643 read_dword(ptr, &offset);
644 TRACE("Pass name at offset %#x.\n", offset);
646 if (!copy_name(data + offset, &p->name))
648 ERR("Failed to copy name.\n");
649 return E_OUTOFMEMORY;
651 TRACE("Pass name: %s.\n", debugstr_a(p->name));
653 read_dword(ptr, &p->object_count);
654 TRACE("Pass has %u effect objects.\n", p->object_count);
656 read_dword(ptr, &p->annotation_count);
657 TRACE("Pass has %u annotations.\n", p->annotation_count);
659 p->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->annotation_count * sizeof(*p->annotations));
660 if (!p->annotations)
662 ERR("Failed to allocate pass annotations memory.\n");
663 return E_OUTOFMEMORY;
666 for(i = 0; i < p->annotation_count; ++i)
668 struct d3d10_effect_variable *a = &p->annotations[i];
670 a->effect = p->technique->effect;
672 hr = parse_fx10_annotation(a, ptr, data);
673 if (FAILED(hr)) return hr;
676 p->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->object_count * sizeof(*p->objects));
677 if (!p->objects)
679 ERR("Failed to allocate effect objects memory.\n");
680 return E_OUTOFMEMORY;
683 for (i = 0; i < p->object_count; ++i)
685 struct d3d10_effect_object *o = &p->objects[i];
687 o->pass = p;
689 hr = parse_fx10_object(o, ptr, data);
690 if (FAILED(hr)) return hr;
693 return hr;
696 static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char **ptr, const char *data)
698 unsigned int i;
699 DWORD offset;
700 HRESULT hr;
702 read_dword(ptr, &offset);
703 TRACE("Technique name at offset %#x.\n", offset);
705 if (!copy_name(data + offset, &t->name))
707 ERR("Failed to copy name.\n");
708 return E_OUTOFMEMORY;
710 TRACE("Technique name: %s.\n", debugstr_a(t->name));
712 read_dword(ptr, &t->pass_count);
713 TRACE("Technique has %u passes\n", t->pass_count);
715 read_dword(ptr, &t->annotation_count);
716 TRACE("Technique has %u annotations.\n", t->annotation_count);
718 t->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->annotation_count * sizeof(*t->annotations));
719 if (!t->annotations)
721 ERR("Failed to allocate technique annotations memory.\n");
722 return E_OUTOFMEMORY;
725 for(i = 0; i < t->annotation_count; ++i)
727 struct d3d10_effect_variable *a = &t->annotations[i];
729 a->effect = t->effect;
731 hr = parse_fx10_annotation(a, ptr, data);
732 if (FAILED(hr)) return hr;
735 t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes));
736 if (!t->passes)
738 ERR("Failed to allocate passes memory\n");
739 return E_OUTOFMEMORY;
742 for (i = 0; i < t->pass_count; ++i)
744 struct d3d10_effect_pass *p = &t->passes[i];
746 p->vtbl = &d3d10_effect_pass_vtbl;
747 p->technique = t;
749 hr = parse_fx10_pass(p, ptr, data);
750 if (FAILED(hr)) return hr;
753 return S_OK;
756 static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
758 DWORD offset;
759 unsigned int i;
760 HRESULT hr;
762 hr = parse_fx10_variable_head(v, ptr, data);
763 if (FAILED(hr)) return hr;
765 read_dword(ptr, &offset);
766 TRACE("Variable semantic at offset %#x.\n", offset);
768 if (!copy_name(data + offset, &v->semantic))
770 ERR("Failed to copy semantic.\n");
771 return E_OUTOFMEMORY;
773 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
775 read_dword(ptr, &v->buffer_offset);
776 TRACE("Variable offset in buffer: %#x.\n", v->buffer_offset);
778 skip_dword_unknown(ptr, 1);
780 read_dword(ptr, &v->flag);
781 TRACE("Variable flag: %#x.\n", v->flag);
783 read_dword(ptr, &v->annotation_count);
784 TRACE("Variable has %u annotations.\n", v->annotation_count);
786 v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
787 if (!v->annotations)
789 ERR("Failed to allocate variable annotations memory.\n");
790 return E_OUTOFMEMORY;
793 for(i = 0; i < v->annotation_count; ++i)
795 struct d3d10_effect_variable *a = &v->annotations[i];
796 HRESULT hr;
798 a->effect = v->effect;
800 hr = parse_fx10_annotation(a, ptr, data);
801 if (FAILED(hr)) return hr;
804 return S_OK;
807 static HRESULT parse_fx10_local_buffer(struct d3d10_effect_variable *l, const char **ptr, const char *data)
809 unsigned int i;
810 DWORD offset;
811 D3D10_CBUFFER_TYPE d3d10_cbuffer_type;
812 HRESULT hr;
814 /* Generate our own type, it isn't in the fx blob. */
815 l->type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*l->type));
816 if (!l->type)
818 ERR("Failed to allocate local buffer type memory.\n");
819 return E_OUTOFMEMORY;
821 l->type->vtbl = &d3d10_effect_type_vtbl;
822 l->type->type_class = D3D10_SVC_OBJECT;
823 l->type->effect = l->effect;
825 read_dword(ptr, &offset);
826 TRACE("Local buffer name at offset %#x.\n", offset);
828 if (!copy_name(data + offset, &l->name))
830 ERR("Failed to copy name.\n");
831 return E_OUTOFMEMORY;
833 TRACE("Local buffer name: %s.\n", debugstr_a(l->name));
835 read_dword(ptr, &l->data_size);
836 TRACE("Local buffer data size: %#x.\n", l->data_size);
838 read_dword(ptr, &d3d10_cbuffer_type);
839 TRACE("Local buffer type: %#x.\n", d3d10_cbuffer_type);
841 switch(d3d10_cbuffer_type)
843 case D3D10_CT_CBUFFER:
844 l->type->basetype = D3D10_SVT_CBUFFER;
845 if (!copy_name("cbuffer", &l->type->name))
847 ERR("Failed to copy name.\n");
848 return E_OUTOFMEMORY;
850 break;
852 case D3D10_CT_TBUFFER:
853 l->type->basetype = D3D10_SVT_TBUFFER;
854 if (!copy_name("tbuffer", &l->type->name))
856 ERR("Failed to copy name.\n");
857 return E_OUTOFMEMORY;
859 break;
861 default:
862 ERR("Unexpected D3D10_CBUFFER_TYPE %#x!\n", d3d10_cbuffer_type);
863 return E_FAIL;
866 read_dword(ptr, &l->type->member_count);
867 TRACE("Local buffer member count: %#x.\n", l->type->member_count);
869 skip_dword_unknown(ptr, 1);
871 read_dword(ptr, &l->annotation_count);
872 TRACE("Local buffer has %u annotations.\n", l->annotation_count);
874 l->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->annotation_count * sizeof(*l->annotations));
875 if (!l->annotations)
877 ERR("Failed to allocate local buffer annotations memory.\n");
878 return E_OUTOFMEMORY;
881 for(i = 0; i < l->annotation_count; ++i)
883 struct d3d10_effect_variable *a = &l->annotations[i];
885 a->effect = l->effect;
887 hr = parse_fx10_annotation(a, ptr, data);
888 if (FAILED(hr)) return hr;
891 l->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->members));
892 if (!l->members)
894 ERR("Failed to allocate members memory.\n");
895 return E_OUTOFMEMORY;
898 l->type->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->type->members));
899 if (!l->type->members)
901 ERR("Failed to allocate type members memory.\n");
902 return E_OUTOFMEMORY;
905 for (i = 0; i < l->type->member_count; ++i)
907 struct d3d10_effect_variable *v = &l->members[i];
908 struct d3d10_effect_type_member *typem = &l->type->members[i];
910 v->buffer = l;
911 v->effect = l->effect;
913 hr = parse_fx10_variable(v, ptr, data);
914 if (FAILED(hr)) return hr;
917 * Copy the values from the variable type to the constant buffers type
918 * members structure, because it is our own generated type.
920 typem->type = v->type;
922 if (!copy_name(v->name, &typem->name))
924 ERR("Failed to copy name.\n");
925 return E_OUTOFMEMORY;
927 TRACE("Variable name: %s.\n", debugstr_a(typem->name));
929 if (!copy_name(v->semantic, &typem->semantic))
931 ERR("Failed to copy name.\n");
932 return E_OUTOFMEMORY;
934 TRACE("Variable semantic: %s.\n", debugstr_a(typem->semantic));
936 typem->buffer_offset = v->buffer_offset;
937 TRACE("Variable buffer offset: %u.\n", typem->buffer_offset);
939 l->type->size_packed += v->type->size_packed;
940 l->type->size_unpacked += v->type->size_unpacked;
942 l->type->stride = l->type->size_unpacked = (l->type->size_unpacked + 0xf) & ~0xf;
944 TRACE("Constant buffer:\n");
945 TRACE("\tType name: %s.\n", debugstr_a(l->type->name));
946 TRACE("\tElement count: %u.\n", l->type->element_count);
947 TRACE("\tMember count: %u.\n", l->type->member_count);
948 TRACE("\tUnpacked size: %#x.\n", l->type->size_unpacked);
949 TRACE("\tStride: %#x.\n", l->type->stride);
950 TRACE("\tPacked size %#x.\n", l->type->size_packed);
951 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l->type->basetype));
952 TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l->type->type_class));
954 return S_OK;
957 static int d3d10_effect_type_compare(const void *key, const struct wine_rb_entry *entry)
959 const struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, const struct d3d10_effect_type, entry);
960 const DWORD *id = key;
962 return *id - t->id;
965 static void d3d10_effect_type_member_destroy(struct d3d10_effect_type_member *typem)
967 TRACE("effect type member %p.\n", typem);
969 /* Do not release typem->type, it will be covered by d3d10_effect_type_destroy(). */
970 HeapFree(GetProcessHeap(), 0, typem->semantic);
971 HeapFree(GetProcessHeap(), 0, typem->name);
974 static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context)
976 struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
978 TRACE("effect type %p.\n", t);
980 if (t->members)
982 unsigned int i;
984 for (i = 0; i < t->member_count; ++i)
986 d3d10_effect_type_member_destroy(&t->members[i]);
988 HeapFree(GetProcessHeap(), 0, t->members);
991 HeapFree(GetProcessHeap(), 0, t->name);
992 HeapFree(GetProcessHeap(), 0, t);
995 static const struct wine_rb_functions d3d10_effect_type_rb_functions =
997 d3d10_rb_alloc,
998 d3d10_rb_realloc,
999 d3d10_rb_free,
1000 d3d10_effect_type_compare,
1003 static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size)
1005 const char *ptr = data + e->index_offset;
1006 unsigned int i;
1007 HRESULT hr;
1009 if (wine_rb_init(&e->types, &d3d10_effect_type_rb_functions) == -1)
1011 ERR("Failed to initialize type rbtree.\n");
1012 return E_FAIL;
1015 e->local_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_buffer_count * sizeof(*e->local_buffers));
1016 if (!e->local_buffers)
1018 ERR("Failed to allocate local buffer memory.\n");
1019 return E_OUTOFMEMORY;
1022 e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques));
1023 if (!e->techniques)
1025 ERR("Failed to allocate techniques memory\n");
1026 return E_OUTOFMEMORY;
1029 for (i = 0; i < e->local_buffer_count; ++i)
1031 struct d3d10_effect_variable *l = &e->local_buffers[i];
1032 l->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl;
1033 l->effect = e;
1035 hr = parse_fx10_local_buffer(l, &ptr, data);
1036 if (FAILED(hr)) return hr;
1039 for (i = 0; i < e->technique_count; ++i)
1041 struct d3d10_effect_technique *t = &e->techniques[i];
1043 t->vtbl = &d3d10_effect_technique_vtbl;
1044 t->effect = e;
1046 hr = parse_fx10_technique(t, &ptr, data);
1047 if (FAILED(hr)) return hr;
1050 return S_OK;
1053 static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_size)
1055 const char *ptr = data;
1056 DWORD unknown;
1058 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
1059 read_dword(&ptr, &e->version);
1060 TRACE("Target: %#x\n", e->version);
1062 read_dword(&ptr, &e->local_buffer_count);
1063 TRACE("Local buffer count: %u.\n", e->local_buffer_count);
1065 read_dword(&ptr, &e->variable_count);
1066 TRACE("Variable count: %u\n", e->variable_count);
1068 read_dword(&ptr, &e->object_count);
1069 TRACE("Object count: %u\n", e->object_count);
1071 read_dword(&ptr, &e->sharedbuffers_count);
1072 TRACE("Sharedbuffers count: %u\n", e->sharedbuffers_count);
1074 /* Number of variables in shared buffers? */
1075 read_dword(&ptr, &unknown);
1076 FIXME("Unknown 0: %u\n", unknown);
1078 read_dword(&ptr, &e->sharedobjects_count);
1079 TRACE("Sharedobjects count: %u\n", e->sharedobjects_count);
1081 read_dword(&ptr, &e->technique_count);
1082 TRACE("Technique count: %u\n", e->technique_count);
1084 read_dword(&ptr, &e->index_offset);
1085 TRACE("Index offset: %#x\n", e->index_offset);
1087 read_dword(&ptr, &unknown);
1088 FIXME("Unknown 1: %u\n", unknown);
1090 read_dword(&ptr, &e->texture_count);
1091 TRACE("Texture count: %u\n", e->texture_count);
1093 read_dword(&ptr, &e->dephstencilstate_count);
1094 TRACE("Depthstencilstate count: %u\n", e->dephstencilstate_count);
1096 read_dword(&ptr, &e->blendstate_count);
1097 TRACE("Blendstate count: %u\n", e->blendstate_count);
1099 read_dword(&ptr, &e->rasterizerstate_count);
1100 TRACE("Rasterizerstate count: %u\n", e->rasterizerstate_count);
1102 read_dword(&ptr, &e->samplerstate_count);
1103 TRACE("Samplerstate count: %u\n", e->samplerstate_count);
1105 read_dword(&ptr, &e->rendertargetview_count);
1106 TRACE("Rendertargetview count: %u\n", e->rendertargetview_count);
1108 read_dword(&ptr, &e->depthstencilview_count);
1109 TRACE("Depthstencilview count: %u\n", e->depthstencilview_count);
1111 read_dword(&ptr, &e->shader_call_count);
1112 TRACE("Shader call count: %u\n", e->shader_call_count);
1114 read_dword(&ptr, &e->shader_compile_count);
1115 TRACE("Shader compile count: %u\n", e->shader_compile_count);
1117 return parse_fx10_body(e, ptr, data_size - (ptr - data));
1120 static HRESULT fx10_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
1122 struct d3d10_effect *e = ctx;
1124 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
1126 TRACE("chunk size: %#x\n", data_size);
1128 switch(tag)
1130 case TAG_FX10:
1131 return parse_fx10(e, data, data_size);
1133 default:
1134 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
1135 return S_OK;
1139 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size)
1141 return parse_dxbc(data, data_size, fx10_chunk_handler, This);
1144 static void d3d10_effect_object_destroy(struct d3d10_effect_object *o)
1146 TRACE("effect object %p.\n", o);
1148 switch(o->type)
1150 case D3D10_EOT_VERTEXSHADER:
1151 case D3D10_EOT_PIXELSHADER:
1152 case D3D10_EOT_GEOMETRYSHADER:
1153 HeapFree(GetProcessHeap(), 0, ((struct d3d10_effect_shader_variable *)o->data)->input_signature);
1154 break;
1156 default:
1157 break;
1159 HeapFree(GetProcessHeap(), 0, o->data);
1162 static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
1164 ID3D10Device *device = o->pass->technique->effect->device;
1166 TRACE("effect object %p, type %#x.\n", o, o->type);
1168 switch(o->type)
1170 case D3D10_EOT_VERTEXSHADER:
1171 ID3D10Device_VSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.vs);
1172 return S_OK;
1174 case D3D10_EOT_PIXELSHADER:
1175 ID3D10Device_PSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.ps);
1176 return S_OK;
1178 case D3D10_EOT_GEOMETRYSHADER:
1179 ID3D10Device_GSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.gs);
1180 return S_OK;
1182 default:
1183 FIXME("Unhandled effect object type %#x.\n", o->type);
1184 return E_FAIL;
1188 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
1190 unsigned int i;
1192 TRACE("variable %p.\n", v);
1194 HeapFree(GetProcessHeap(), 0, v->name);
1195 HeapFree(GetProcessHeap(), 0, v->semantic);
1196 if (v->annotations)
1198 for (i = 0; i < v->annotation_count; ++i)
1200 d3d10_effect_variable_destroy(&v->annotations[i]);
1202 HeapFree(GetProcessHeap(), 0, v->annotations);
1205 if (v->members)
1207 for (i = 0; i < v->type->member_count; ++i)
1209 d3d10_effect_variable_destroy(&v->members[i]);
1211 HeapFree(GetProcessHeap(), 0, v->members);
1215 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p)
1217 unsigned int i;
1219 TRACE("pass %p\n", p);
1221 HeapFree(GetProcessHeap(), 0, p->name);
1222 if (p->objects)
1224 for (i = 0; i < p->object_count; ++i)
1226 d3d10_effect_object_destroy(&p->objects[i]);
1228 HeapFree(GetProcessHeap(), 0, p->objects);
1231 if (p->annotations)
1233 for (i = 0; i < p->annotation_count; ++i)
1235 d3d10_effect_variable_destroy(&p->annotations[i]);
1237 HeapFree(GetProcessHeap(), 0, p->annotations);
1242 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
1244 unsigned int i;
1246 TRACE("technique %p\n", t);
1248 HeapFree(GetProcessHeap(), 0, t->name);
1249 if (t->passes)
1251 for (i = 0; i < t->pass_count; ++i)
1253 d3d10_effect_pass_destroy(&t->passes[i]);
1255 HeapFree(GetProcessHeap(), 0, t->passes);
1258 if (t->annotations)
1260 for (i = 0; i < t->annotation_count; ++i)
1262 d3d10_effect_variable_destroy(&t->annotations[i]);
1264 HeapFree(GetProcessHeap(), 0, t->annotations);
1268 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_variable *l)
1270 unsigned int i;
1272 TRACE("local buffer %p.\n", l);
1274 HeapFree(GetProcessHeap(), 0, l->name);
1275 if (l->members)
1277 for (i = 0; i < l->type->member_count; ++i)
1279 d3d10_effect_variable_destroy(&l->members[i]);
1281 HeapFree(GetProcessHeap(), 0, l->members);
1284 if (l->type->members)
1286 for (i = 0; i < l->type->member_count; ++i)
1288 /* Do not release l->type->members[i].type, it will be covered by d3d10_effect_type_destroy(). */
1289 HeapFree(GetProcessHeap(), 0, l->type->members[i].semantic);
1290 HeapFree(GetProcessHeap(), 0, l->type->members[i].name);
1292 HeapFree(GetProcessHeap(), 0, l->type->members);
1294 HeapFree(GetProcessHeap(), 0, l->type->name);
1295 HeapFree(GetProcessHeap(), 0, l->type);
1297 if (l->annotations)
1299 for (i = 0; i < l->annotation_count; ++i)
1301 d3d10_effect_variable_destroy(&l->annotations[i]);
1303 HeapFree(GetProcessHeap(), 0, l->annotations);
1307 /* IUnknown methods */
1309 static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
1311 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
1313 if (IsEqualGUID(riid, &IID_ID3D10Effect)
1314 || IsEqualGUID(riid, &IID_IUnknown))
1316 IUnknown_AddRef(iface);
1317 *object = iface;
1318 return S_OK;
1321 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
1323 *object = NULL;
1324 return E_NOINTERFACE;
1327 static ULONG STDMETHODCALLTYPE d3d10_effect_AddRef(ID3D10Effect *iface)
1329 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1330 ULONG refcount = InterlockedIncrement(&This->refcount);
1332 TRACE("%p increasing refcount to %u\n", This, refcount);
1334 return refcount;
1337 static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
1339 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1340 ULONG refcount = InterlockedDecrement(&This->refcount);
1342 TRACE("%p decreasing refcount to %u\n", This, refcount);
1344 if (!refcount)
1346 unsigned int i;
1348 if (This->techniques)
1350 for (i = 0; i < This->technique_count; ++i)
1352 d3d10_effect_technique_destroy(&This->techniques[i]);
1354 HeapFree(GetProcessHeap(), 0, This->techniques);
1357 if (This->local_buffers)
1359 for (i = 0; i < This->local_buffer_count; ++i)
1361 d3d10_effect_local_buffer_destroy(&This->local_buffers[i]);
1363 HeapFree(GetProcessHeap(), 0, This->local_buffers);
1366 wine_rb_destroy(&This->types, d3d10_effect_type_destroy, NULL);
1368 ID3D10Device_Release(This->device);
1369 HeapFree(GetProcessHeap(), 0, This);
1372 return refcount;
1375 /* ID3D10Effect methods */
1377 static BOOL STDMETHODCALLTYPE d3d10_effect_IsValid(ID3D10Effect *iface)
1379 FIXME("iface %p stub!\n", iface);
1381 return FALSE;
1384 static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
1386 FIXME("iface %p stub!\n", iface);
1388 return FALSE;
1391 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
1393 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1395 TRACE("iface %p, device %p\n", iface, device);
1397 ID3D10Device_AddRef(This->device);
1398 *device = This->device;
1400 return S_OK;
1403 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)
1405 FIXME("iface %p, desc %p stub!\n", iface, desc);
1407 return E_NOTIMPL;
1410 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface,
1411 UINT index)
1413 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1414 struct d3d10_effect_variable *l;
1416 TRACE("iface %p, index %u\n", iface, index);
1418 if (index >= This->local_buffer_count)
1420 WARN("Invalid index specified\n");
1421 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
1424 l = &This->local_buffers[index];
1426 TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name));
1428 return (ID3D10EffectConstantBuffer *)l;
1431 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,
1432 LPCSTR name)
1434 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1435 unsigned int i;
1437 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1439 for (i = 0; i < This->local_buffer_count; ++i)
1441 struct d3d10_effect_variable *l = &This->local_buffers[i];
1443 if (!strcmp(l->name, name))
1445 TRACE("Returning buffer %p.\n", l);
1446 return (ID3D10EffectConstantBuffer *)l;
1450 WARN("Invalid name specified\n");
1452 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
1455 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index)
1457 FIXME("iface %p, index %u stub!\n", iface, index);
1459 return NULL;
1462 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name)
1464 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1465 unsigned int i;
1467 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1469 for (i = 0; i < This->local_buffer_count; ++i)
1471 struct d3d10_effect_variable *l = &This->local_buffers[i];
1472 unsigned int j;
1474 for (j = 0; j < l->type->member_count; ++j)
1476 struct d3d10_effect_variable *v = &l->members[j];
1478 if (!strcmp(v->name, name))
1480 TRACE("Returning variable %p.\n", v);
1481 return (ID3D10EffectVariable *)v;
1486 WARN("Invalid name specified\n");
1488 return (ID3D10EffectVariable *)&null_variable;
1491 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface,
1492 LPCSTR semantic)
1494 FIXME("iface %p, semantic %s stub!\n", iface, debugstr_a(semantic));
1496 return NULL;
1499 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByIndex(ID3D10Effect *iface,
1500 UINT index)
1502 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1503 struct d3d10_effect_technique *t;
1505 TRACE("iface %p, index %u\n", iface, index);
1507 if (index >= This->technique_count)
1509 WARN("Invalid index specified\n");
1510 return (ID3D10EffectTechnique *)&null_technique;
1513 t = &This->techniques[index];
1515 TRACE("Returning technique %p, %s.\n", t, debugstr_a(t->name));
1517 return (ID3D10EffectTechnique *)t;
1520 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByName(ID3D10Effect *iface,
1521 LPCSTR name)
1523 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1524 unsigned int i;
1526 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1528 for (i = 0; i < This->technique_count; ++i)
1530 struct d3d10_effect_technique *t = &This->techniques[i];
1531 if (!strcmp(t->name, name))
1533 TRACE("Returning technique %p\n", t);
1534 return (ID3D10EffectTechnique *)t;
1538 WARN("Invalid name specified\n");
1540 return (ID3D10EffectTechnique *)&null_technique;
1543 static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
1545 FIXME("iface %p stub!\n", iface);
1547 return E_NOTIMPL;
1550 static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface)
1552 FIXME("iface %p stub!\n", iface);
1554 return FALSE;
1557 const struct ID3D10EffectVtbl d3d10_effect_vtbl =
1559 /* IUnknown methods */
1560 d3d10_effect_QueryInterface,
1561 d3d10_effect_AddRef,
1562 d3d10_effect_Release,
1563 /* ID3D10Effect methods */
1564 d3d10_effect_IsValid,
1565 d3d10_effect_IsPool,
1566 d3d10_effect_GetDevice,
1567 d3d10_effect_GetDesc,
1568 d3d10_effect_GetConstantBufferByIndex,
1569 d3d10_effect_GetConstantBufferByName,
1570 d3d10_effect_GetVariableByIndex,
1571 d3d10_effect_GetVariableByName,
1572 d3d10_effect_GetVariableBySemantic,
1573 d3d10_effect_GetTechniqueByIndex,
1574 d3d10_effect_GetTechniqueByName,
1575 d3d10_effect_Optimize,
1576 d3d10_effect_IsOptimized,
1579 /* ID3D10EffectTechnique methods */
1581 static BOOL STDMETHODCALLTYPE d3d10_effect_technique_IsValid(ID3D10EffectTechnique *iface)
1583 TRACE("iface %p\n", iface);
1585 return (struct d3d10_effect_technique *)iface != &null_technique;
1588 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_GetDesc(ID3D10EffectTechnique *iface,
1589 D3D10_TECHNIQUE_DESC *desc)
1591 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1593 TRACE("iface %p, desc %p\n", iface, desc);
1595 if(This == &null_technique)
1597 WARN("Null technique specified\n");
1598 return E_FAIL;
1601 if(!desc)
1603 WARN("Invalid argument specified\n");
1604 return E_INVALIDARG;
1607 desc->Name = This->name;
1608 desc->Passes = This->pass_count;
1609 desc->Annotations = This->annotation_count;
1611 return S_OK;
1614 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByIndex(
1615 ID3D10EffectTechnique *iface, UINT index)
1617 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1618 struct d3d10_effect_variable *a;
1620 TRACE("iface %p, index %u\n", iface, index);
1622 if (index >= This->annotation_count)
1624 WARN("Invalid index specified\n");
1625 return (ID3D10EffectVariable *)&null_variable;
1628 a = &This->annotations[index];
1630 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
1632 return (ID3D10EffectVariable *)a;
1635 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByName(
1636 ID3D10EffectTechnique *iface, LPCSTR name)
1638 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1639 unsigned int i;
1641 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1643 for (i = 0; i < This->annotation_count; ++i)
1645 struct d3d10_effect_variable *a = &This->annotations[i];
1646 if (!strcmp(a->name, name))
1648 TRACE("Returning annotation %p\n", a);
1649 return (ID3D10EffectVariable *)a;
1653 WARN("Invalid name specified\n");
1655 return (ID3D10EffectVariable *)&null_variable;
1658 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique *iface,
1659 UINT index)
1661 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1662 struct d3d10_effect_pass *p;
1664 TRACE("iface %p, index %u\n", iface, index);
1666 if (index >= This->pass_count)
1668 WARN("Invalid index specified\n");
1669 return (ID3D10EffectPass *)&null_pass;
1672 p = &This->passes[index];
1674 TRACE("Returning pass %p, %s.\n", p, debugstr_a(p->name));
1676 return (ID3D10EffectPass *)p;
1679 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique *iface,
1680 LPCSTR name)
1682 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1683 unsigned int i;
1685 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1687 for (i = 0; i < This->pass_count; ++i)
1689 struct d3d10_effect_pass *p = &This->passes[i];
1690 if (!strcmp(p->name, name))
1692 TRACE("Returning pass %p\n", p);
1693 return (ID3D10EffectPass *)p;
1697 WARN("Invalid name specified\n");
1699 return (ID3D10EffectPass *)&null_pass;
1702 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique *iface,
1703 D3D10_STATE_BLOCK_MASK *mask)
1705 FIXME("iface %p,mask %p stub!\n", iface, mask);
1707 return E_NOTIMPL;
1710 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl =
1712 /* ID3D10EffectTechnique methods */
1713 d3d10_effect_technique_IsValid,
1714 d3d10_effect_technique_GetDesc,
1715 d3d10_effect_technique_GetAnnotationByIndex,
1716 d3d10_effect_technique_GetAnnotationByName,
1717 d3d10_effect_technique_GetPassByIndex,
1718 d3d10_effect_technique_GetPassByName,
1719 d3d10_effect_technique_ComputeStateBlockMask,
1722 /* ID3D10EffectPass methods */
1724 static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface)
1726 TRACE("iface %p\n", iface);
1728 return (struct d3d10_effect_pass *)iface != &null_pass;
1731 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface, D3D10_PASS_DESC *desc)
1733 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1734 unsigned int i;
1736 FIXME("iface %p, desc %p partial stub!\n", iface, desc);
1738 if(This == &null_pass)
1740 WARN("Null pass specified\n");
1741 return E_FAIL;
1744 if(!desc)
1746 WARN("Invalid argument specified\n");
1747 return E_INVALIDARG;
1750 memset(desc, 0, sizeof(*desc));
1751 desc->Name = This->name;
1752 for (i = 0; i < This->object_count; ++i)
1754 struct d3d10_effect_object *o = &This->objects[i];
1755 if (o->type == D3D10_EOT_VERTEXSHADER)
1757 struct d3d10_effect_shader_variable *s = o->data;
1758 desc->pIAInputSignature = (BYTE *)s->input_signature;
1759 desc->IAInputSignatureSize = s->input_signature_size;
1760 break;
1764 return S_OK;
1767 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface,
1768 D3D10_PASS_SHADER_DESC *desc)
1770 FIXME("iface %p, desc %p stub!\n", iface, desc);
1772 return E_NOTIMPL;
1775 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface,
1776 D3D10_PASS_SHADER_DESC *desc)
1778 FIXME("iface %p, desc %p stub!\n", iface, desc);
1780 return E_NOTIMPL;
1783 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface,
1784 D3D10_PASS_SHADER_DESC *desc)
1786 FIXME("iface %p, desc %p stub!\n", iface, desc);
1788 return E_NOTIMPL;
1791 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass *iface,
1792 UINT index)
1794 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1795 struct d3d10_effect_variable *a;
1797 TRACE("iface %p, index %u\n", iface, index);
1799 if (index >= This->annotation_count)
1801 WARN("Invalid index specified\n");
1802 return (ID3D10EffectVariable *)&null_variable;
1805 a = &This->annotations[index];
1807 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
1809 return (ID3D10EffectVariable *)a;
1812 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass *iface,
1813 LPCSTR name)
1815 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1816 unsigned int i;
1818 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1820 for (i = 0; i < This->annotation_count; ++i)
1822 struct d3d10_effect_variable *a = &This->annotations[i];
1823 if (!strcmp(a->name, name))
1825 TRACE("Returning annotation %p\n", a);
1826 return (ID3D10EffectVariable *)a;
1830 WARN("Invalid name specified\n");
1832 return (ID3D10EffectVariable *)&null_variable;
1835 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
1837 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1838 HRESULT hr = S_OK;
1839 unsigned int i;
1841 TRACE("iface %p, flags %#x\n", iface, flags);
1843 if (flags) FIXME("Ignoring flags (%#x)\n", flags);
1845 for (i = 0; i < This->object_count; ++i)
1847 hr = d3d10_effect_object_apply(&This->objects[i]);
1848 if (FAILED(hr)) break;
1851 return hr;
1854 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass *iface,
1855 D3D10_STATE_BLOCK_MASK *mask)
1857 FIXME("iface %p, mask %p stub!\n", iface, mask);
1859 return E_NOTIMPL;
1862 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl =
1864 /* ID3D10EffectPass methods */
1865 d3d10_effect_pass_IsValid,
1866 d3d10_effect_pass_GetDesc,
1867 d3d10_effect_pass_GetVertexShaderDesc,
1868 d3d10_effect_pass_GetGeometryShaderDesc,
1869 d3d10_effect_pass_GetPixelShaderDesc,
1870 d3d10_effect_pass_GetAnnotationByIndex,
1871 d3d10_effect_pass_GetAnnotationByName,
1872 d3d10_effect_pass_Apply,
1873 d3d10_effect_pass_ComputeStateBlockMask,
1876 /* ID3D10EffectVariable methods */
1878 static BOOL STDMETHODCALLTYPE d3d10_effect_variable_IsValid(ID3D10EffectVariable *iface)
1880 TRACE("iface %p\n", iface);
1882 return (struct d3d10_effect_variable *)iface != &null_variable;
1885 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_variable_GetType(ID3D10EffectVariable *iface)
1887 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1889 TRACE("iface %p\n", iface);
1891 return (ID3D10EffectType *)This->type;
1894 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetDesc(ID3D10EffectVariable *iface,
1895 D3D10_EFFECT_VARIABLE_DESC *desc)
1897 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1899 TRACE("iface %p, desc %p\n", iface, desc);
1901 if(This == &null_variable)
1903 WARN("Null variable specified\n");
1904 return E_FAIL;
1907 if(!desc)
1909 WARN("Invalid argument specified\n");
1910 return E_INVALIDARG;
1913 memset(desc, 0, sizeof(*desc));
1914 desc->Name = This->name;
1915 desc->Semantic = This->semantic;
1916 desc->Flags = This->flag;
1917 desc->Annotations = This->annotation_count;
1918 desc->BufferOffset = This->buffer_offset;
1920 if( This->flag == D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT)
1922 desc->ExplicitBindPoint = This->buffer_offset;
1924 else if(This->flag)
1926 FIXME("Unhandled flag %#x!\n", This->flag);
1929 return S_OK;
1932 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByIndex(
1933 ID3D10EffectVariable *iface, UINT index)
1935 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1936 struct d3d10_effect_variable *a;
1938 TRACE("iface %p, index %u\n", iface, index);
1940 if (index >= This->annotation_count)
1942 WARN("Invalid index specified\n");
1943 return (ID3D10EffectVariable *)&null_variable;
1946 a = &This->annotations[index];
1948 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
1950 return (ID3D10EffectVariable *)a;
1953 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName(
1954 ID3D10EffectVariable *iface, LPCSTR name)
1956 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1957 unsigned int i;
1959 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1961 for (i = 0; i < This->annotation_count; ++i)
1963 struct d3d10_effect_variable *a = &This->annotations[i];
1964 if (!strcmp(a->name, name))
1966 TRACE("Returning annotation %p\n", a);
1967 return (ID3D10EffectVariable *)a;
1971 WARN("Invalid name specified\n");
1973 return (ID3D10EffectVariable *)&null_variable;
1976 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex(
1977 ID3D10EffectVariable *iface, UINT index)
1979 FIXME("iface %p, index %u stub!\n", iface, index);
1981 return NULL;
1984 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName(
1985 ID3D10EffectVariable *iface, LPCSTR name)
1987 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1989 return NULL;
1992 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic(
1993 ID3D10EffectVariable *iface, LPCSTR semantic)
1995 FIXME("iface %p, semantic %s stub!\n", iface, debugstr_a(semantic));
1997 return NULL;
2000 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetElement(
2001 ID3D10EffectVariable *iface, UINT index)
2003 FIXME("iface %p, index %u stub!\n", iface, index);
2005 return NULL;
2008 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_GetParentConstantBuffer(
2009 ID3D10EffectVariable *iface)
2011 FIXME("iface %p stub!\n", iface);
2013 return NULL;
2016 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsScalar(
2017 ID3D10EffectVariable *iface)
2019 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2021 TRACE("iface %p\n", iface);
2023 if (This->vtbl == (ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl)
2024 return (ID3D10EffectScalarVariable *)This;
2026 return (ID3D10EffectScalarVariable *)&null_scalar_variable;
2029 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsVector(
2030 ID3D10EffectVariable *iface)
2032 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2034 TRACE("iface %p\n", iface);
2036 if (This->vtbl == (ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl)
2037 return (ID3D10EffectVectorVariable *)This;
2039 return (ID3D10EffectVectorVariable *)&null_vector_variable;
2042 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix(
2043 ID3D10EffectVariable *iface)
2045 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2047 TRACE("iface %p\n", iface);
2049 if (This->vtbl == (ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl)
2050 return (ID3D10EffectMatrixVariable *)This;
2052 return (ID3D10EffectMatrixVariable *)&null_matrix_variable;
2055 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsString(
2056 ID3D10EffectVariable *iface)
2058 FIXME("iface %p stub!\n", iface);
2060 return NULL;
2063 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShaderResource(
2064 ID3D10EffectVariable *iface)
2066 FIXME("iface %p stub!\n", iface);
2068 return NULL;
2071 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRenderTargetView(
2072 ID3D10EffectVariable *iface)
2074 FIXME("iface %p stub!\n", iface);
2076 return NULL;
2079 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencilView(
2080 ID3D10EffectVariable *iface)
2082 FIXME("iface %p stub!\n", iface);
2084 return NULL;
2087 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_AsConstantBuffer(
2088 ID3D10EffectVariable *iface)
2090 FIXME("iface %p stub!\n", iface);
2092 return NULL;
2095 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShader(
2096 ID3D10EffectVariable *iface)
2098 FIXME("iface %p stub!\n", iface);
2100 return NULL;
2103 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsBlend(ID3D10EffectVariable *iface)
2105 FIXME("iface %p stub!\n", iface);
2107 return NULL;
2110 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencil(
2111 ID3D10EffectVariable *iface)
2113 FIXME("iface %p stub!\n", iface);
2115 return NULL;
2118 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRasterizer(
2119 ID3D10EffectVariable *iface)
2121 FIXME("iface %p stub!\n", iface);
2123 return NULL;
2126 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsSampler(
2127 ID3D10EffectVariable *iface)
2129 FIXME("iface %p stub!\n", iface);
2131 return NULL;
2134 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface,
2135 void *data, UINT offset, UINT count)
2137 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
2139 return E_NOTIMPL;
2142 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface,
2143 void *data, UINT offset, UINT count)
2145 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
2147 return E_NOTIMPL;
2150 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl =
2152 /* ID3D10EffectVariable methods */
2153 d3d10_effect_variable_IsValid,
2154 d3d10_effect_variable_GetType,
2155 d3d10_effect_variable_GetDesc,
2156 d3d10_effect_variable_GetAnnotationByIndex,
2157 d3d10_effect_variable_GetAnnotationByName,
2158 d3d10_effect_variable_GetMemberByIndex,
2159 d3d10_effect_variable_GetMemberByName,
2160 d3d10_effect_variable_GetMemberBySemantic,
2161 d3d10_effect_variable_GetElement,
2162 d3d10_effect_variable_GetParentConstantBuffer,
2163 d3d10_effect_variable_AsScalar,
2164 d3d10_effect_variable_AsVector,
2165 d3d10_effect_variable_AsMatrix,
2166 d3d10_effect_variable_AsString,
2167 d3d10_effect_variable_AsShaderResource,
2168 d3d10_effect_variable_AsRenderTargetView,
2169 d3d10_effect_variable_AsDepthStencilView,
2170 d3d10_effect_variable_AsConstantBuffer,
2171 d3d10_effect_variable_AsShader,
2172 d3d10_effect_variable_AsBlend,
2173 d3d10_effect_variable_AsDepthStencil,
2174 d3d10_effect_variable_AsRasterizer,
2175 d3d10_effect_variable_AsSampler,
2176 d3d10_effect_variable_SetRawValue,
2177 d3d10_effect_variable_GetRawValue,
2180 /* ID3D10EffectVariable methods */
2181 static BOOL STDMETHODCALLTYPE d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer *iface)
2183 TRACE("iface %p\n", iface);
2185 return (struct d3d10_effect_variable *)iface != &null_local_buffer;
2188 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer *iface)
2190 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
2193 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer *iface,
2194 D3D10_EFFECT_VARIABLE_DESC *desc)
2196 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
2199 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByIndex(
2200 ID3D10EffectConstantBuffer *iface, UINT index)
2202 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
2205 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByName(
2206 ID3D10EffectConstantBuffer *iface, LPCSTR name)
2208 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
2211 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByIndex(
2212 ID3D10EffectConstantBuffer *iface, UINT index)
2214 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
2217 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByName(
2218 ID3D10EffectConstantBuffer *iface, LPCSTR name)
2220 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
2223 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberBySemantic(
2224 ID3D10EffectConstantBuffer *iface, LPCSTR semantic)
2226 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
2229 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetElement(
2230 ID3D10EffectConstantBuffer *iface, UINT index)
2232 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
2235 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetParentConstantBuffer(
2236 ID3D10EffectConstantBuffer *iface)
2238 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
2241 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsScalar(
2242 ID3D10EffectConstantBuffer *iface)
2244 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
2247 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsVector(
2248 ID3D10EffectConstantBuffer *iface)
2250 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
2253 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsMatrix(
2254 ID3D10EffectConstantBuffer *iface)
2256 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
2259 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsString(
2260 ID3D10EffectConstantBuffer *iface)
2262 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
2265 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShaderResource(
2266 ID3D10EffectConstantBuffer *iface)
2268 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
2271 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRenderTargetView(
2272 ID3D10EffectConstantBuffer *iface)
2274 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
2277 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencilView(
2278 ID3D10EffectConstantBuffer *iface)
2280 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
2283 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsConstantBuffer(
2284 ID3D10EffectConstantBuffer *iface)
2286 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
2289 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShader(
2290 ID3D10EffectConstantBuffer *iface)
2292 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
2295 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer *iface)
2297 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
2300 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencil(
2301 ID3D10EffectConstantBuffer *iface)
2303 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
2306 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRasterizer(
2307 ID3D10EffectConstantBuffer *iface)
2309 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
2312 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsSampler(
2313 ID3D10EffectConstantBuffer *iface)
2315 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
2318 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer *iface,
2319 void *data, UINT offset, UINT count)
2321 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2324 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer *iface,
2325 void *data, UINT offset, UINT count)
2327 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2330 /* ID3D10EffectConstantBuffer methods */
2331 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer *iface,
2332 ID3D10Buffer *buffer)
2334 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
2336 return E_NOTIMPL;
2339 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer *iface,
2340 ID3D10Buffer **buffer)
2342 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
2344 return E_NOTIMPL;
2347 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer *iface,
2348 ID3D10ShaderResourceView *view)
2350 FIXME("iface %p, view %p stub!\n", iface, view);
2352 return E_NOTIMPL;
2355 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer *iface,
2356 ID3D10ShaderResourceView **view)
2358 FIXME("iface %p, view %p stub!\n", iface, view);
2360 return E_NOTIMPL;
2363 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl =
2365 /* ID3D10EffectVariable methods */
2366 d3d10_effect_constant_buffer_IsValid,
2367 d3d10_effect_constant_buffer_GetType,
2368 d3d10_effect_constant_buffer_GetDesc,
2369 d3d10_effect_constant_buffer_GetAnnotationByIndex,
2370 d3d10_effect_constant_buffer_GetAnnotationByName,
2371 d3d10_effect_constant_buffer_GetMemberByIndex,
2372 d3d10_effect_constant_buffer_GetMemberByName,
2373 d3d10_effect_constant_buffer_GetMemberBySemantic,
2374 d3d10_effect_constant_buffer_GetElement,
2375 d3d10_effect_constant_buffer_GetParentConstantBuffer,
2376 d3d10_effect_constant_buffer_AsScalar,
2377 d3d10_effect_constant_buffer_AsVector,
2378 d3d10_effect_constant_buffer_AsMatrix,
2379 d3d10_effect_constant_buffer_AsString,
2380 d3d10_effect_constant_buffer_AsShaderResource,
2381 d3d10_effect_constant_buffer_AsRenderTargetView,
2382 d3d10_effect_constant_buffer_AsDepthStencilView,
2383 d3d10_effect_constant_buffer_AsConstantBuffer,
2384 d3d10_effect_constant_buffer_AsShader,
2385 d3d10_effect_constant_buffer_AsBlend,
2386 d3d10_effect_constant_buffer_AsDepthStencil,
2387 d3d10_effect_constant_buffer_AsRasterizer,
2388 d3d10_effect_constant_buffer_AsSampler,
2389 d3d10_effect_constant_buffer_SetRawValue,
2390 d3d10_effect_constant_buffer_GetRawValue,
2391 /* ID3D10EffectConstantBuffer methods */
2392 d3d10_effect_constant_buffer_SetConstantBuffer,
2393 d3d10_effect_constant_buffer_GetConstantBuffer,
2394 d3d10_effect_constant_buffer_SetTextureBuffer,
2395 d3d10_effect_constant_buffer_GetTextureBuffer,
2398 /* ID3D10EffectVariable methods */
2400 static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
2402 TRACE("iface %p\n", iface);
2404 return (struct d3d10_effect_variable *)iface != &null_scalar_variable;
2407 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetType(
2408 ID3D10EffectScalarVariable *iface)
2410 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
2413 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetDesc(ID3D10EffectScalarVariable *iface,
2414 D3D10_EFFECT_VARIABLE_DESC *desc)
2416 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
2419 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByIndex(
2420 ID3D10EffectScalarVariable *iface, UINT index)
2422 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
2425 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByName(
2426 ID3D10EffectScalarVariable *iface, LPCSTR name)
2428 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
2431 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByIndex(
2432 ID3D10EffectScalarVariable *iface, UINT index)
2434 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
2437 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByName(
2438 ID3D10EffectScalarVariable *iface, LPCSTR name)
2440 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
2443 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberBySemantic(
2444 ID3D10EffectScalarVariable *iface, LPCSTR semantic)
2446 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
2449 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetElement(
2450 ID3D10EffectScalarVariable *iface, UINT index)
2452 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
2455 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetParentConstantBuffer(
2456 ID3D10EffectScalarVariable *iface)
2458 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
2461 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsScalar(
2462 ID3D10EffectScalarVariable *iface)
2464 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
2467 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsVector(
2468 ID3D10EffectScalarVariable *iface)
2470 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
2473 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsMatrix(
2474 ID3D10EffectScalarVariable *iface)
2476 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
2479 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsString(
2480 ID3D10EffectScalarVariable *iface)
2482 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
2485 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShaderResource(
2486 ID3D10EffectScalarVariable *iface)
2488 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
2491 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRenderTargetView(
2492 ID3D10EffectScalarVariable *iface)
2494 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
2497 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencilView(
2498 ID3D10EffectScalarVariable *iface)
2500 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
2503 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsConstantBuffer(
2504 ID3D10EffectScalarVariable *iface)
2506 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
2509 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShader(
2510 ID3D10EffectScalarVariable *iface)
2512 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
2515 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsBlend(
2516 ID3D10EffectScalarVariable *iface)
2518 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
2521 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencil(
2522 ID3D10EffectScalarVariable *iface)
2524 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
2527 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRasterizer(
2528 ID3D10EffectScalarVariable *iface)
2530 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
2533 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsSampler(
2534 ID3D10EffectScalarVariable *iface)
2536 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
2539 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetRawValue(ID3D10EffectScalarVariable *iface,
2540 void *data, UINT offset, UINT count)
2542 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2545 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetRawValue(ID3D10EffectScalarVariable *iface,
2546 void *data, UINT offset, UINT count)
2548 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2551 /* ID3D10EffectScalarVariable methods */
2553 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable *iface,
2554 float value)
2556 FIXME("iface %p, value %.8e stub!\n", iface, value);
2558 return E_NOTIMPL;
2561 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable *iface,
2562 float *value)
2564 FIXME("iface %p, value %p stub!\n", iface, value);
2566 return E_NOTIMPL;
2569 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable *iface,
2570 float *values, UINT offset, UINT count)
2572 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2574 return E_NOTIMPL;
2577 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable *iface,
2578 float *values, UINT offset, UINT count)
2580 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2582 return E_NOTIMPL;
2585 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable *iface,
2586 int value)
2588 FIXME("iface %p, value %d stub!\n", iface, value);
2590 return E_NOTIMPL;
2593 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable *iface,
2594 int *value)
2596 FIXME("iface %p, value %p stub!\n", iface, value);
2598 return E_NOTIMPL;
2601 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable *iface,
2602 int *values, UINT offset, UINT count)
2604 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2606 return E_NOTIMPL;
2609 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable *iface,
2610 int *values, UINT offset, UINT count)
2612 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2614 return E_NOTIMPL;
2617 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable *iface,
2618 BOOL value)
2620 FIXME("iface %p, value %d stub!\n", iface, value);
2622 return E_NOTIMPL;
2625 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable *iface,
2626 BOOL *value)
2628 FIXME("iface %p, value %p stub!\n", iface, value);
2630 return E_NOTIMPL;
2633 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable *iface,
2634 BOOL *values, UINT offset, UINT count)
2636 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2638 return E_NOTIMPL;
2641 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable *iface,
2642 BOOL *values, UINT offset, UINT count)
2644 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2646 return E_NOTIMPL;
2649 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl =
2651 /* ID3D10EffectVariable methods */
2652 d3d10_effect_scalar_variable_IsValid,
2653 d3d10_effect_scalar_variable_GetType,
2654 d3d10_effect_scalar_variable_GetDesc,
2655 d3d10_effect_scalar_variable_GetAnnotationByIndex,
2656 d3d10_effect_scalar_variable_GetAnnotationByName,
2657 d3d10_effect_scalar_variable_GetMemberByIndex,
2658 d3d10_effect_scalar_variable_GetMemberByName,
2659 d3d10_effect_scalar_variable_GetMemberBySemantic,
2660 d3d10_effect_scalar_variable_GetElement,
2661 d3d10_effect_scalar_variable_GetParentConstantBuffer,
2662 d3d10_effect_scalar_variable_AsScalar,
2663 d3d10_effect_scalar_variable_AsVector,
2664 d3d10_effect_scalar_variable_AsMatrix,
2665 d3d10_effect_scalar_variable_AsString,
2666 d3d10_effect_scalar_variable_AsShaderResource,
2667 d3d10_effect_scalar_variable_AsRenderTargetView,
2668 d3d10_effect_scalar_variable_AsDepthStencilView,
2669 d3d10_effect_scalar_variable_AsConstantBuffer,
2670 d3d10_effect_scalar_variable_AsShader,
2671 d3d10_effect_scalar_variable_AsBlend,
2672 d3d10_effect_scalar_variable_AsDepthStencil,
2673 d3d10_effect_scalar_variable_AsRasterizer,
2674 d3d10_effect_scalar_variable_AsSampler,
2675 d3d10_effect_scalar_variable_SetRawValue,
2676 d3d10_effect_scalar_variable_GetRawValue,
2677 /* ID3D10EffectScalarVariable methods */
2678 d3d10_effect_scalar_variable_SetFloat,
2679 d3d10_effect_scalar_variable_GetFloat,
2680 d3d10_effect_scalar_variable_SetFloatArray,
2681 d3d10_effect_scalar_variable_GetFloatArray,
2682 d3d10_effect_scalar_variable_SetInt,
2683 d3d10_effect_scalar_variable_GetInt,
2684 d3d10_effect_scalar_variable_SetIntArray,
2685 d3d10_effect_scalar_variable_GetIntArray,
2686 d3d10_effect_scalar_variable_SetBool,
2687 d3d10_effect_scalar_variable_GetBool,
2688 d3d10_effect_scalar_variable_SetBoolArray,
2689 d3d10_effect_scalar_variable_GetBoolArray,
2692 /* ID3D10EffectVariable methods */
2694 static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
2696 TRACE("iface %p\n", iface);
2698 return (struct d3d10_effect_variable *)iface != &null_vector_variable;
2701 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetType(
2702 ID3D10EffectVectorVariable *iface)
2704 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
2707 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable *iface,
2708 D3D10_EFFECT_VARIABLE_DESC *desc)
2710 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
2713 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByIndex(
2714 ID3D10EffectVectorVariable *iface, UINT index)
2716 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
2719 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByName(
2720 ID3D10EffectVectorVariable *iface, LPCSTR name)
2722 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
2725 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByIndex(
2726 ID3D10EffectVectorVariable *iface, UINT index)
2728 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
2731 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByName(
2732 ID3D10EffectVectorVariable *iface, LPCSTR name)
2734 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
2737 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberBySemantic(
2738 ID3D10EffectVectorVariable *iface, LPCSTR semantic)
2740 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
2743 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetElement(
2744 ID3D10EffectVectorVariable *iface, UINT index)
2746 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
2749 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetParentConstantBuffer(
2750 ID3D10EffectVectorVariable *iface)
2752 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
2755 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsScalar(
2756 ID3D10EffectVectorVariable *iface)
2758 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
2761 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsVector(
2762 ID3D10EffectVectorVariable *iface)
2764 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
2767 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsMatrix(
2768 ID3D10EffectVectorVariable *iface)
2770 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
2773 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsString(
2774 ID3D10EffectVectorVariable *iface)
2776 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
2779 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShaderResource(
2780 ID3D10EffectVectorVariable *iface)
2782 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
2785 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRenderTargetView(
2786 ID3D10EffectVectorVariable *iface)
2788 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
2791 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencilView(
2792 ID3D10EffectVectorVariable *iface)
2794 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
2797 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsConstantBuffer(
2798 ID3D10EffectVectorVariable *iface)
2800 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
2803 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShader(
2804 ID3D10EffectVectorVariable *iface)
2806 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
2809 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsBlend(
2810 ID3D10EffectVectorVariable *iface)
2812 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
2815 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencil(
2816 ID3D10EffectVectorVariable *iface)
2818 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
2821 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRasterizer(
2822 ID3D10EffectVectorVariable *iface)
2824 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
2827 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsSampler(
2828 ID3D10EffectVectorVariable *iface)
2830 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
2833 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable *iface,
2834 void *data, UINT offset, UINT count)
2836 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2839 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable *iface,
2840 void *data, UINT offset, UINT count)
2842 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2845 /* ID3D10EffectVectorVariable methods */
2847 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable *iface,
2848 BOOL *value)
2850 FIXME("iface %p, value %p stub!\n", iface, value);
2852 return E_NOTIMPL;
2855 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable *iface,
2856 int *value)
2858 FIXME("iface %p, value %p stub!\n", iface, value);
2860 return E_NOTIMPL;
2863 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable *iface,
2864 float *value)
2866 FIXME("iface %p, value %p stub!\n", iface, value);
2868 return E_NOTIMPL;
2871 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable *iface,
2872 BOOL *value)
2874 FIXME("iface %p, value %p stub!\n", iface, value);
2876 return E_NOTIMPL;
2879 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable *iface,
2880 int *value)
2882 FIXME("iface %p, value %p stub!\n", iface, value);
2884 return E_NOTIMPL;
2887 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable *iface,
2888 float *value)
2890 FIXME("iface %p, value %p stub!\n", iface, value);
2892 return E_NOTIMPL;
2895 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable *iface,
2896 BOOL *values, UINT offset, UINT count)
2898 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2900 return E_NOTIMPL;
2903 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable *iface,
2904 int *values, UINT offset, UINT count)
2906 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2908 return E_NOTIMPL;
2911 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable *iface,
2912 float *values, UINT offset, UINT count)
2914 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2916 return E_NOTIMPL;
2919 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable *iface,
2920 BOOL *values, UINT offset, UINT count)
2922 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2924 return E_NOTIMPL;
2927 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable *iface,
2928 int *values, UINT offset, UINT count)
2930 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2932 return E_NOTIMPL;
2935 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable *iface,
2936 float *values, UINT offset, UINT count)
2938 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2940 return E_NOTIMPL;
2943 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl =
2945 /* ID3D10EffectVariable methods */
2946 d3d10_effect_vector_variable_IsValid,
2947 d3d10_effect_vector_variable_GetType,
2948 d3d10_effect_vector_variable_GetDesc,
2949 d3d10_effect_vector_variable_GetAnnotationByIndex,
2950 d3d10_effect_vector_variable_GetAnnotationByName,
2951 d3d10_effect_vector_variable_GetMemberByIndex,
2952 d3d10_effect_vector_variable_GetMemberByName,
2953 d3d10_effect_vector_variable_GetMemberBySemantic,
2954 d3d10_effect_vector_variable_GetElement,
2955 d3d10_effect_vector_variable_GetParentConstantBuffer,
2956 d3d10_effect_vector_variable_AsScalar,
2957 d3d10_effect_vector_variable_AsVector,
2958 d3d10_effect_vector_variable_AsMatrix,
2959 d3d10_effect_vector_variable_AsString,
2960 d3d10_effect_vector_variable_AsShaderResource,
2961 d3d10_effect_vector_variable_AsRenderTargetView,
2962 d3d10_effect_vector_variable_AsDepthStencilView,
2963 d3d10_effect_vector_variable_AsConstantBuffer,
2964 d3d10_effect_vector_variable_AsShader,
2965 d3d10_effect_vector_variable_AsBlend,
2966 d3d10_effect_vector_variable_AsDepthStencil,
2967 d3d10_effect_vector_variable_AsRasterizer,
2968 d3d10_effect_vector_variable_AsSampler,
2969 d3d10_effect_vector_variable_SetRawValue,
2970 d3d10_effect_vector_variable_GetRawValue,
2971 /* ID3D10EffectVectorVariable methods */
2972 d3d10_effect_vector_variable_SetBoolVector,
2973 d3d10_effect_vector_variable_SetIntVector,
2974 d3d10_effect_vector_variable_SetFloatVector,
2975 d3d10_effect_vector_variable_GetBoolVector,
2976 d3d10_effect_vector_variable_GetIntVector,
2977 d3d10_effect_vector_variable_GetFloatVector,
2978 d3d10_effect_vector_variable_SetBoolVectorArray,
2979 d3d10_effect_vector_variable_SetIntVectorArray,
2980 d3d10_effect_vector_variable_SetFloatVectorArray,
2981 d3d10_effect_vector_variable_GetBoolVectorArray,
2982 d3d10_effect_vector_variable_GetIntVectorArray,
2983 d3d10_effect_vector_variable_GetFloatVectorArray,
2986 /* ID3D10EffectVariable methods */
2988 static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
2990 TRACE("iface %p\n", iface);
2992 return (struct d3d10_effect_variable *)iface != &null_matrix_variable;
2995 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetType(
2996 ID3D10EffectMatrixVariable *iface)
2998 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3001 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetDesc(ID3D10EffectMatrixVariable *iface,
3002 D3D10_EFFECT_VARIABLE_DESC *desc)
3004 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3007 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByIndex(
3008 ID3D10EffectMatrixVariable *iface, UINT index)
3010 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3013 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByName(
3014 ID3D10EffectMatrixVariable *iface, LPCSTR name)
3016 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3019 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByIndex(
3020 ID3D10EffectMatrixVariable *iface, UINT index)
3022 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3025 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByName(
3026 ID3D10EffectMatrixVariable *iface, LPCSTR name)
3028 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3031 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberBySemantic(
3032 ID3D10EffectMatrixVariable *iface, LPCSTR semantic)
3034 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3037 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetElement(
3038 ID3D10EffectMatrixVariable *iface, UINT index)
3040 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3043 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetParentConstantBuffer(
3044 ID3D10EffectMatrixVariable *iface)
3046 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3049 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsScalar(
3050 ID3D10EffectMatrixVariable *iface)
3052 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3055 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsVector(
3056 ID3D10EffectMatrixVariable *iface)
3058 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3061 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsMatrix(
3062 ID3D10EffectMatrixVariable *iface)
3064 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3067 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsString(
3068 ID3D10EffectMatrixVariable *iface)
3070 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3073 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShaderResource(
3074 ID3D10EffectMatrixVariable *iface)
3076 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3079 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRenderTargetView(
3080 ID3D10EffectMatrixVariable *iface)
3082 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3085 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencilView(
3086 ID3D10EffectMatrixVariable *iface)
3088 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3091 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsConstantBuffer(
3092 ID3D10EffectMatrixVariable *iface)
3094 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3097 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShader(
3098 ID3D10EffectMatrixVariable *iface)
3100 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3103 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsBlend(
3104 ID3D10EffectMatrixVariable *iface)
3106 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3109 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencil(
3110 ID3D10EffectMatrixVariable *iface)
3112 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3115 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRasterizer(
3116 ID3D10EffectMatrixVariable *iface)
3118 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3121 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsSampler(
3122 ID3D10EffectMatrixVariable *iface)
3124 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3127 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetRawValue(ID3D10EffectMatrixVariable *iface,
3128 void *data, UINT offset, UINT count)
3130 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3133 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetRawValue(ID3D10EffectMatrixVariable *iface,
3134 void *data, UINT offset, UINT count)
3136 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3139 /* ID3D10EffectMatrixVariable methods */
3141 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrix(ID3D10EffectMatrixVariable *iface,
3142 float *data)
3144 FIXME("iface %p, data %p stub!\n", iface, data);
3146 return E_NOTIMPL;
3149 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrix(ID3D10EffectMatrixVariable *iface,
3150 float *data)
3152 FIXME("iface %p, data %p stub!\n", iface, data);
3154 return E_NOTIMPL;
3157 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixArray(ID3D10EffectMatrixVariable *iface,
3158 float *data, UINT offset, UINT count)
3160 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3162 return E_NOTIMPL;
3165 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixArray(ID3D10EffectMatrixVariable *iface,
3166 float *data, UINT offset, UINT count)
3168 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3170 return E_NOTIMPL;
3173 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
3174 float *data)
3176 FIXME("iface %p, data %p stub!\n", iface, data);
3178 return E_NOTIMPL;
3181 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
3182 float *data)
3184 FIXME("iface %p, data %p stub!\n", iface, data);
3186 return E_NOTIMPL;
3189 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
3190 float *data, UINT offset, UINT count)
3192 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3194 return E_NOTIMPL;
3197 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
3198 float *data, UINT offset, UINT count)
3200 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3202 return E_NOTIMPL;
3206 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl =
3208 /* ID3D10EffectVariable methods */
3209 d3d10_effect_matrix_variable_IsValid,
3210 d3d10_effect_matrix_variable_GetType,
3211 d3d10_effect_matrix_variable_GetDesc,
3212 d3d10_effect_matrix_variable_GetAnnotationByIndex,
3213 d3d10_effect_matrix_variable_GetAnnotationByName,
3214 d3d10_effect_matrix_variable_GetMemberByIndex,
3215 d3d10_effect_matrix_variable_GetMemberByName,
3216 d3d10_effect_matrix_variable_GetMemberBySemantic,
3217 d3d10_effect_matrix_variable_GetElement,
3218 d3d10_effect_matrix_variable_GetParentConstantBuffer,
3219 d3d10_effect_matrix_variable_AsScalar,
3220 d3d10_effect_matrix_variable_AsVector,
3221 d3d10_effect_matrix_variable_AsMatrix,
3222 d3d10_effect_matrix_variable_AsString,
3223 d3d10_effect_matrix_variable_AsShaderResource,
3224 d3d10_effect_matrix_variable_AsRenderTargetView,
3225 d3d10_effect_matrix_variable_AsDepthStencilView,
3226 d3d10_effect_matrix_variable_AsConstantBuffer,
3227 d3d10_effect_matrix_variable_AsShader,
3228 d3d10_effect_matrix_variable_AsBlend,
3229 d3d10_effect_matrix_variable_AsDepthStencil,
3230 d3d10_effect_matrix_variable_AsRasterizer,
3231 d3d10_effect_matrix_variable_AsSampler,
3232 d3d10_effect_matrix_variable_SetRawValue,
3233 d3d10_effect_matrix_variable_GetRawValue,
3234 /* ID3D10EffectMatrixVariable methods */
3235 d3d10_effect_matrix_variable_SetMatrix,
3236 d3d10_effect_matrix_variable_GetMatrix,
3237 d3d10_effect_matrix_variable_SetMatrixArray,
3238 d3d10_effect_matrix_variable_GetMatrixArray,
3239 d3d10_effect_matrix_variable_SetMatrixTranspose,
3240 d3d10_effect_matrix_variable_GetMatrixTranspose,
3241 d3d10_effect_matrix_variable_SetMatrixTransposeArray,
3242 d3d10_effect_matrix_variable_GetMatrixTransposeArray,
3245 static BOOL STDMETHODCALLTYPE d3d10_effect_type_IsValid(ID3D10EffectType *iface)
3247 FIXME("iface %p stub!\n", iface);
3249 return FALSE;
3252 static HRESULT STDMETHODCALLTYPE d3d10_effect_type_GetDesc(ID3D10EffectType *iface, D3D10_EFFECT_TYPE_DESC *desc)
3254 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
3256 TRACE("iface %p, desc %p\n", iface, desc);
3258 if (This == &null_type)
3260 WARN("Null type specified\n");
3261 return E_FAIL;
3264 if (!desc)
3266 WARN("Invalid argument specified\n");
3267 return E_INVALIDARG;
3270 desc->TypeName = This->name;
3271 desc->Class = This->type_class;
3272 desc->Type = This->basetype;
3273 desc->Elements = This->element_count;
3274 desc->Members = This->member_count;
3275 desc->Rows = This->row_count;
3276 desc->Columns = This->column_count;
3277 desc->PackedSize = This->size_packed;
3278 desc->UnpackedSize = This->size_unpacked;
3279 desc->Stride = This->stride;
3281 return S_OK;
3284 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByIndex(ID3D10EffectType *iface,
3285 UINT index)
3287 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
3288 struct d3d10_effect_type *t;
3290 TRACE("iface %p, index %u\n", iface, index);
3292 if (index >= This->member_count)
3294 WARN("Invalid index specified\n");
3295 return (ID3D10EffectType *)&null_type;
3298 t = (&This->members[index])->type;
3300 TRACE("Returning member %p, %s\n", t, debugstr_a(t->name));
3302 return (ID3D10EffectType *)t;
3305 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByName(ID3D10EffectType *iface,
3306 LPCSTR name)
3308 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
3309 unsigned int i;
3311 TRACE("iface %p, name %s\n", iface, debugstr_a(name));
3313 if (!name)
3315 WARN("Invalid name specified\n");
3316 return (ID3D10EffectType *)&null_type;
3319 for (i = 0; i < This->member_count; ++i)
3321 struct d3d10_effect_type_member *typem = &This->members[i];
3323 if (typem->name)
3325 if (!strcmp(typem->name, name))
3327 TRACE("Returning type %p.\n", typem->type);
3328 return (ID3D10EffectType *)typem->type;
3333 WARN("Invalid name specified\n");
3335 return (ID3D10EffectType *)&null_type;
3338 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeBySemantic(ID3D10EffectType *iface,
3339 LPCSTR semantic)
3341 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
3342 unsigned int i;
3344 TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
3346 if (!semantic)
3348 WARN("Invalid semantic specified\n");
3349 return (ID3D10EffectType *)&null_type;
3352 for (i = 0; i < This->member_count; ++i)
3354 struct d3d10_effect_type_member *typem = &This->members[i];
3356 if (typem->semantic)
3358 if (!strcmp(typem->semantic, semantic))
3360 TRACE("Returning type %p.\n", typem->type);
3361 return (ID3D10EffectType *)typem->type;
3366 WARN("Invalid semantic specified\n");
3368 return (ID3D10EffectType *)&null_type;
3371 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberName(ID3D10EffectType *iface, UINT index)
3373 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
3374 struct d3d10_effect_type_member *typem;
3376 TRACE("iface %p, index %u\n", iface, index);
3378 if (index >= This->member_count)
3380 WARN("Invalid index specified\n");
3381 return NULL;
3384 typem = &This->members[index];
3386 TRACE("Returning name %s\n", debugstr_a(typem->name));
3388 return typem->name;
3391 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberSemantic(ID3D10EffectType *iface, UINT index)
3393 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
3394 struct d3d10_effect_type_member *typem;
3396 TRACE("iface %p, index %u\n", iface, index);
3398 if (index >= This->member_count)
3400 WARN("Invalid index specified\n");
3401 return NULL;
3404 typem = &This->members[index];
3406 TRACE("Returning semantic %s\n", debugstr_a(typem->semantic));
3408 return typem->semantic;
3411 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl =
3413 /* ID3D10EffectType */
3414 d3d10_effect_type_IsValid,
3415 d3d10_effect_type_GetDesc,
3416 d3d10_effect_type_GetMemberTypeByIndex,
3417 d3d10_effect_type_GetMemberTypeByName,
3418 d3d10_effect_type_GetMemberTypeBySemantic,
3419 d3d10_effect_type_GetMemberName,
3420 d3d10_effect_type_GetMemberSemantic,