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
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_local_buffer null_local_buffer =
61 {&d3d10_effect_constant_buffer_vtbl, NULL, NULL, 0, 0, 0, NULL, NULL};
62 static struct d3d10_effect_variable null_variable =
63 {&d3d10_effect_variable_vtbl, NULL, NULL, NULL, 0, 0, 0, NULL, NULL};
64 static struct d3d10_effect_variable null_scalar_variable =
65 {(ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl, NULL, NULL, NULL, 0, 0, 0, NULL, NULL};
66 static struct d3d10_effect_variable null_vector_variable =
67 {(ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl, NULL, NULL, NULL, 0, 0, 0, NULL, NULL};
68 static struct d3d10_effect_variable null_matrix_variable =
69 {(ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl, NULL, NULL, NULL, 0, 0, 0, NULL, NULL};
71 static inline void read_dword(const char **ptr, DWORD *d)
73 memcpy(d, *ptr, sizeof(*d));
77 static inline void skip_dword_unknown(const char **ptr, unsigned int count)
82 FIXME("Skipping %u unknown DWORDs:\n", count);
83 for (i = 0; i < count; ++i)
86 FIXME("\t0x%08x\n", d);
90 static inline void write_dword(char **ptr, DWORD d)
92 memcpy(*ptr, &d, sizeof(d));
96 static inline void write_dword_unknown(char **ptr, DWORD d)
98 FIXME("Writing unknown DWORD 0x%08x\n", d);
102 static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
103 HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx)
105 const char *ptr = data;
112 read_dword(&ptr, &tag);
113 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
117 WARN("Wrong tag.\n");
122 skip_dword_unknown(&ptr, 4);
124 skip_dword_unknown(&ptr, 1);
126 read_dword(&ptr, &total_size);
127 TRACE("total size: %#x\n", total_size);
129 read_dword(&ptr, &chunk_count);
130 TRACE("chunk count: %#x\n", chunk_count);
132 for (i = 0; i < chunk_count; ++i)
134 DWORD chunk_tag, chunk_size;
135 const char *chunk_ptr;
138 read_dword(&ptr, &chunk_offset);
139 TRACE("chunk %u at offset %#x\n", i, chunk_offset);
141 chunk_ptr = data + chunk_offset;
143 read_dword(&chunk_ptr, &chunk_tag);
144 read_dword(&chunk_ptr, &chunk_size);
146 hr = chunk_handler(chunk_ptr, chunk_size, chunk_tag, ctx);
147 if (FAILED(hr)) break;
153 static char *copy_name(const char *ptr)
158 name_len = strlen(ptr) + 1;
159 name = HeapAlloc(GetProcessHeap(), 0, name_len);
162 ERR("Failed to allocate name memory.\n");
166 memcpy(name, ptr, name_len);
171 static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
173 struct d3d10_effect_shader_variable *s = ctx;
175 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
177 TRACE("chunk size: %#x\n", data_size);
183 /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */
184 UINT size = 44 + data_size;
187 s->input_signature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
188 if (!s->input_signature)
190 ERR("Failed to allocate input signature data\n");
191 return E_OUTOFMEMORY;
193 s->input_signature_size = size;
195 ptr = s->input_signature;
197 write_dword(&ptr, TAG_DXBC);
200 write_dword_unknown(&ptr, 0);
201 write_dword_unknown(&ptr, 0);
202 write_dword_unknown(&ptr, 0);
203 write_dword_unknown(&ptr, 0);
205 /* seems to be always 1 */
206 write_dword_unknown(&ptr, 1);
209 write_dword(&ptr, size);
212 write_dword(&ptr, 1);
215 write_dword(&ptr, (ptr - s->input_signature) + 4);
218 write_dword(&ptr, TAG_ISGN);
219 write_dword(&ptr, data_size);
220 memcpy(ptr, data, data_size);
225 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
232 static HRESULT parse_shader(struct d3d10_effect_object *o, const char *data)
234 ID3D10Device *device = o->pass->technique->effect->device;
235 struct d3d10_effect_shader_variable *s;
236 const char *ptr = data;
240 o->data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3d10_effect_shader_variable));
243 ERR("Failed to allocate shader variable memory\n");
244 return E_OUTOFMEMORY;
247 if (!ptr) return S_OK;
251 read_dword(&ptr, &dxbc_size);
252 TRACE("dxbc size: %#x\n", dxbc_size);
256 case D3D10_EOT_VERTEXSHADER:
257 hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &s->shader.vs);
258 if (FAILED(hr)) return hr;
261 case D3D10_EOT_PIXELSHADER:
262 hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &s->shader.ps);
263 if (FAILED(hr)) return hr;
265 case D3D10_EOT_GEOMETRYSHADER:
266 hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &s->shader.gs);
267 if (FAILED(hr)) return hr;
271 return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, s);
274 static D3D10_SHADER_VARIABLE_CLASS d3d10_variable_class(DWORD c)
278 case 1: return D3D10_SVC_SCALAR;
279 case 2: return D3D10_SVC_VECTOR;
280 case 3: return D3D10_SVC_MATRIX_ROWS;
282 FIXME("Unknown variable class %#x.\n", c);
287 static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(DWORD t)
291 case 1: return D3D10_SVT_FLOAT;
292 case 2: return D3D10_SVT_INT;
293 case 3: return D3D10_SVT_UINT;
294 case 4: return D3D10_SVT_BOOL;
296 FIXME("Unknown variable type %#x.\n", t);
301 static HRESULT parse_fx10_type(struct d3d10_effect_type *t, const char *ptr, const char *data)
306 read_dword(&ptr, &offset);
307 TRACE("Type name at offset %#x.\n", offset);
309 t->name = copy_name(data + offset);
312 ERR("Failed to copy name.\n");
313 return E_OUTOFMEMORY;
315 TRACE("Type name: %s.\n", debugstr_a(t->name));
317 read_dword(&ptr, &unknown0);
318 TRACE("Unknown 0: %u.\n", unknown0);
320 read_dword(&ptr, &t->element_count);
321 TRACE("Element count: %u.\n", t->element_count);
323 read_dword(&ptr, &t->size_unpacked);
324 TRACE("Unpacked size: %#x.\n", t->size_unpacked);
326 read_dword(&ptr, &t->stride);
327 TRACE("Stride: %#x.\n", t->stride);
329 read_dword(&ptr, &t->size_packed);
330 TRACE("Packed size %#x.\n", t->size_packed);
338 read_dword(&ptr, &tmp);
339 t->column_count = (tmp & D3D10_FX10_TYPE_COLUMN_MASK) >> D3D10_FX10_TYPE_COLUMN_SHIFT;
340 t->row_count = (tmp & D3D10_FX10_TYPE_ROW_MASK) >> D3D10_FX10_TYPE_ROW_SHIFT;
341 t->basetype = d3d10_variable_type((tmp & D3D10_FX10_TYPE_BASETYPE_MASK) >> D3D10_FX10_TYPE_BASETYPE_SHIFT);
342 t->type_class = d3d10_variable_class((tmp & D3D10_FX10_TYPE_CLASS_MASK) >> D3D10_FX10_TYPE_CLASS_SHIFT);
344 TRACE("Type description: %#x.\n", tmp);
345 TRACE("\tcolumns: %u.\n", t->column_count);
346 TRACE("\trows: %u.\n", t->row_count);
347 TRACE("\tbasetype: %#x.\n", t->basetype);
348 TRACE("\tclass: %#x.\n", t->type_class);
349 TRACE("\tunknown bits: %#x.\n", tmp & ~(D3D10_FX10_TYPE_COLUMN_MASK | D3D10_FX10_TYPE_ROW_MASK
350 | D3D10_FX10_TYPE_BASETYPE_MASK | D3D10_FX10_TYPE_CLASS_MASK));
352 else if (unknown0 == 3)
357 TRACE("Type is a structure.\n");
359 read_dword(&ptr, &t->member_count);
360 TRACE("Member count: %u.\n", t->member_count);
365 t->type_class = D3D10_SVC_STRUCT;
367 for (i = 0; i < t->member_count; ++i)
369 read_dword(&ptr, &tmp);
370 TRACE("Member %u name at offset %#x.\n", i, tmp);
371 TRACE("Member %u name: %s.\n", i, debugstr_a(data + tmp));
373 /* Member semantic? */
374 skip_dword_unknown(&ptr, 1);
376 read_dword(&ptr, &tmp);
377 TRACE("Member %u offset in struct: %#x.\n", i, tmp);
379 read_dword(&ptr, &tmp);
380 TRACE("Member %u type info at offset %#x.\n", i, tmp);
387 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset)
389 struct d3d10_effect_type *type;
390 struct wine_rb_entry *entry;
393 entry = wine_rb_get(&effect->types, &offset);
396 TRACE("Returning existing type.\n");
397 return WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
400 type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*type));
403 ERR("Failed to allocate type memory.\n");
407 type->vtbl = &d3d10_effect_type_vtbl;
409 hr = parse_fx10_type(type, data + offset, data);
412 ERR("Failed to parse type info, hr %#x.\n", hr);
413 HeapFree(GetProcessHeap(), 0, type);
417 if (wine_rb_put(&effect->types, &offset, &type->entry) == -1)
419 ERR("Failed to insert type entry.\n");
420 HeapFree(GetProcessHeap(), 0, type);
427 static HRESULT parse_fx10_variable_head(struct d3d10_effect_variable *v, const char **ptr, const char *data)
431 read_dword(ptr, &offset);
432 TRACE("Variable name at offset %#x.\n", offset);
434 v->name = copy_name(data + offset);
437 ERR("Failed to copy name.\n");
438 return E_OUTOFMEMORY;
440 TRACE("Variable name: %s.\n", debugstr_a(v->name));
442 read_dword(ptr, &offset);
443 TRACE("Variable type info at offset %#x.\n", offset);
445 v->type = get_fx10_type(v->effect, data, offset);
448 ERR("Failed to get variable type.\n");
455 static HRESULT parse_fx10_annotation(struct d3d10_effect_variable *a, const char **ptr, const char *data)
459 hr = parse_fx10_variable_head(a, ptr, data);
460 if (FAILED(hr)) return hr;
462 skip_dword_unknown(ptr, 1);
467 static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr, const char *data)
469 const char *data_ptr;
473 read_dword(ptr, &o->type);
474 TRACE("Effect object is of type %#x.\n", o->type);
476 skip_dword_unknown(ptr, 2);
478 read_dword(ptr, &offset);
479 TRACE("Effect object idx is at offset %#x.\n", offset);
481 data_ptr = data + offset;
482 read_dword(&data_ptr, &offset);
484 TRACE("Effect object starts at offset %#x.\n", offset);
486 /* FIXME: This probably isn't completely correct. */
489 WARN("Skipping effect object.\n");
494 data_ptr = data + offset;
499 case D3D10_EOT_VERTEXSHADER:
500 TRACE("Vertex shader\n");
501 hr = parse_shader(o, data_ptr);
504 case D3D10_EOT_PIXELSHADER:
505 TRACE("Pixel shader\n");
506 hr = parse_shader(o, data_ptr);
509 case D3D10_EOT_GEOMETRYSHADER:
510 TRACE("Geometry shader\n");
511 hr = parse_shader(o, data_ptr);
515 FIXME("Unhandled object type %#x\n", o->type);
523 static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, const char *data)
529 read_dword(ptr, &offset);
530 TRACE("Pass name at offset %#x.\n", offset);
532 p->name = copy_name(data + offset);
535 ERR("Failed to copy name.\n");
536 return E_OUTOFMEMORY;
538 TRACE("Pass name: %s.\n", debugstr_a(p->name));
540 read_dword(ptr, &p->object_count);
541 TRACE("Pass has %u effect objects.\n", p->object_count);
543 read_dword(ptr, &p->annotation_count);
544 TRACE("Pass has %u annotations.\n", p->annotation_count);
546 p->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->annotation_count * sizeof(*p->annotations));
549 ERR("Failed to allocate pass annotations memory.\n");
550 return E_OUTOFMEMORY;
553 for(i = 0; i < p->annotation_count; ++i)
555 struct d3d10_effect_variable *a = &p->annotations[i];
557 a->vtbl = &d3d10_effect_variable_vtbl;
558 a->effect = p->technique->effect;
560 hr = parse_fx10_annotation(a, ptr, data);
561 if (FAILED(hr)) return hr;
564 p->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->object_count * sizeof(*p->objects));
567 ERR("Failed to allocate effect objects memory.\n");
568 return E_OUTOFMEMORY;
571 for (i = 0; i < p->object_count; ++i)
573 struct d3d10_effect_object *o = &p->objects[i];
577 hr = parse_fx10_object(o, ptr, data);
578 if (FAILED(hr)) return hr;
584 static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char **ptr, const char *data)
590 read_dword(ptr, &offset);
591 TRACE("Technique name at offset %#x.\n", offset);
593 t->name = copy_name(data + offset);
596 ERR("Failed to copy name.\n");
597 return E_OUTOFMEMORY;
599 TRACE("Technique name: %s.\n", debugstr_a(t->name));
601 read_dword(ptr, &t->pass_count);
602 TRACE("Technique has %u passes\n", t->pass_count);
604 read_dword(ptr, &t->annotation_count);
605 TRACE("Technique has %u annotations.\n", t->annotation_count);
607 t->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->annotation_count * sizeof(*t->annotations));
610 ERR("Failed to allocate technique annotations memory.\n");
611 return E_OUTOFMEMORY;
614 for(i = 0; i < t->annotation_count; ++i)
616 struct d3d10_effect_variable *a = &t->annotations[i];
618 a->vtbl = &d3d10_effect_variable_vtbl;
619 a->effect = t->effect;
621 hr = parse_fx10_annotation(a, ptr, data);
622 if (FAILED(hr)) return hr;
625 t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes));
628 ERR("Failed to allocate passes memory\n");
629 return E_OUTOFMEMORY;
632 for (i = 0; i < t->pass_count; ++i)
634 struct d3d10_effect_pass *p = &t->passes[i];
636 p->vtbl = &d3d10_effect_pass_vtbl;
639 hr = parse_fx10_pass(p, ptr, data);
640 if (FAILED(hr)) return hr;
646 static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
651 hr = parse_fx10_variable_head(v, ptr, data);
652 if (FAILED(hr)) return hr;
654 switch (v->type->type_class)
656 case D3D10_SVC_SCALAR:
657 v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl;
660 case D3D10_SVC_VECTOR:
661 v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl;
664 case D3D10_SVC_MATRIX_ROWS:
665 case D3D10_SVC_MATRIX_COLUMNS:
666 v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl;
670 FIXME("Unhandled type class %s.\n", debug_d3d10_shader_variable_class(v->type->type_class));
671 v->vtbl = &d3d10_effect_variable_vtbl;
675 skip_dword_unknown(ptr, 1);
677 read_dword(ptr, &v->buffer_offset);
678 TRACE("Variable offset in buffer: %#x.\n", v->buffer_offset);
680 skip_dword_unknown(ptr, 1);
682 read_dword(ptr, &v->flag);
683 TRACE("Variable flag: %#x.\n", v->flag);
685 read_dword(ptr, &v->annotation_count);
686 TRACE("Variable has %u annotations.\n", v->annotation_count);
688 v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
691 ERR("Failed to allocate variable annotations memory.\n");
692 return E_OUTOFMEMORY;
695 for(i = 0; i < v->annotation_count; ++i)
697 struct d3d10_effect_variable *a = &v->annotations[i];
700 a->vtbl = &d3d10_effect_variable_vtbl;
701 a->effect = v->effect;
703 hr = parse_fx10_annotation(a, ptr, data);
704 if (FAILED(hr)) return hr;
710 static HRESULT parse_fx10_local_buffer(struct d3d10_effect_local_buffer *l, const char **ptr, const char *data)
716 read_dword(ptr, &offset);
717 TRACE("Local buffer name at offset %#x.\n", offset);
719 l->name = copy_name(data + offset);
722 ERR("Failed to copy name.\n");
723 return E_OUTOFMEMORY;
725 TRACE("Local buffer name: %s.\n", debugstr_a(l->name));
727 read_dword(ptr, &l->data_size);
728 TRACE("Local buffer data size: %#x.\n", l->data_size);
730 skip_dword_unknown(ptr, 1);
732 read_dword(ptr, &l->variable_count);
733 TRACE("Local buffer variable count: %#x.\n", l->variable_count);
735 skip_dword_unknown(ptr, 1);
737 read_dword(ptr, &l->annotation_count);
738 TRACE("Local buffer has %u annotations.\n", l->annotation_count);
740 l->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->annotation_count * sizeof(*l->annotations));
743 ERR("Failed to allocate local buffer annotations memory.\n");
744 return E_OUTOFMEMORY;
747 for(i = 0; i < l->annotation_count; ++i)
749 struct d3d10_effect_variable *a = &l->annotations[i];
751 a->vtbl = &d3d10_effect_variable_vtbl;
752 a->effect = l->effect;
754 hr = parse_fx10_annotation(a, ptr, data);
755 if (FAILED(hr)) return hr;
758 l->variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->variable_count * sizeof(*l->variables));
761 ERR("Failed to allocate variables memory.\n");
762 return E_OUTOFMEMORY;
765 for (i = 0; i < l->variable_count; ++i)
767 struct d3d10_effect_variable *v = &l->variables[i];
770 v->effect = l->effect;
772 hr = parse_fx10_variable(v, ptr, data);
773 if (FAILED(hr)) return hr;
779 static int d3d10_effect_type_compare(const void *key, const struct wine_rb_entry *entry)
781 const struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, const struct d3d10_effect_type, entry);
782 const DWORD *id = key;
787 static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context)
789 struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
791 TRACE("effect type %p.\n", t);
793 HeapFree(GetProcessHeap(), 0, t->name);
794 HeapFree(GetProcessHeap(), 0, t);
797 static const struct wine_rb_functions d3d10_effect_type_rb_functions =
802 d3d10_effect_type_compare,
805 static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size)
807 const char *ptr = data + e->index_offset;
811 if (wine_rb_init(&e->types, &d3d10_effect_type_rb_functions) == -1)
813 ERR("Failed to initialize type rbtree.\n");
817 e->local_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_buffer_count * sizeof(*e->local_buffers));
818 if (!e->local_buffers)
820 ERR("Failed to allocate local buffer memory.\n");
821 return E_OUTOFMEMORY;
824 e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques));
827 ERR("Failed to allocate techniques memory\n");
828 return E_OUTOFMEMORY;
831 for (i = 0; i < e->local_buffer_count; ++i)
833 struct d3d10_effect_local_buffer *l = &e->local_buffers[i];
834 l->vtbl = &d3d10_effect_constant_buffer_vtbl;
837 hr = parse_fx10_local_buffer(l, &ptr, data);
838 if (FAILED(hr)) return hr;
841 for (i = 0; i < e->technique_count; ++i)
843 struct d3d10_effect_technique *t = &e->techniques[i];
845 t->vtbl = &d3d10_effect_technique_vtbl;
848 hr = parse_fx10_technique(t, &ptr, data);
849 if (FAILED(hr)) return hr;
855 static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_size)
857 const char *ptr = data;
860 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
861 read_dword(&ptr, &e->version);
862 TRACE("Target: %#x\n", e->version);
864 read_dword(&ptr, &e->local_buffer_count);
865 TRACE("Local buffer count: %u.\n", e->local_buffer_count);
867 read_dword(&ptr, &e->variable_count);
868 TRACE("Variable count: %u\n", e->variable_count);
870 read_dword(&ptr, &e->object_count);
871 TRACE("Object count: %u\n", e->object_count);
873 read_dword(&ptr, &e->sharedbuffers_count);
874 TRACE("Sharedbuffers count: %u\n", e->sharedbuffers_count);
876 /* Number of variables in shared buffers? */
877 read_dword(&ptr, &unknown);
878 FIXME("Unknown 0: %u\n", unknown);
880 read_dword(&ptr, &e->sharedobjects_count);
881 TRACE("Sharedobjects count: %u\n", e->sharedobjects_count);
883 read_dword(&ptr, &e->technique_count);
884 TRACE("Technique count: %u\n", e->technique_count);
886 read_dword(&ptr, &e->index_offset);
887 TRACE("Index offset: %#x\n", e->index_offset);
889 read_dword(&ptr, &unknown);
890 FIXME("Unknown 1: %u\n", unknown);
892 read_dword(&ptr, &e->texture_count);
893 TRACE("Texture count: %u\n", e->texture_count);
895 read_dword(&ptr, &e->dephstencilstate_count);
896 TRACE("Depthstencilstate count: %u\n", e->dephstencilstate_count);
898 read_dword(&ptr, &e->blendstate_count);
899 TRACE("Blendstate count: %u\n", e->blendstate_count);
901 read_dword(&ptr, &e->rasterizerstate_count);
902 TRACE("Rasterizerstate count: %u\n", e->rasterizerstate_count);
904 read_dword(&ptr, &e->samplerstate_count);
905 TRACE("Samplerstate count: %u\n", e->samplerstate_count);
907 read_dword(&ptr, &e->rendertargetview_count);
908 TRACE("Rendertargetview count: %u\n", e->rendertargetview_count);
910 read_dword(&ptr, &e->depthstencilview_count);
911 TRACE("Depthstencilview count: %u\n", e->depthstencilview_count);
913 read_dword(&ptr, &e->shader_call_count);
914 TRACE("Shader call count: %u\n", e->shader_call_count);
916 read_dword(&ptr, &e->shader_compile_count);
917 TRACE("Shader compile count: %u\n", e->shader_compile_count);
919 return parse_fx10_body(e, ptr, data_size - (ptr - data));
922 static HRESULT fx10_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
924 struct d3d10_effect *e = ctx;
926 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
928 TRACE("chunk size: %#x\n", data_size);
933 return parse_fx10(e, data, data_size);
936 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
941 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size)
943 return parse_dxbc(data, data_size, fx10_chunk_handler, This);
946 static void d3d10_effect_object_destroy(struct d3d10_effect_object *o)
948 TRACE("effect object %p.\n", o);
952 case D3D10_EOT_VERTEXSHADER:
953 case D3D10_EOT_PIXELSHADER:
954 case D3D10_EOT_GEOMETRYSHADER:
955 HeapFree(GetProcessHeap(), 0, ((struct d3d10_effect_shader_variable *)o->data)->input_signature);
961 HeapFree(GetProcessHeap(), 0, o->data);
964 static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
966 ID3D10Device *device = o->pass->technique->effect->device;
968 TRACE("effect object %p, type %#x.\n", o, o->type);
972 case D3D10_EOT_VERTEXSHADER:
973 ID3D10Device_VSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.vs);
976 case D3D10_EOT_PIXELSHADER:
977 ID3D10Device_PSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.ps);
980 case D3D10_EOT_GEOMETRYSHADER:
981 ID3D10Device_GSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.gs);
985 FIXME("Unhandled effect object type %#x.\n", o->type);
990 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
992 TRACE("variable %p.\n", v);
994 HeapFree(GetProcessHeap(), 0, v->name);
998 for (i = 0; i < v->annotation_count; ++i)
1000 d3d10_effect_variable_destroy(&v->annotations[i]);
1002 HeapFree(GetProcessHeap(), 0, v->annotations);
1006 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p)
1010 TRACE("pass %p\n", p);
1012 HeapFree(GetProcessHeap(), 0, p->name);
1015 for (i = 0; i < p->object_count; ++i)
1017 d3d10_effect_object_destroy(&p->objects[i]);
1019 HeapFree(GetProcessHeap(), 0, p->objects);
1024 for (i = 0; i < p->annotation_count; ++i)
1026 d3d10_effect_variable_destroy(&p->annotations[i]);
1028 HeapFree(GetProcessHeap(), 0, p->annotations);
1033 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
1037 TRACE("technique %p\n", t);
1039 HeapFree(GetProcessHeap(), 0, t->name);
1042 for (i = 0; i < t->pass_count; ++i)
1044 d3d10_effect_pass_destroy(&t->passes[i]);
1046 HeapFree(GetProcessHeap(), 0, t->passes);
1051 for (i = 0; i < t->annotation_count; ++i)
1053 d3d10_effect_variable_destroy(&t->annotations[i]);
1055 HeapFree(GetProcessHeap(), 0, t->annotations);
1059 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_local_buffer *l)
1063 TRACE("local buffer %p.\n", l);
1065 HeapFree(GetProcessHeap(), 0, l->name);
1068 for (i = 0; i < l->variable_count; ++i)
1070 d3d10_effect_variable_destroy(&l->variables[i]);
1072 HeapFree(GetProcessHeap(), 0, l->variables);
1077 for (i = 0; i < l->annotation_count; ++i)
1079 d3d10_effect_variable_destroy(&l->annotations[i]);
1081 HeapFree(GetProcessHeap(), 0, l->annotations);
1085 /* IUnknown methods */
1087 static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
1089 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
1091 if (IsEqualGUID(riid, &IID_ID3D10Effect)
1092 || IsEqualGUID(riid, &IID_IUnknown))
1094 IUnknown_AddRef(iface);
1099 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
1102 return E_NOINTERFACE;
1105 static ULONG STDMETHODCALLTYPE d3d10_effect_AddRef(ID3D10Effect *iface)
1107 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1108 ULONG refcount = InterlockedIncrement(&This->refcount);
1110 TRACE("%p increasing refcount to %u\n", This, refcount);
1115 static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
1117 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1118 ULONG refcount = InterlockedDecrement(&This->refcount);
1120 TRACE("%p decreasing refcount to %u\n", This, refcount);
1126 if (This->techniques)
1128 for (i = 0; i < This->technique_count; ++i)
1130 d3d10_effect_technique_destroy(&This->techniques[i]);
1132 HeapFree(GetProcessHeap(), 0, This->techniques);
1135 if (This->local_buffers)
1137 for (i = 0; i < This->local_buffer_count; ++i)
1139 d3d10_effect_local_buffer_destroy(&This->local_buffers[i]);
1141 HeapFree(GetProcessHeap(), 0, This->local_buffers);
1144 wine_rb_destroy(&This->types, d3d10_effect_type_destroy, NULL);
1146 ID3D10Device_Release(This->device);
1147 HeapFree(GetProcessHeap(), 0, This);
1153 /* ID3D10Effect methods */
1155 static BOOL STDMETHODCALLTYPE d3d10_effect_IsValid(ID3D10Effect *iface)
1157 FIXME("iface %p stub!\n", iface);
1162 static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
1164 FIXME("iface %p stub!\n", iface);
1169 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
1171 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1173 TRACE("iface %p, device %p\n", iface, device);
1175 ID3D10Device_AddRef(This->device);
1176 *device = This->device;
1181 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)
1183 FIXME("iface %p, desc %p stub!\n", iface, desc);
1188 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface,
1191 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1192 struct d3d10_effect_local_buffer *l;
1194 TRACE("iface %p, index %u\n", iface, index);
1196 if (index >= This->local_buffer_count)
1198 WARN("Invalid index specified\n");
1199 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
1202 l = &This->local_buffers[index];
1204 TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name));
1206 return (ID3D10EffectConstantBuffer *)l;
1209 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,
1212 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1215 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1217 for (i = 0; i < This->local_buffer_count; ++i)
1219 struct d3d10_effect_local_buffer *l = &This->local_buffers[i];
1221 if (!strcmp(l->name, name))
1223 TRACE("Returning buffer %p.\n", l);
1224 return (ID3D10EffectConstantBuffer *)l;
1228 WARN("Invalid name specified\n");
1230 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
1233 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index)
1235 FIXME("iface %p, index %u stub!\n", iface, index);
1240 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name)
1242 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1245 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1247 for (i = 0; i < This->local_buffer_count; ++i)
1249 struct d3d10_effect_local_buffer *l = &This->local_buffers[i];
1252 for (j = 0; j < l->variable_count; ++j)
1254 struct d3d10_effect_variable *v = &l->variables[j];
1256 if (!strcmp(v->name, name))
1258 TRACE("Returning variable %p.\n", v);
1259 return (ID3D10EffectVariable *)v;
1264 WARN("Invalid name specified\n");
1266 return (ID3D10EffectVariable *)&null_variable;
1269 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface,
1272 FIXME("iface %p, semantic %s stub!\n", iface, debugstr_a(semantic));
1277 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByIndex(ID3D10Effect *iface,
1280 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1281 struct d3d10_effect_technique *t;
1283 TRACE("iface %p, index %u\n", iface, index);
1285 if (index >= This->technique_count)
1287 WARN("Invalid index specified\n");
1288 return (ID3D10EffectTechnique *)&null_technique;
1291 t = &This->techniques[index];
1293 TRACE("Returning technique %p, %s.\n", t, debugstr_a(t->name));
1295 return (ID3D10EffectTechnique *)t;
1298 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByName(ID3D10Effect *iface,
1301 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1304 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1306 for (i = 0; i < This->technique_count; ++i)
1308 struct d3d10_effect_technique *t = &This->techniques[i];
1309 if (!strcmp(t->name, name))
1311 TRACE("Returning technique %p\n", t);
1312 return (ID3D10EffectTechnique *)t;
1316 WARN("Invalid name specified\n");
1318 return (ID3D10EffectTechnique *)&null_technique;
1321 static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
1323 FIXME("iface %p stub!\n", iface);
1328 static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface)
1330 FIXME("iface %p stub!\n", iface);
1335 const struct ID3D10EffectVtbl d3d10_effect_vtbl =
1337 /* IUnknown methods */
1338 d3d10_effect_QueryInterface,
1339 d3d10_effect_AddRef,
1340 d3d10_effect_Release,
1341 /* ID3D10Effect methods */
1342 d3d10_effect_IsValid,
1343 d3d10_effect_IsPool,
1344 d3d10_effect_GetDevice,
1345 d3d10_effect_GetDesc,
1346 d3d10_effect_GetConstantBufferByIndex,
1347 d3d10_effect_GetConstantBufferByName,
1348 d3d10_effect_GetVariableByIndex,
1349 d3d10_effect_GetVariableByName,
1350 d3d10_effect_GetVariableBySemantic,
1351 d3d10_effect_GetTechniqueByIndex,
1352 d3d10_effect_GetTechniqueByName,
1353 d3d10_effect_Optimize,
1354 d3d10_effect_IsOptimized,
1357 /* ID3D10EffectTechnique methods */
1359 static BOOL STDMETHODCALLTYPE d3d10_effect_technique_IsValid(ID3D10EffectTechnique *iface)
1361 TRACE("iface %p\n", iface);
1363 return (struct d3d10_effect_technique *)iface != &null_technique;
1366 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_GetDesc(ID3D10EffectTechnique *iface,
1367 D3D10_TECHNIQUE_DESC *desc)
1369 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1371 TRACE("iface %p, desc %p\n", iface, desc);
1373 if(This == &null_technique)
1375 WARN("Null technique specified\n");
1381 WARN("Invalid argument specified\n");
1382 return E_INVALIDARG;
1385 desc->Name = This->name;
1386 desc->Passes = This->pass_count;
1387 desc->Annotations = This->annotation_count;
1392 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByIndex(
1393 ID3D10EffectTechnique *iface, UINT index)
1395 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1396 struct d3d10_effect_variable *a;
1398 TRACE("iface %p, index %u\n", iface, index);
1400 if (index >= This->annotation_count)
1402 WARN("Invalid index specified\n");
1403 return (ID3D10EffectVariable *)&null_variable;
1406 a = &This->annotations[index];
1408 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
1410 return (ID3D10EffectVariable *)a;
1413 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByName(
1414 ID3D10EffectTechnique *iface, LPCSTR name)
1416 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1421 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique *iface,
1424 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1425 struct d3d10_effect_pass *p;
1427 TRACE("iface %p, index %u\n", iface, index);
1429 if (index >= This->pass_count)
1431 WARN("Invalid index specified\n");
1432 return (ID3D10EffectPass *)&null_pass;
1435 p = &This->passes[index];
1437 TRACE("Returning pass %p, %s.\n", p, debugstr_a(p->name));
1439 return (ID3D10EffectPass *)p;
1442 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique *iface,
1445 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1448 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1450 for (i = 0; i < This->pass_count; ++i)
1452 struct d3d10_effect_pass *p = &This->passes[i];
1453 if (!strcmp(p->name, name))
1455 TRACE("Returning pass %p\n", p);
1456 return (ID3D10EffectPass *)p;
1460 WARN("Invalid name specified\n");
1462 return (ID3D10EffectPass *)&null_pass;
1465 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique *iface,
1466 D3D10_STATE_BLOCK_MASK *mask)
1468 FIXME("iface %p,mask %p stub!\n", iface, mask);
1473 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl =
1475 /* ID3D10EffectTechnique methods */
1476 d3d10_effect_technique_IsValid,
1477 d3d10_effect_technique_GetDesc,
1478 d3d10_effect_technique_GetAnnotationByIndex,
1479 d3d10_effect_technique_GetAnnotationByName,
1480 d3d10_effect_technique_GetPassByIndex,
1481 d3d10_effect_technique_GetPassByName,
1482 d3d10_effect_technique_ComputeStateBlockMask,
1485 /* ID3D10EffectPass methods */
1487 static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface)
1489 TRACE("iface %p\n", iface);
1491 return (struct d3d10_effect_pass *)iface != &null_pass;
1494 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface, D3D10_PASS_DESC *desc)
1496 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1499 FIXME("iface %p, desc %p partial stub!\n", iface, desc);
1501 if(This == &null_pass)
1503 WARN("Null pass specified\n");
1509 WARN("Invalid argument specified\n");
1510 return E_INVALIDARG;
1513 memset(desc, 0, sizeof(*desc));
1514 desc->Name = This->name;
1515 for (i = 0; i < This->object_count; ++i)
1517 struct d3d10_effect_object *o = &This->objects[i];
1518 if (o->type == D3D10_EOT_VERTEXSHADER)
1520 struct d3d10_effect_shader_variable *s = o->data;
1521 desc->pIAInputSignature = (BYTE *)s->input_signature;
1522 desc->IAInputSignatureSize = s->input_signature_size;
1530 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface,
1531 D3D10_PASS_SHADER_DESC *desc)
1533 FIXME("iface %p, desc %p stub!\n", iface, desc);
1538 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface,
1539 D3D10_PASS_SHADER_DESC *desc)
1541 FIXME("iface %p, desc %p stub!\n", iface, desc);
1546 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface,
1547 D3D10_PASS_SHADER_DESC *desc)
1549 FIXME("iface %p, desc %p stub!\n", iface, desc);
1554 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass *iface,
1557 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1558 struct d3d10_effect_variable *a;
1560 TRACE("iface %p, index %u\n", iface, index);
1562 if (index >= This->annotation_count)
1564 WARN("Invalid index specified\n");
1565 return (ID3D10EffectVariable *)&null_variable;
1568 a = &This->annotations[index];
1570 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
1572 return (ID3D10EffectVariable *)a;
1575 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass *iface,
1578 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1583 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
1585 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1589 TRACE("iface %p, flags %#x\n", iface, flags);
1591 if (flags) FIXME("Ignoring flags (%#x)\n", flags);
1593 for (i = 0; i < This->object_count; ++i)
1595 hr = d3d10_effect_object_apply(&This->objects[i]);
1596 if (FAILED(hr)) break;
1602 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass *iface,
1603 D3D10_STATE_BLOCK_MASK *mask)
1605 FIXME("iface %p, mask %p stub!\n", iface, mask);
1610 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl =
1612 /* ID3D10EffectPass methods */
1613 d3d10_effect_pass_IsValid,
1614 d3d10_effect_pass_GetDesc,
1615 d3d10_effect_pass_GetVertexShaderDesc,
1616 d3d10_effect_pass_GetGeometryShaderDesc,
1617 d3d10_effect_pass_GetPixelShaderDesc,
1618 d3d10_effect_pass_GetAnnotationByIndex,
1619 d3d10_effect_pass_GetAnnotationByName,
1620 d3d10_effect_pass_Apply,
1621 d3d10_effect_pass_ComputeStateBlockMask,
1624 /* ID3D10EffectVariable methods */
1626 static BOOL STDMETHODCALLTYPE d3d10_effect_variable_IsValid(ID3D10EffectVariable *iface)
1628 TRACE("iface %p\n", iface);
1630 return (struct d3d10_effect_variable *)iface != &null_variable;
1633 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_variable_GetType(ID3D10EffectVariable *iface)
1635 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1637 TRACE("iface %p\n", iface);
1639 return (ID3D10EffectType *)This->type;
1642 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetDesc(ID3D10EffectVariable *iface,
1643 D3D10_EFFECT_VARIABLE_DESC *desc)
1645 FIXME("iface %p, desc %p stub!\n", iface, desc);
1650 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByIndex(
1651 ID3D10EffectVariable *iface, UINT index)
1653 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1654 struct d3d10_effect_variable *a;
1656 TRACE("iface %p, index %u\n", iface, index);
1658 if (index >= This->annotation_count)
1660 WARN("Invalid index specified\n");
1661 return (ID3D10EffectVariable *)&null_variable;
1664 a = &This->annotations[index];
1666 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
1668 return (ID3D10EffectVariable *)a;
1671 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName(
1672 ID3D10EffectVariable *iface, LPCSTR name)
1674 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1679 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex(
1680 ID3D10EffectVariable *iface, UINT index)
1682 FIXME("iface %p, index %u stub!\n", iface, index);
1687 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName(
1688 ID3D10EffectVariable *iface, LPCSTR name)
1690 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1695 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic(
1696 ID3D10EffectVariable *iface, LPCSTR semantic)
1698 FIXME("iface %p, semantic %s stub!\n", iface, debugstr_a(semantic));
1703 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetElement(
1704 ID3D10EffectVariable *iface, UINT index)
1706 FIXME("iface %p, index %u stub!\n", iface, index);
1711 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_GetParentConstantBuffer(
1712 ID3D10EffectVariable *iface)
1714 FIXME("iface %p stub!\n", iface);
1719 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsScalar(
1720 ID3D10EffectVariable *iface)
1722 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1724 TRACE("iface %p\n", iface);
1726 if (This->vtbl == (ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl)
1727 return (ID3D10EffectScalarVariable *)This;
1729 return (ID3D10EffectScalarVariable *)&null_scalar_variable;
1732 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsVector(
1733 ID3D10EffectVariable *iface)
1735 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1737 TRACE("iface %p\n", iface);
1739 if (This->vtbl == (ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl)
1740 return (ID3D10EffectVectorVariable *)This;
1742 return (ID3D10EffectVectorVariable *)&null_vector_variable;
1745 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix(
1746 ID3D10EffectVariable *iface)
1748 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1750 TRACE("iface %p\n", iface);
1752 if (This->vtbl == (ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl)
1753 return (ID3D10EffectMatrixVariable *)This;
1755 return (ID3D10EffectMatrixVariable *)&null_matrix_variable;
1758 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsString(
1759 ID3D10EffectVariable *iface)
1761 FIXME("iface %p stub!\n", iface);
1766 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShaderResource(
1767 ID3D10EffectVariable *iface)
1769 FIXME("iface %p stub!\n", iface);
1774 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRenderTargetView(
1775 ID3D10EffectVariable *iface)
1777 FIXME("iface %p stub!\n", iface);
1782 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencilView(
1783 ID3D10EffectVariable *iface)
1785 FIXME("iface %p stub!\n", iface);
1790 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_AsConstantBuffer(
1791 ID3D10EffectVariable *iface)
1793 FIXME("iface %p stub!\n", iface);
1798 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShader(
1799 ID3D10EffectVariable *iface)
1801 FIXME("iface %p stub!\n", iface);
1806 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsBlend(ID3D10EffectVariable *iface)
1808 FIXME("iface %p stub!\n", iface);
1813 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencil(
1814 ID3D10EffectVariable *iface)
1816 FIXME("iface %p stub!\n", iface);
1821 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRasterizer(
1822 ID3D10EffectVariable *iface)
1824 FIXME("iface %p stub!\n", iface);
1829 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsSampler(
1830 ID3D10EffectVariable *iface)
1832 FIXME("iface %p stub!\n", iface);
1837 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface,
1838 void *data, UINT offset, UINT count)
1840 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
1845 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface,
1846 void *data, UINT offset, UINT count)
1848 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
1853 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl =
1855 /* ID3D10EffectVariable methods */
1856 d3d10_effect_variable_IsValid,
1857 d3d10_effect_variable_GetType,
1858 d3d10_effect_variable_GetDesc,
1859 d3d10_effect_variable_GetAnnotationByIndex,
1860 d3d10_effect_variable_GetAnnotationByName,
1861 d3d10_effect_variable_GetMemberByIndex,
1862 d3d10_effect_variable_GetMemberByName,
1863 d3d10_effect_variable_GetMemberBySemantic,
1864 d3d10_effect_variable_GetElement,
1865 d3d10_effect_variable_GetParentConstantBuffer,
1866 d3d10_effect_variable_AsScalar,
1867 d3d10_effect_variable_AsVector,
1868 d3d10_effect_variable_AsMatrix,
1869 d3d10_effect_variable_AsString,
1870 d3d10_effect_variable_AsShaderResource,
1871 d3d10_effect_variable_AsRenderTargetView,
1872 d3d10_effect_variable_AsDepthStencilView,
1873 d3d10_effect_variable_AsConstantBuffer,
1874 d3d10_effect_variable_AsShader,
1875 d3d10_effect_variable_AsBlend,
1876 d3d10_effect_variable_AsDepthStencil,
1877 d3d10_effect_variable_AsRasterizer,
1878 d3d10_effect_variable_AsSampler,
1879 d3d10_effect_variable_SetRawValue,
1880 d3d10_effect_variable_GetRawValue,
1883 /* ID3D10EffectVariable methods */
1884 static BOOL STDMETHODCALLTYPE d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer *iface)
1886 TRACE("iface %p\n", iface);
1888 return (struct d3d10_effect_local_buffer *)iface != &null_local_buffer;
1891 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer *iface)
1893 FIXME("iface %p stub!\n", iface);
1898 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer *iface,
1899 D3D10_EFFECT_VARIABLE_DESC *desc)
1901 FIXME("iface %p, desc %p stub!\n", iface, desc);
1906 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByIndex(
1907 ID3D10EffectConstantBuffer *iface, UINT index)
1909 struct d3d10_effect_local_buffer *This = (struct d3d10_effect_local_buffer *)iface;
1910 struct d3d10_effect_variable *a;
1912 TRACE("iface %p, index %u\n", iface, index);
1914 if (index >= This->annotation_count)
1916 WARN("Invalid index specified\n");
1917 return (ID3D10EffectVariable *)&null_variable;
1920 a = &This->annotations[index];
1922 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
1924 return (ID3D10EffectVariable *)a;
1927 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByName(
1928 ID3D10EffectConstantBuffer *iface, LPCSTR name)
1930 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1935 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByIndex(
1936 ID3D10EffectConstantBuffer *iface, UINT index)
1938 FIXME("iface %p, index %u stub!\n", iface, index);
1943 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByName(
1944 ID3D10EffectConstantBuffer *iface, LPCSTR name)
1946 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1951 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberBySemantic(
1952 ID3D10EffectConstantBuffer *iface, LPCSTR semantic)
1954 FIXME("iface %p, semantic %s stub!\n", iface, debugstr_a(semantic));
1959 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetElement(
1960 ID3D10EffectConstantBuffer *iface, UINT index)
1962 FIXME("iface %p, index %u stub!\n", iface, index);
1967 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetParentConstantBuffer(
1968 ID3D10EffectConstantBuffer *iface)
1970 FIXME("iface %p stub!\n", iface);
1975 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsScalar(
1976 ID3D10EffectConstantBuffer *iface)
1978 FIXME("iface %p stub!\n", iface);
1983 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsVector(
1984 ID3D10EffectConstantBuffer *iface)
1986 FIXME("iface %p stub!\n", iface);
1991 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsMatrix(
1992 ID3D10EffectConstantBuffer *iface)
1994 FIXME("iface %p stub!\n", iface);
1999 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsString(
2000 ID3D10EffectConstantBuffer *iface)
2002 FIXME("iface %p stub!\n", iface);
2007 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShaderResource(
2008 ID3D10EffectConstantBuffer *iface)
2010 FIXME("iface %p stub!\n", iface);
2015 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRenderTargetView(
2016 ID3D10EffectConstantBuffer *iface)
2018 FIXME("iface %p stub!\n", iface);
2023 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencilView(
2024 ID3D10EffectConstantBuffer *iface)
2026 FIXME("iface %p stub!\n", iface);
2031 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsConstantBuffer(
2032 ID3D10EffectConstantBuffer *iface)
2034 FIXME("iface %p stub!\n", iface);
2039 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShader(
2040 ID3D10EffectConstantBuffer *iface)
2042 FIXME("iface %p stub!\n", iface);
2047 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer *iface)
2049 FIXME("iface %p stub!\n", iface);
2054 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencil(
2055 ID3D10EffectConstantBuffer *iface)
2057 FIXME("iface %p stub!\n", iface);
2062 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRasterizer(
2063 ID3D10EffectConstantBuffer *iface)
2065 FIXME("iface %p stub!\n", iface);
2070 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsSampler(
2071 ID3D10EffectConstantBuffer *iface)
2073 FIXME("iface %p stub!\n", iface);
2078 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer *iface,
2079 void *data, UINT offset, UINT count)
2081 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
2086 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer *iface,
2087 void *data, UINT offset, UINT count)
2089 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
2094 /* ID3D10EffectConstantBuffer methods */
2095 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer *iface,
2096 ID3D10Buffer *buffer)
2098 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
2103 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer *iface,
2104 ID3D10Buffer **buffer)
2106 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
2111 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer *iface,
2112 ID3D10ShaderResourceView *view)
2114 FIXME("iface %p, view %p stub!\n", iface, view);
2119 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer *iface,
2120 ID3D10ShaderResourceView **view)
2122 FIXME("iface %p, view %p stub!\n", iface, view);
2127 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl =
2129 /* ID3D10EffectVariable methods */
2130 d3d10_effect_constant_buffer_IsValid,
2131 d3d10_effect_constant_buffer_GetType,
2132 d3d10_effect_constant_buffer_GetDesc,
2133 d3d10_effect_constant_buffer_GetAnnotationByIndex,
2134 d3d10_effect_constant_buffer_GetAnnotationByName,
2135 d3d10_effect_constant_buffer_GetMemberByIndex,
2136 d3d10_effect_constant_buffer_GetMemberByName,
2137 d3d10_effect_constant_buffer_GetMemberBySemantic,
2138 d3d10_effect_constant_buffer_GetElement,
2139 d3d10_effect_constant_buffer_GetParentConstantBuffer,
2140 d3d10_effect_constant_buffer_AsScalar,
2141 d3d10_effect_constant_buffer_AsVector,
2142 d3d10_effect_constant_buffer_AsMatrix,
2143 d3d10_effect_constant_buffer_AsString,
2144 d3d10_effect_constant_buffer_AsShaderResource,
2145 d3d10_effect_constant_buffer_AsRenderTargetView,
2146 d3d10_effect_constant_buffer_AsDepthStencilView,
2147 d3d10_effect_constant_buffer_AsConstantBuffer,
2148 d3d10_effect_constant_buffer_AsShader,
2149 d3d10_effect_constant_buffer_AsBlend,
2150 d3d10_effect_constant_buffer_AsDepthStencil,
2151 d3d10_effect_constant_buffer_AsRasterizer,
2152 d3d10_effect_constant_buffer_AsSampler,
2153 d3d10_effect_constant_buffer_SetRawValue,
2154 d3d10_effect_constant_buffer_GetRawValue,
2155 /* ID3D10EffectConstantBuffer methods */
2156 d3d10_effect_constant_buffer_SetConstantBuffer,
2157 d3d10_effect_constant_buffer_GetConstantBuffer,
2158 d3d10_effect_constant_buffer_SetTextureBuffer,
2159 d3d10_effect_constant_buffer_GetTextureBuffer,
2162 /* ID3D10EffectVariable methods */
2164 static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
2166 TRACE("iface %p\n", iface);
2168 return (struct d3d10_effect_variable *)iface != &null_scalar_variable;
2171 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetType(
2172 ID3D10EffectScalarVariable *iface)
2174 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
2177 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetDesc(ID3D10EffectScalarVariable *iface,
2178 D3D10_EFFECT_VARIABLE_DESC *desc)
2180 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
2183 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByIndex(
2184 ID3D10EffectScalarVariable *iface, UINT index)
2186 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
2189 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByName(
2190 ID3D10EffectScalarVariable *iface, LPCSTR name)
2192 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
2195 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByIndex(
2196 ID3D10EffectScalarVariable *iface, UINT index)
2198 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
2201 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByName(
2202 ID3D10EffectScalarVariable *iface, LPCSTR name)
2204 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
2207 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberBySemantic(
2208 ID3D10EffectScalarVariable *iface, LPCSTR semantic)
2210 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
2213 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetElement(
2214 ID3D10EffectScalarVariable *iface, UINT index)
2216 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
2219 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetParentConstantBuffer(
2220 ID3D10EffectScalarVariable *iface)
2222 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
2225 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsScalar(
2226 ID3D10EffectScalarVariable *iface)
2228 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
2231 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsVector(
2232 ID3D10EffectScalarVariable *iface)
2234 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
2237 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsMatrix(
2238 ID3D10EffectScalarVariable *iface)
2240 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
2243 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsString(
2244 ID3D10EffectScalarVariable *iface)
2246 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
2249 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShaderResource(
2250 ID3D10EffectScalarVariable *iface)
2252 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
2255 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRenderTargetView(
2256 ID3D10EffectScalarVariable *iface)
2258 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
2261 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencilView(
2262 ID3D10EffectScalarVariable *iface)
2264 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
2267 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsConstantBuffer(
2268 ID3D10EffectScalarVariable *iface)
2270 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
2273 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShader(
2274 ID3D10EffectScalarVariable *iface)
2276 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
2279 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsBlend(
2280 ID3D10EffectScalarVariable *iface)
2282 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
2285 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencil(
2286 ID3D10EffectScalarVariable *iface)
2288 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
2291 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRasterizer(
2292 ID3D10EffectScalarVariable *iface)
2294 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
2297 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsSampler(
2298 ID3D10EffectScalarVariable *iface)
2300 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
2303 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetRawValue(ID3D10EffectScalarVariable *iface,
2304 void *data, UINT offset, UINT count)
2306 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2309 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetRawValue(ID3D10EffectScalarVariable *iface,
2310 void *data, UINT offset, UINT count)
2312 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2315 /* ID3D10EffectScalarVariable methods */
2317 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable *iface,
2320 FIXME("iface %p, value %.8e stub!\n", iface, value);
2325 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable *iface,
2328 FIXME("iface %p, value %p stub!\n", iface, value);
2333 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable *iface,
2334 float *values, UINT offset, UINT count)
2336 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2341 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable *iface,
2342 float *values, UINT offset, UINT count)
2344 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2349 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable *iface,
2352 FIXME("iface %p, value %d stub!\n", iface, value);
2357 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable *iface,
2360 FIXME("iface %p, value %p stub!\n", iface, value);
2365 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable *iface,
2366 int *values, UINT offset, UINT count)
2368 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2373 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable *iface,
2374 int *values, UINT offset, UINT count)
2376 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2381 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable *iface,
2384 FIXME("iface %p, value %d stub!\n", iface, value);
2389 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable *iface,
2392 FIXME("iface %p, value %p stub!\n", iface, value);
2397 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable *iface,
2398 BOOL *values, UINT offset, UINT count)
2400 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2405 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable *iface,
2406 BOOL *values, UINT offset, UINT count)
2408 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2413 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl =
2415 /* ID3D10EffectVariable methods */
2416 d3d10_effect_scalar_variable_IsValid,
2417 d3d10_effect_scalar_variable_GetType,
2418 d3d10_effect_scalar_variable_GetDesc,
2419 d3d10_effect_scalar_variable_GetAnnotationByIndex,
2420 d3d10_effect_scalar_variable_GetAnnotationByName,
2421 d3d10_effect_scalar_variable_GetMemberByIndex,
2422 d3d10_effect_scalar_variable_GetMemberByName,
2423 d3d10_effect_scalar_variable_GetMemberBySemantic,
2424 d3d10_effect_scalar_variable_GetElement,
2425 d3d10_effect_scalar_variable_GetParentConstantBuffer,
2426 d3d10_effect_scalar_variable_AsScalar,
2427 d3d10_effect_scalar_variable_AsVector,
2428 d3d10_effect_scalar_variable_AsMatrix,
2429 d3d10_effect_scalar_variable_AsString,
2430 d3d10_effect_scalar_variable_AsShaderResource,
2431 d3d10_effect_scalar_variable_AsRenderTargetView,
2432 d3d10_effect_scalar_variable_AsDepthStencilView,
2433 d3d10_effect_scalar_variable_AsConstantBuffer,
2434 d3d10_effect_scalar_variable_AsShader,
2435 d3d10_effect_scalar_variable_AsBlend,
2436 d3d10_effect_scalar_variable_AsDepthStencil,
2437 d3d10_effect_scalar_variable_AsRasterizer,
2438 d3d10_effect_scalar_variable_AsSampler,
2439 d3d10_effect_scalar_variable_SetRawValue,
2440 d3d10_effect_scalar_variable_GetRawValue,
2441 /* ID3D10EffectScalarVariable methods */
2442 d3d10_effect_scalar_variable_SetFloat,
2443 d3d10_effect_scalar_variable_GetFloat,
2444 d3d10_effect_scalar_variable_SetFloatArray,
2445 d3d10_effect_scalar_variable_GetFloatArray,
2446 d3d10_effect_scalar_variable_SetInt,
2447 d3d10_effect_scalar_variable_GetInt,
2448 d3d10_effect_scalar_variable_SetIntArray,
2449 d3d10_effect_scalar_variable_GetIntArray,
2450 d3d10_effect_scalar_variable_SetBool,
2451 d3d10_effect_scalar_variable_GetBool,
2452 d3d10_effect_scalar_variable_SetBoolArray,
2453 d3d10_effect_scalar_variable_GetBoolArray,
2456 /* ID3D10EffectVariable methods */
2458 static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
2460 TRACE("iface %p\n", iface);
2462 return (struct d3d10_effect_variable *)iface != &null_vector_variable;
2465 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetType(
2466 ID3D10EffectVectorVariable *iface)
2468 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
2471 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable *iface,
2472 D3D10_EFFECT_VARIABLE_DESC *desc)
2474 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
2477 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByIndex(
2478 ID3D10EffectVectorVariable *iface, UINT index)
2480 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
2483 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByName(
2484 ID3D10EffectVectorVariable *iface, LPCSTR name)
2486 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
2489 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByIndex(
2490 ID3D10EffectVectorVariable *iface, UINT index)
2492 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
2495 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByName(
2496 ID3D10EffectVectorVariable *iface, LPCSTR name)
2498 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
2501 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberBySemantic(
2502 ID3D10EffectVectorVariable *iface, LPCSTR semantic)
2504 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
2507 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetElement(
2508 ID3D10EffectVectorVariable *iface, UINT index)
2510 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
2513 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetParentConstantBuffer(
2514 ID3D10EffectVectorVariable *iface)
2516 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
2519 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsScalar(
2520 ID3D10EffectVectorVariable *iface)
2522 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
2525 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsVector(
2526 ID3D10EffectVectorVariable *iface)
2528 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
2531 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsMatrix(
2532 ID3D10EffectVectorVariable *iface)
2534 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
2537 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsString(
2538 ID3D10EffectVectorVariable *iface)
2540 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
2543 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShaderResource(
2544 ID3D10EffectVectorVariable *iface)
2546 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
2549 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRenderTargetView(
2550 ID3D10EffectVectorVariable *iface)
2552 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
2555 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencilView(
2556 ID3D10EffectVectorVariable *iface)
2558 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
2561 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsConstantBuffer(
2562 ID3D10EffectVectorVariable *iface)
2564 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
2567 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShader(
2568 ID3D10EffectVectorVariable *iface)
2570 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
2573 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsBlend(
2574 ID3D10EffectVectorVariable *iface)
2576 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
2579 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencil(
2580 ID3D10EffectVectorVariable *iface)
2582 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
2585 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRasterizer(
2586 ID3D10EffectVectorVariable *iface)
2588 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
2591 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsSampler(
2592 ID3D10EffectVectorVariable *iface)
2594 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
2597 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable *iface,
2598 void *data, UINT offset, UINT count)
2600 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2603 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable *iface,
2604 void *data, UINT offset, UINT count)
2606 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2609 /* ID3D10EffectVectorVariable methods */
2611 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable *iface,
2614 FIXME("iface %p, value %p stub!\n", iface, value);
2619 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable *iface,
2622 FIXME("iface %p, value %p stub!\n", iface, value);
2627 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable *iface,
2630 FIXME("iface %p, value %p stub!\n", iface, value);
2635 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable *iface,
2638 FIXME("iface %p, value %p stub!\n", iface, value);
2643 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable *iface,
2646 FIXME("iface %p, value %p stub!\n", iface, value);
2651 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable *iface,
2654 FIXME("iface %p, value %p stub!\n", iface, value);
2659 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable *iface,
2660 BOOL *values, UINT offset, UINT count)
2662 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2667 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable *iface,
2668 int *values, UINT offset, UINT count)
2670 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2675 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable *iface,
2676 float *values, UINT offset, UINT count)
2678 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2683 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable *iface,
2684 BOOL *values, UINT offset, UINT count)
2686 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2691 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable *iface,
2692 int *values, UINT offset, UINT count)
2694 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2699 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable *iface,
2700 float *values, UINT offset, UINT count)
2702 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2707 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl =
2709 /* ID3D10EffectVariable methods */
2710 d3d10_effect_vector_variable_IsValid,
2711 d3d10_effect_vector_variable_GetType,
2712 d3d10_effect_vector_variable_GetDesc,
2713 d3d10_effect_vector_variable_GetAnnotationByIndex,
2714 d3d10_effect_vector_variable_GetAnnotationByName,
2715 d3d10_effect_vector_variable_GetMemberByIndex,
2716 d3d10_effect_vector_variable_GetMemberByName,
2717 d3d10_effect_vector_variable_GetMemberBySemantic,
2718 d3d10_effect_vector_variable_GetElement,
2719 d3d10_effect_vector_variable_GetParentConstantBuffer,
2720 d3d10_effect_vector_variable_AsScalar,
2721 d3d10_effect_vector_variable_AsVector,
2722 d3d10_effect_vector_variable_AsMatrix,
2723 d3d10_effect_vector_variable_AsString,
2724 d3d10_effect_vector_variable_AsShaderResource,
2725 d3d10_effect_vector_variable_AsRenderTargetView,
2726 d3d10_effect_vector_variable_AsDepthStencilView,
2727 d3d10_effect_vector_variable_AsConstantBuffer,
2728 d3d10_effect_vector_variable_AsShader,
2729 d3d10_effect_vector_variable_AsBlend,
2730 d3d10_effect_vector_variable_AsDepthStencil,
2731 d3d10_effect_vector_variable_AsRasterizer,
2732 d3d10_effect_vector_variable_AsSampler,
2733 d3d10_effect_vector_variable_SetRawValue,
2734 d3d10_effect_vector_variable_GetRawValue,
2735 /* ID3D10EffectVectorVariable methods */
2736 d3d10_effect_vector_variable_SetBoolVector,
2737 d3d10_effect_vector_variable_SetIntVector,
2738 d3d10_effect_vector_variable_SetFloatVector,
2739 d3d10_effect_vector_variable_GetBoolVector,
2740 d3d10_effect_vector_variable_GetIntVector,
2741 d3d10_effect_vector_variable_GetFloatVector,
2742 d3d10_effect_vector_variable_SetBoolVectorArray,
2743 d3d10_effect_vector_variable_SetIntVectorArray,
2744 d3d10_effect_vector_variable_SetFloatVectorArray,
2745 d3d10_effect_vector_variable_GetBoolVectorArray,
2746 d3d10_effect_vector_variable_GetIntVectorArray,
2747 d3d10_effect_vector_variable_GetFloatVectorArray,
2750 /* ID3D10EffectVariable methods */
2752 static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
2754 TRACE("iface %p\n", iface);
2756 return (struct d3d10_effect_variable *)iface != &null_matrix_variable;
2759 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetType(
2760 ID3D10EffectMatrixVariable *iface)
2762 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
2765 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetDesc(ID3D10EffectMatrixVariable *iface,
2766 D3D10_EFFECT_VARIABLE_DESC *desc)
2768 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
2771 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByIndex(
2772 ID3D10EffectMatrixVariable *iface, UINT index)
2774 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
2777 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByName(
2778 ID3D10EffectMatrixVariable *iface, LPCSTR name)
2780 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
2783 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByIndex(
2784 ID3D10EffectMatrixVariable *iface, UINT index)
2786 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
2789 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByName(
2790 ID3D10EffectMatrixVariable *iface, LPCSTR name)
2792 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
2795 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberBySemantic(
2796 ID3D10EffectMatrixVariable *iface, LPCSTR semantic)
2798 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
2801 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetElement(
2802 ID3D10EffectMatrixVariable *iface, UINT index)
2804 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
2807 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetParentConstantBuffer(
2808 ID3D10EffectMatrixVariable *iface)
2810 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
2813 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsScalar(
2814 ID3D10EffectMatrixVariable *iface)
2816 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
2819 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsVector(
2820 ID3D10EffectMatrixVariable *iface)
2822 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
2825 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsMatrix(
2826 ID3D10EffectMatrixVariable *iface)
2828 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
2831 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsString(
2832 ID3D10EffectMatrixVariable *iface)
2834 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
2837 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShaderResource(
2838 ID3D10EffectMatrixVariable *iface)
2840 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
2843 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRenderTargetView(
2844 ID3D10EffectMatrixVariable *iface)
2846 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
2849 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencilView(
2850 ID3D10EffectMatrixVariable *iface)
2852 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
2855 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsConstantBuffer(
2856 ID3D10EffectMatrixVariable *iface)
2858 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
2861 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShader(
2862 ID3D10EffectMatrixVariable *iface)
2864 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
2867 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsBlend(
2868 ID3D10EffectMatrixVariable *iface)
2870 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
2873 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencil(
2874 ID3D10EffectMatrixVariable *iface)
2876 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
2879 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRasterizer(
2880 ID3D10EffectMatrixVariable *iface)
2882 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
2885 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsSampler(
2886 ID3D10EffectMatrixVariable *iface)
2888 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
2891 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetRawValue(ID3D10EffectMatrixVariable *iface,
2892 void *data, UINT offset, UINT count)
2894 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2897 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetRawValue(ID3D10EffectMatrixVariable *iface,
2898 void *data, UINT offset, UINT count)
2900 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2903 /* ID3D10EffectMatrixVariable methods */
2905 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrix(ID3D10EffectMatrixVariable *iface,
2908 FIXME("iface %p, data %p stub!\n", iface, data);
2913 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrix(ID3D10EffectMatrixVariable *iface,
2916 FIXME("iface %p, data %p stub!\n", iface, data);
2921 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixArray(ID3D10EffectMatrixVariable *iface,
2922 float *data, UINT offset, UINT count)
2924 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
2929 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixArray(ID3D10EffectMatrixVariable *iface,
2930 float *data, UINT offset, UINT count)
2932 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
2937 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
2940 FIXME("iface %p, data %p stub!\n", iface, data);
2945 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
2948 FIXME("iface %p, data %p stub!\n", iface, data);
2953 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
2954 float *data, UINT offset, UINT count)
2956 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
2961 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
2962 float *data, UINT offset, UINT count)
2964 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
2970 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl =
2972 /* ID3D10EffectVariable methods */
2973 d3d10_effect_matrix_variable_IsValid,
2974 d3d10_effect_matrix_variable_GetType,
2975 d3d10_effect_matrix_variable_GetDesc,
2976 d3d10_effect_matrix_variable_GetAnnotationByIndex,
2977 d3d10_effect_matrix_variable_GetAnnotationByName,
2978 d3d10_effect_matrix_variable_GetMemberByIndex,
2979 d3d10_effect_matrix_variable_GetMemberByName,
2980 d3d10_effect_matrix_variable_GetMemberBySemantic,
2981 d3d10_effect_matrix_variable_GetElement,
2982 d3d10_effect_matrix_variable_GetParentConstantBuffer,
2983 d3d10_effect_matrix_variable_AsScalar,
2984 d3d10_effect_matrix_variable_AsVector,
2985 d3d10_effect_matrix_variable_AsMatrix,
2986 d3d10_effect_matrix_variable_AsString,
2987 d3d10_effect_matrix_variable_AsShaderResource,
2988 d3d10_effect_matrix_variable_AsRenderTargetView,
2989 d3d10_effect_matrix_variable_AsDepthStencilView,
2990 d3d10_effect_matrix_variable_AsConstantBuffer,
2991 d3d10_effect_matrix_variable_AsShader,
2992 d3d10_effect_matrix_variable_AsBlend,
2993 d3d10_effect_matrix_variable_AsDepthStencil,
2994 d3d10_effect_matrix_variable_AsRasterizer,
2995 d3d10_effect_matrix_variable_AsSampler,
2996 d3d10_effect_matrix_variable_SetRawValue,
2997 d3d10_effect_matrix_variable_GetRawValue,
2998 /* ID3D10EffectMatrixVariable methods */
2999 d3d10_effect_matrix_variable_SetMatrix,
3000 d3d10_effect_matrix_variable_GetMatrix,
3001 d3d10_effect_matrix_variable_SetMatrixArray,
3002 d3d10_effect_matrix_variable_GetMatrixArray,
3003 d3d10_effect_matrix_variable_SetMatrixTranspose,
3004 d3d10_effect_matrix_variable_GetMatrixTranspose,
3005 d3d10_effect_matrix_variable_SetMatrixTransposeArray,
3006 d3d10_effect_matrix_variable_GetMatrixTransposeArray,
3009 static BOOL STDMETHODCALLTYPE d3d10_effect_type_IsValid(ID3D10EffectType *iface)
3011 FIXME("iface %p stub!\n", iface);
3016 static HRESULT STDMETHODCALLTYPE d3d10_effect_type_GetDesc(ID3D10EffectType *iface, D3D10_EFFECT_TYPE_DESC *desc)
3018 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
3020 TRACE("iface %p, desc %p\n", iface, desc);
3022 if (!desc) return E_INVALIDARG;
3024 desc->TypeName = This->name;
3025 desc->Class = This->type_class;
3026 desc->Type = This->basetype;
3027 desc->Elements = This->element_count;
3028 desc->Members = This->member_count;
3029 desc->Rows = This->row_count;
3030 desc->Columns = This->column_count;
3031 desc->PackedSize = This->size_packed;
3032 desc->UnpackedSize = This->size_unpacked;
3033 desc->Stride = This->stride;
3038 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByIndex(ID3D10EffectType *iface,
3041 FIXME("iface %p, index %u stub!\n", iface, index);
3046 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByName(ID3D10EffectType *iface,
3049 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
3054 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeBySemantic(ID3D10EffectType *iface,
3057 FIXME("iface %p, semantic %s stub!\n", iface, debugstr_a(semantic));
3062 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberName(ID3D10EffectType *iface, UINT index)
3064 FIXME("iface %p, index %u stub!\n", iface, index);
3069 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberSemantic(ID3D10EffectType *iface, UINT index)
3071 FIXME("iface %p, index %u stub!\n", iface, index);
3076 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl =
3078 /* ID3D10EffectType */
3079 d3d10_effect_type_IsValid,
3080 d3d10_effect_type_GetDesc,
3081 d3d10_effect_type_GetMemberTypeByIndex,
3082 d3d10_effect_type_GetMemberTypeByName,
3083 d3d10_effect_type_GetMemberTypeBySemantic,
3084 d3d10_effect_type_GetMemberName,
3085 d3d10_effect_type_GetMemberSemantic,