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_variable null_local_buffer =
61 {(ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL};
62 static struct d3d10_effect_variable null_variable =
63 {&d3d10_effect_variable_vtbl, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL};
64 static struct d3d10_effect_variable null_scalar_variable =
65 {(ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL};
66 static struct d3d10_effect_variable null_vector_variable =
67 {(ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL};
68 static struct d3d10_effect_variable null_matrix_variable =
69 {(ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL};
71 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset);
73 static inline void read_dword(const char **ptr, DWORD *d)
75 memcpy(d, *ptr, sizeof(*d));
79 static inline void skip_dword_unknown(const char **ptr, unsigned int count)
84 FIXME("Skipping %u unknown DWORDs:\n", count);
85 for (i = 0; i < count; ++i)
88 FIXME("\t0x%08x\n", d);
92 static inline void write_dword(char **ptr, DWORD d)
94 memcpy(*ptr, &d, sizeof(d));
98 static inline void write_dword_unknown(char **ptr, DWORD d)
100 FIXME("Writing unknown DWORD 0x%08x\n", d);
104 static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
105 HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx)
107 const char *ptr = data;
114 read_dword(&ptr, &tag);
115 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
119 WARN("Wrong tag.\n");
124 skip_dword_unknown(&ptr, 4);
126 skip_dword_unknown(&ptr, 1);
128 read_dword(&ptr, &total_size);
129 TRACE("total size: %#x\n", total_size);
131 read_dword(&ptr, &chunk_count);
132 TRACE("chunk count: %#x\n", chunk_count);
134 for (i = 0; i < chunk_count; ++i)
136 DWORD chunk_tag, chunk_size;
137 const char *chunk_ptr;
140 read_dword(&ptr, &chunk_offset);
141 TRACE("chunk %u at offset %#x\n", i, chunk_offset);
143 chunk_ptr = data + chunk_offset;
145 read_dword(&chunk_ptr, &chunk_tag);
146 read_dword(&chunk_ptr, &chunk_size);
148 hr = chunk_handler(chunk_ptr, chunk_size, chunk_tag, ctx);
149 if (FAILED(hr)) break;
155 static BOOL copy_name(const char *ptr, char **name)
159 if (!ptr) return TRUE;
161 name_len = strlen(ptr) + 1;
167 *name = HeapAlloc(GetProcessHeap(), 0, name_len);
170 ERR("Failed to allocate name memory.\n");
174 memcpy(*name, ptr, name_len);
179 static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
181 struct d3d10_effect_shader_variable *s = ctx;
183 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
185 TRACE("chunk size: %#x\n", data_size);
191 /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */
192 UINT size = 44 + data_size;
195 s->input_signature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
196 if (!s->input_signature)
198 ERR("Failed to allocate input signature data\n");
199 return E_OUTOFMEMORY;
201 s->input_signature_size = size;
203 ptr = s->input_signature;
205 write_dword(&ptr, TAG_DXBC);
208 write_dword_unknown(&ptr, 0);
209 write_dword_unknown(&ptr, 0);
210 write_dword_unknown(&ptr, 0);
211 write_dword_unknown(&ptr, 0);
213 /* seems to be always 1 */
214 write_dword_unknown(&ptr, 1);
217 write_dword(&ptr, size);
220 write_dword(&ptr, 1);
223 write_dword(&ptr, (ptr - s->input_signature) + 4);
226 write_dword(&ptr, TAG_ISGN);
227 write_dword(&ptr, data_size);
228 memcpy(ptr, data, data_size);
233 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
240 static HRESULT parse_shader(struct d3d10_effect_object *o, const char *data)
242 ID3D10Device *device = o->pass->technique->effect->device;
243 struct d3d10_effect_shader_variable *s;
244 const char *ptr = data;
248 o->data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3d10_effect_shader_variable));
251 ERR("Failed to allocate shader variable memory\n");
252 return E_OUTOFMEMORY;
255 if (!ptr) return S_OK;
259 read_dword(&ptr, &dxbc_size);
260 TRACE("dxbc size: %#x\n", dxbc_size);
264 case D3D10_EOT_VERTEXSHADER:
265 hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &s->shader.vs);
266 if (FAILED(hr)) return hr;
269 case D3D10_EOT_PIXELSHADER:
270 hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &s->shader.ps);
271 if (FAILED(hr)) return hr;
273 case D3D10_EOT_GEOMETRYSHADER:
274 hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &s->shader.gs);
275 if (FAILED(hr)) return hr;
279 return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, s);
282 static D3D10_SHADER_VARIABLE_CLASS d3d10_variable_class(DWORD c)
286 case 1: return D3D10_SVC_SCALAR;
287 case 2: return D3D10_SVC_VECTOR;
288 case 3: return D3D10_SVC_MATRIX_ROWS;
290 FIXME("Unknown variable class %#x.\n", c);
295 static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(DWORD t)
299 case 1: return D3D10_SVT_FLOAT;
300 case 2: return D3D10_SVT_INT;
301 case 3: return D3D10_SVT_UINT;
302 case 4: return D3D10_SVT_BOOL;
304 FIXME("Unknown variable type %#x.\n", t);
309 static HRESULT parse_fx10_type(struct d3d10_effect_type *t, const char *ptr, const char *data)
314 read_dword(&ptr, &offset);
315 TRACE("Type name at offset %#x.\n", offset);
317 if (!copy_name(data + offset, &t->name))
319 ERR("Failed to copy name.\n");
320 return E_OUTOFMEMORY;
322 TRACE("Type name: %s.\n", debugstr_a(t->name));
324 read_dword(&ptr, &unknown0);
325 TRACE("Unknown 0: %u.\n", unknown0);
327 read_dword(&ptr, &t->element_count);
328 TRACE("Element count: %u.\n", t->element_count);
330 read_dword(&ptr, &t->size_unpacked);
331 TRACE("Unpacked size: %#x.\n", t->size_unpacked);
333 read_dword(&ptr, &t->stride);
334 TRACE("Stride: %#x.\n", t->stride);
336 read_dword(&ptr, &t->size_packed);
337 TRACE("Packed size %#x.\n", t->size_packed);
345 read_dword(&ptr, &tmp);
346 t->column_count = (tmp & D3D10_FX10_TYPE_COLUMN_MASK) >> D3D10_FX10_TYPE_COLUMN_SHIFT;
347 t->row_count = (tmp & D3D10_FX10_TYPE_ROW_MASK) >> D3D10_FX10_TYPE_ROW_SHIFT;
348 t->basetype = d3d10_variable_type((tmp & D3D10_FX10_TYPE_BASETYPE_MASK) >> D3D10_FX10_TYPE_BASETYPE_SHIFT);
349 t->type_class = d3d10_variable_class((tmp & D3D10_FX10_TYPE_CLASS_MASK) >> D3D10_FX10_TYPE_CLASS_SHIFT);
351 TRACE("Type description: %#x.\n", tmp);
352 TRACE("\tcolumns: %u.\n", t->column_count);
353 TRACE("\trows: %u.\n", t->row_count);
354 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
355 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
356 TRACE("\tunknown bits: %#x.\n", tmp & ~(D3D10_FX10_TYPE_COLUMN_MASK | D3D10_FX10_TYPE_ROW_MASK
357 | D3D10_FX10_TYPE_BASETYPE_MASK | D3D10_FX10_TYPE_CLASS_MASK));
359 else if (unknown0 == 3)
363 TRACE("Type is a structure.\n");
365 read_dword(&ptr, &t->member_count);
366 TRACE("Member count: %u.\n", t->member_count);
371 t->type_class = D3D10_SVC_STRUCT;
373 t->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->member_count * sizeof(*t->members));
376 ERR("Failed to allocate members memory.\n");
377 return E_OUTOFMEMORY;
380 for (i = 0; i < t->member_count; ++i)
382 struct d3d10_effect_type_member *typem = &t->members[i];
384 read_dword(&ptr, &offset);
385 TRACE("Member name at offset %#x.\n", offset);
387 if (!copy_name(data + offset, &typem->name))
389 ERR("Failed to copy name.\n");
390 return E_OUTOFMEMORY;
392 TRACE("Member name: %s.\n", debugstr_a(typem->name));
394 read_dword(&ptr, &offset);
395 TRACE("Member semantic at offset %#x.\n", offset);
397 if (!copy_name(data + offset, &typem->semantic))
399 ERR("Failed to copy semantic.\n");
400 return E_OUTOFMEMORY;
402 TRACE("Member semantic: %s.\n", debugstr_a(typem->semantic));
404 read_dword(&ptr, &typem->buffer_offset);
405 TRACE("Member offset in struct: %#x.\n", typem->buffer_offset);
407 read_dword(&ptr, &offset);
408 TRACE("Member type info at offset %#x.\n", offset);
410 typem->type = get_fx10_type(t->effect, data, offset);
413 ERR("Failed to get variable type.\n");
422 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset)
424 struct d3d10_effect_type *type;
425 struct wine_rb_entry *entry;
428 entry = wine_rb_get(&effect->types, &offset);
431 TRACE("Returning existing type.\n");
432 return WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
435 type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*type));
438 ERR("Failed to allocate type memory.\n");
442 type->vtbl = &d3d10_effect_type_vtbl;
444 type->effect = effect;
445 hr = parse_fx10_type(type, data + offset, data);
448 ERR("Failed to parse type info, hr %#x.\n", hr);
449 HeapFree(GetProcessHeap(), 0, type);
453 if (wine_rb_put(&effect->types, &offset, &type->entry) == -1)
455 ERR("Failed to insert type entry.\n");
456 HeapFree(GetProcessHeap(), 0, type);
463 static void set_variable_vtbl(struct d3d10_effect_variable *v)
465 switch (v->type->type_class)
467 case D3D10_SVC_SCALAR:
468 v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl;
471 case D3D10_SVC_VECTOR:
472 v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl;
475 case D3D10_SVC_MATRIX_ROWS:
476 case D3D10_SVC_MATRIX_COLUMNS:
477 v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl;
481 FIXME("Unhandled type class %s.\n", debug_d3d10_shader_variable_class(v->type->type_class));
482 v->vtbl = &d3d10_effect_variable_vtbl;
487 static HRESULT copy_variableinfo_from_type(struct d3d10_effect_variable *v)
491 if (v->type->member_count == 0) return S_OK;
493 v->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->member_count * sizeof(*v->members));
496 ERR("Failed to allocate members memory.\n");
497 return E_OUTOFMEMORY;
500 for (i = 0; i < v->type->member_count; ++i)
502 struct d3d10_effect_variable *var = &v->members[i];
503 struct d3d10_effect_type_member *typem = &v->type->members[i];
507 var->effect = v->effect;
508 var->type = typem->type;
509 set_variable_vtbl(var);
511 if (!copy_name(typem->name, &var->name))
513 ERR("Failed to copy name.\n");
514 return E_OUTOFMEMORY;
516 TRACE("Variable name: %s.\n", debugstr_a(var->name));
518 if (!copy_name(typem->semantic, &var->semantic))
520 ERR("Failed to copy name.\n");
521 return E_OUTOFMEMORY;
523 TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
525 var->buffer_offset = typem->buffer_offset;
526 TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
528 hr = copy_variableinfo_from_type(var);
529 if (FAILED(hr)) return hr;
535 static HRESULT parse_fx10_variable_head(struct d3d10_effect_variable *v, const char **ptr, const char *data)
539 read_dword(ptr, &offset);
540 TRACE("Variable name at offset %#x.\n", offset);
542 if (!copy_name(data + offset, &v->name))
544 ERR("Failed to copy name.\n");
545 return E_OUTOFMEMORY;
547 TRACE("Variable name: %s.\n", debugstr_a(v->name));
549 read_dword(ptr, &offset);
550 TRACE("Variable type info at offset %#x.\n", offset);
552 v->type = get_fx10_type(v->effect, data, offset);
555 ERR("Failed to get variable type.\n");
558 set_variable_vtbl(v);
560 return copy_variableinfo_from_type(v);
563 static HRESULT parse_fx10_annotation(struct d3d10_effect_variable *a, const char **ptr, const char *data)
567 hr = parse_fx10_variable_head(a, ptr, data);
568 if (FAILED(hr)) return hr;
570 skip_dword_unknown(ptr, 1);
575 static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr, const char *data)
577 const char *data_ptr;
581 read_dword(ptr, &o->type);
582 TRACE("Effect object is of type %#x.\n", o->type);
584 skip_dword_unknown(ptr, 2);
586 read_dword(ptr, &offset);
587 TRACE("Effect object idx is at offset %#x.\n", offset);
589 data_ptr = data + offset;
590 read_dword(&data_ptr, &offset);
592 TRACE("Effect object starts at offset %#x.\n", offset);
594 /* FIXME: This probably isn't completely correct. */
597 WARN("Skipping effect object.\n");
602 data_ptr = data + offset;
607 case D3D10_EOT_VERTEXSHADER:
608 TRACE("Vertex shader\n");
609 hr = parse_shader(o, data_ptr);
612 case D3D10_EOT_PIXELSHADER:
613 TRACE("Pixel shader\n");
614 hr = parse_shader(o, data_ptr);
617 case D3D10_EOT_GEOMETRYSHADER:
618 TRACE("Geometry shader\n");
619 hr = parse_shader(o, data_ptr);
623 FIXME("Unhandled object type %#x\n", o->type);
631 static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, const char *data)
637 read_dword(ptr, &offset);
638 TRACE("Pass name at offset %#x.\n", offset);
640 if (!copy_name(data + offset, &p->name))
642 ERR("Failed to copy name.\n");
643 return E_OUTOFMEMORY;
645 TRACE("Pass name: %s.\n", debugstr_a(p->name));
647 read_dword(ptr, &p->object_count);
648 TRACE("Pass has %u effect objects.\n", p->object_count);
650 read_dword(ptr, &p->annotation_count);
651 TRACE("Pass has %u annotations.\n", p->annotation_count);
653 p->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->annotation_count * sizeof(*p->annotations));
656 ERR("Failed to allocate pass annotations memory.\n");
657 return E_OUTOFMEMORY;
660 for(i = 0; i < p->annotation_count; ++i)
662 struct d3d10_effect_variable *a = &p->annotations[i];
664 a->effect = p->technique->effect;
666 hr = parse_fx10_annotation(a, ptr, data);
667 if (FAILED(hr)) return hr;
670 p->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->object_count * sizeof(*p->objects));
673 ERR("Failed to allocate effect objects memory.\n");
674 return E_OUTOFMEMORY;
677 for (i = 0; i < p->object_count; ++i)
679 struct d3d10_effect_object *o = &p->objects[i];
683 hr = parse_fx10_object(o, ptr, data);
684 if (FAILED(hr)) return hr;
690 static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char **ptr, const char *data)
696 read_dword(ptr, &offset);
697 TRACE("Technique name at offset %#x.\n", offset);
699 if (!copy_name(data + offset, &t->name))
701 ERR("Failed to copy name.\n");
702 return E_OUTOFMEMORY;
704 TRACE("Technique name: %s.\n", debugstr_a(t->name));
706 read_dword(ptr, &t->pass_count);
707 TRACE("Technique has %u passes\n", t->pass_count);
709 read_dword(ptr, &t->annotation_count);
710 TRACE("Technique has %u annotations.\n", t->annotation_count);
712 t->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->annotation_count * sizeof(*t->annotations));
715 ERR("Failed to allocate technique annotations memory.\n");
716 return E_OUTOFMEMORY;
719 for(i = 0; i < t->annotation_count; ++i)
721 struct d3d10_effect_variable *a = &t->annotations[i];
723 a->effect = t->effect;
725 hr = parse_fx10_annotation(a, ptr, data);
726 if (FAILED(hr)) return hr;
729 t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes));
732 ERR("Failed to allocate passes memory\n");
733 return E_OUTOFMEMORY;
736 for (i = 0; i < t->pass_count; ++i)
738 struct d3d10_effect_pass *p = &t->passes[i];
740 p->vtbl = &d3d10_effect_pass_vtbl;
743 hr = parse_fx10_pass(p, ptr, data);
744 if (FAILED(hr)) return hr;
750 static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
756 hr = parse_fx10_variable_head(v, ptr, data);
757 if (FAILED(hr)) return hr;
759 read_dword(ptr, &offset);
760 TRACE("Variable semantic at offset %#x.\n", offset);
762 if (!copy_name(data + offset, &v->semantic))
764 ERR("Failed to copy semantic.\n");
765 return E_OUTOFMEMORY;
767 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
769 read_dword(ptr, &v->buffer_offset);
770 TRACE("Variable offset in buffer: %#x.\n", v->buffer_offset);
772 skip_dword_unknown(ptr, 1);
774 read_dword(ptr, &v->flag);
775 TRACE("Variable flag: %#x.\n", v->flag);
777 read_dword(ptr, &v->annotation_count);
778 TRACE("Variable has %u annotations.\n", v->annotation_count);
780 v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
783 ERR("Failed to allocate variable annotations memory.\n");
784 return E_OUTOFMEMORY;
787 for(i = 0; i < v->annotation_count; ++i)
789 struct d3d10_effect_variable *a = &v->annotations[i];
792 a->effect = v->effect;
794 hr = parse_fx10_annotation(a, ptr, data);
795 if (FAILED(hr)) return hr;
801 static HRESULT parse_fx10_local_buffer(struct d3d10_effect_variable *l, const char **ptr, const char *data)
805 D3D10_CBUFFER_TYPE d3d10_cbuffer_type;
808 /* Generate our own type, it isn't in the fx blob. */
809 l->type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*l->type));
812 ERR("Failed to allocate local buffer type memory.\n");
813 return E_OUTOFMEMORY;
815 l->type->vtbl = &d3d10_effect_type_vtbl;
816 l->type->type_class = D3D10_SVC_OBJECT;
817 l->type->effect = l->effect;
819 read_dword(ptr, &offset);
820 TRACE("Local buffer name at offset %#x.\n", offset);
822 if (!copy_name(data + offset, &l->name))
824 ERR("Failed to copy name.\n");
825 return E_OUTOFMEMORY;
827 TRACE("Local buffer name: %s.\n", debugstr_a(l->name));
829 read_dword(ptr, &l->data_size);
830 TRACE("Local buffer data size: %#x.\n", l->data_size);
832 read_dword(ptr, &d3d10_cbuffer_type);
833 TRACE("Local buffer type: %#x.\n", d3d10_cbuffer_type);
835 switch(d3d10_cbuffer_type)
837 case D3D10_CT_CBUFFER:
838 l->type->basetype = D3D10_SVT_CBUFFER;
839 if (!copy_name("cbuffer", &l->type->name))
841 ERR("Failed to copy name.\n");
842 return E_OUTOFMEMORY;
846 case D3D10_CT_TBUFFER:
847 l->type->basetype = D3D10_SVT_TBUFFER;
848 if (!copy_name("tbuffer", &l->type->name))
850 ERR("Failed to copy name.\n");
851 return E_OUTOFMEMORY;
856 ERR("Unexpected D3D10_CBUFFER_TYPE %#x!\n", d3d10_cbuffer_type);
860 read_dword(ptr, &l->type->member_count);
861 TRACE("Local buffer member count: %#x.\n", l->type->member_count);
863 skip_dword_unknown(ptr, 1);
865 read_dword(ptr, &l->annotation_count);
866 TRACE("Local buffer has %u annotations.\n", l->annotation_count);
868 l->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->annotation_count * sizeof(*l->annotations));
871 ERR("Failed to allocate local buffer annotations memory.\n");
872 return E_OUTOFMEMORY;
875 for(i = 0; i < l->annotation_count; ++i)
877 struct d3d10_effect_variable *a = &l->annotations[i];
879 a->effect = l->effect;
881 hr = parse_fx10_annotation(a, ptr, data);
882 if (FAILED(hr)) return hr;
885 l->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->members));
888 ERR("Failed to allocate members memory.\n");
889 return E_OUTOFMEMORY;
892 l->type->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->type->members));
893 if (!l->type->members)
895 ERR("Failed to allocate type members memory.\n");
896 return E_OUTOFMEMORY;
899 for (i = 0; i < l->type->member_count; ++i)
901 struct d3d10_effect_variable *v = &l->members[i];
902 struct d3d10_effect_type_member *typem = &l->type->members[i];
905 v->effect = l->effect;
907 hr = parse_fx10_variable(v, ptr, data);
908 if (FAILED(hr)) return hr;
911 * Copy the values from the variable type to the constant buffers type
912 * members structure, because it is our own generated type.
914 typem->type = v->type;
916 if (!copy_name(v->name, &typem->name))
918 ERR("Failed to copy name.\n");
919 return E_OUTOFMEMORY;
921 TRACE("Variable name: %s.\n", debugstr_a(typem->name));
923 if (!copy_name(v->semantic, &typem->semantic))
925 ERR("Failed to copy name.\n");
926 return E_OUTOFMEMORY;
928 TRACE("Variable semantic: %s.\n", debugstr_a(typem->semantic));
930 typem->buffer_offset = v->buffer_offset;
931 TRACE("Variable buffer offset: %u.\n", typem->buffer_offset);
933 l->type->size_packed += v->type->size_packed;
934 l->type->size_unpacked += v->type->size_unpacked;
936 l->type->stride = l->type->size_unpacked = (l->type->size_unpacked + 0xf) & ~0xf;
938 TRACE("Constant buffer:\n");
939 TRACE("\tType name: %s.\n", debugstr_a(l->type->name));
940 TRACE("\tElement count: %u.\n", l->type->element_count);
941 TRACE("\tMember count: %u.\n", l->type->member_count);
942 TRACE("\tUnpacked size: %#x.\n", l->type->size_unpacked);
943 TRACE("\tStride: %#x.\n", l->type->stride);
944 TRACE("\tPacked size %#x.\n", l->type->size_packed);
945 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l->type->basetype));
946 TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l->type->type_class));
951 static int d3d10_effect_type_compare(const void *key, const struct wine_rb_entry *entry)
953 const struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, const struct d3d10_effect_type, entry);
954 const DWORD *id = key;
959 static void d3d10_effect_type_member_destroy(struct d3d10_effect_type_member *typem)
961 TRACE("effect type member %p.\n", typem);
963 /* Do not release typem->type, it will be covered by d3d10_effect_type_destroy(). */
964 HeapFree(GetProcessHeap(), 0, typem->semantic);
965 HeapFree(GetProcessHeap(), 0, typem->name);
968 static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context)
970 struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
972 TRACE("effect type %p.\n", t);
978 for (i = 0; i < t->member_count; ++i)
980 d3d10_effect_type_member_destroy(&t->members[i]);
982 HeapFree(GetProcessHeap(), 0, t->members);
985 HeapFree(GetProcessHeap(), 0, t->name);
986 HeapFree(GetProcessHeap(), 0, t);
989 static const struct wine_rb_functions d3d10_effect_type_rb_functions =
994 d3d10_effect_type_compare,
997 static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size)
999 const char *ptr = data + e->index_offset;
1003 if (wine_rb_init(&e->types, &d3d10_effect_type_rb_functions) == -1)
1005 ERR("Failed to initialize type rbtree.\n");
1009 e->local_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_buffer_count * sizeof(*e->local_buffers));
1010 if (!e->local_buffers)
1012 ERR("Failed to allocate local buffer memory.\n");
1013 return E_OUTOFMEMORY;
1016 e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques));
1019 ERR("Failed to allocate techniques memory\n");
1020 return E_OUTOFMEMORY;
1023 for (i = 0; i < e->local_buffer_count; ++i)
1025 struct d3d10_effect_variable *l = &e->local_buffers[i];
1026 l->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl;
1029 hr = parse_fx10_local_buffer(l, &ptr, data);
1030 if (FAILED(hr)) return hr;
1033 for (i = 0; i < e->technique_count; ++i)
1035 struct d3d10_effect_technique *t = &e->techniques[i];
1037 t->vtbl = &d3d10_effect_technique_vtbl;
1040 hr = parse_fx10_technique(t, &ptr, data);
1041 if (FAILED(hr)) return hr;
1047 static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_size)
1049 const char *ptr = data;
1052 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
1053 read_dword(&ptr, &e->version);
1054 TRACE("Target: %#x\n", e->version);
1056 read_dword(&ptr, &e->local_buffer_count);
1057 TRACE("Local buffer count: %u.\n", e->local_buffer_count);
1059 read_dword(&ptr, &e->variable_count);
1060 TRACE("Variable count: %u\n", e->variable_count);
1062 read_dword(&ptr, &e->object_count);
1063 TRACE("Object count: %u\n", e->object_count);
1065 read_dword(&ptr, &e->sharedbuffers_count);
1066 TRACE("Sharedbuffers count: %u\n", e->sharedbuffers_count);
1068 /* Number of variables in shared buffers? */
1069 read_dword(&ptr, &unknown);
1070 FIXME("Unknown 0: %u\n", unknown);
1072 read_dword(&ptr, &e->sharedobjects_count);
1073 TRACE("Sharedobjects count: %u\n", e->sharedobjects_count);
1075 read_dword(&ptr, &e->technique_count);
1076 TRACE("Technique count: %u\n", e->technique_count);
1078 read_dword(&ptr, &e->index_offset);
1079 TRACE("Index offset: %#x\n", e->index_offset);
1081 read_dword(&ptr, &unknown);
1082 FIXME("Unknown 1: %u\n", unknown);
1084 read_dword(&ptr, &e->texture_count);
1085 TRACE("Texture count: %u\n", e->texture_count);
1087 read_dword(&ptr, &e->dephstencilstate_count);
1088 TRACE("Depthstencilstate count: %u\n", e->dephstencilstate_count);
1090 read_dword(&ptr, &e->blendstate_count);
1091 TRACE("Blendstate count: %u\n", e->blendstate_count);
1093 read_dword(&ptr, &e->rasterizerstate_count);
1094 TRACE("Rasterizerstate count: %u\n", e->rasterizerstate_count);
1096 read_dword(&ptr, &e->samplerstate_count);
1097 TRACE("Samplerstate count: %u\n", e->samplerstate_count);
1099 read_dword(&ptr, &e->rendertargetview_count);
1100 TRACE("Rendertargetview count: %u\n", e->rendertargetview_count);
1102 read_dword(&ptr, &e->depthstencilview_count);
1103 TRACE("Depthstencilview count: %u\n", e->depthstencilview_count);
1105 read_dword(&ptr, &e->shader_call_count);
1106 TRACE("Shader call count: %u\n", e->shader_call_count);
1108 read_dword(&ptr, &e->shader_compile_count);
1109 TRACE("Shader compile count: %u\n", e->shader_compile_count);
1111 return parse_fx10_body(e, ptr, data_size - (ptr - data));
1114 static HRESULT fx10_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
1116 struct d3d10_effect *e = ctx;
1118 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
1120 TRACE("chunk size: %#x\n", data_size);
1125 return parse_fx10(e, data, data_size);
1128 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
1133 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size)
1135 return parse_dxbc(data, data_size, fx10_chunk_handler, This);
1138 static void d3d10_effect_object_destroy(struct d3d10_effect_object *o)
1140 TRACE("effect object %p.\n", o);
1144 case D3D10_EOT_VERTEXSHADER:
1145 case D3D10_EOT_PIXELSHADER:
1146 case D3D10_EOT_GEOMETRYSHADER:
1147 HeapFree(GetProcessHeap(), 0, ((struct d3d10_effect_shader_variable *)o->data)->input_signature);
1153 HeapFree(GetProcessHeap(), 0, o->data);
1156 static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
1158 ID3D10Device *device = o->pass->technique->effect->device;
1160 TRACE("effect object %p, type %#x.\n", o, o->type);
1164 case D3D10_EOT_VERTEXSHADER:
1165 ID3D10Device_VSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.vs);
1168 case D3D10_EOT_PIXELSHADER:
1169 ID3D10Device_PSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.ps);
1172 case D3D10_EOT_GEOMETRYSHADER:
1173 ID3D10Device_GSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.gs);
1177 FIXME("Unhandled effect object type %#x.\n", o->type);
1182 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
1186 TRACE("variable %p.\n", v);
1188 HeapFree(GetProcessHeap(), 0, v->name);
1189 HeapFree(GetProcessHeap(), 0, v->semantic);
1192 for (i = 0; i < v->annotation_count; ++i)
1194 d3d10_effect_variable_destroy(&v->annotations[i]);
1196 HeapFree(GetProcessHeap(), 0, v->annotations);
1201 for (i = 0; i < v->type->member_count; ++i)
1203 d3d10_effect_variable_destroy(&v->members[i]);
1205 HeapFree(GetProcessHeap(), 0, v->members);
1209 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p)
1213 TRACE("pass %p\n", p);
1215 HeapFree(GetProcessHeap(), 0, p->name);
1218 for (i = 0; i < p->object_count; ++i)
1220 d3d10_effect_object_destroy(&p->objects[i]);
1222 HeapFree(GetProcessHeap(), 0, p->objects);
1227 for (i = 0; i < p->annotation_count; ++i)
1229 d3d10_effect_variable_destroy(&p->annotations[i]);
1231 HeapFree(GetProcessHeap(), 0, p->annotations);
1236 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
1240 TRACE("technique %p\n", t);
1242 HeapFree(GetProcessHeap(), 0, t->name);
1245 for (i = 0; i < t->pass_count; ++i)
1247 d3d10_effect_pass_destroy(&t->passes[i]);
1249 HeapFree(GetProcessHeap(), 0, t->passes);
1254 for (i = 0; i < t->annotation_count; ++i)
1256 d3d10_effect_variable_destroy(&t->annotations[i]);
1258 HeapFree(GetProcessHeap(), 0, t->annotations);
1262 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_variable *l)
1266 TRACE("local buffer %p.\n", l);
1268 HeapFree(GetProcessHeap(), 0, l->name);
1271 for (i = 0; i < l->type->member_count; ++i)
1273 d3d10_effect_variable_destroy(&l->members[i]);
1275 HeapFree(GetProcessHeap(), 0, l->members);
1278 if (l->type->members)
1280 for (i = 0; i < l->type->member_count; ++i)
1282 /* Do not release l->type->members[i].type, it will be covered by d3d10_effect_type_destroy(). */
1283 HeapFree(GetProcessHeap(), 0, l->type->members[i].semantic);
1284 HeapFree(GetProcessHeap(), 0, l->type->members[i].name);
1286 HeapFree(GetProcessHeap(), 0, l->type->members);
1288 HeapFree(GetProcessHeap(), 0, l->type->name);
1289 HeapFree(GetProcessHeap(), 0, l->type);
1293 for (i = 0; i < l->annotation_count; ++i)
1295 d3d10_effect_variable_destroy(&l->annotations[i]);
1297 HeapFree(GetProcessHeap(), 0, l->annotations);
1301 /* IUnknown methods */
1303 static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
1305 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
1307 if (IsEqualGUID(riid, &IID_ID3D10Effect)
1308 || IsEqualGUID(riid, &IID_IUnknown))
1310 IUnknown_AddRef(iface);
1315 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
1318 return E_NOINTERFACE;
1321 static ULONG STDMETHODCALLTYPE d3d10_effect_AddRef(ID3D10Effect *iface)
1323 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1324 ULONG refcount = InterlockedIncrement(&This->refcount);
1326 TRACE("%p increasing refcount to %u\n", This, refcount);
1331 static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
1333 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1334 ULONG refcount = InterlockedDecrement(&This->refcount);
1336 TRACE("%p decreasing refcount to %u\n", This, refcount);
1342 if (This->techniques)
1344 for (i = 0; i < This->technique_count; ++i)
1346 d3d10_effect_technique_destroy(&This->techniques[i]);
1348 HeapFree(GetProcessHeap(), 0, This->techniques);
1351 if (This->local_buffers)
1353 for (i = 0; i < This->local_buffer_count; ++i)
1355 d3d10_effect_local_buffer_destroy(&This->local_buffers[i]);
1357 HeapFree(GetProcessHeap(), 0, This->local_buffers);
1360 wine_rb_destroy(&This->types, d3d10_effect_type_destroy, NULL);
1362 ID3D10Device_Release(This->device);
1363 HeapFree(GetProcessHeap(), 0, This);
1369 /* ID3D10Effect methods */
1371 static BOOL STDMETHODCALLTYPE d3d10_effect_IsValid(ID3D10Effect *iface)
1373 FIXME("iface %p stub!\n", iface);
1378 static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
1380 FIXME("iface %p stub!\n", iface);
1385 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
1387 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1389 TRACE("iface %p, device %p\n", iface, device);
1391 ID3D10Device_AddRef(This->device);
1392 *device = This->device;
1397 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)
1399 FIXME("iface %p, desc %p stub!\n", iface, desc);
1404 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface,
1407 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1408 struct d3d10_effect_variable *l;
1410 TRACE("iface %p, index %u\n", iface, index);
1412 if (index >= This->local_buffer_count)
1414 WARN("Invalid index specified\n");
1415 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
1418 l = &This->local_buffers[index];
1420 TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name));
1422 return (ID3D10EffectConstantBuffer *)l;
1425 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,
1428 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1431 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1433 for (i = 0; i < This->local_buffer_count; ++i)
1435 struct d3d10_effect_variable *l = &This->local_buffers[i];
1437 if (!strcmp(l->name, name))
1439 TRACE("Returning buffer %p.\n", l);
1440 return (ID3D10EffectConstantBuffer *)l;
1444 WARN("Invalid name specified\n");
1446 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
1449 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index)
1451 FIXME("iface %p, index %u stub!\n", iface, index);
1456 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name)
1458 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1461 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1463 for (i = 0; i < This->local_buffer_count; ++i)
1465 struct d3d10_effect_variable *l = &This->local_buffers[i];
1468 for (j = 0; j < l->type->member_count; ++j)
1470 struct d3d10_effect_variable *v = &l->members[j];
1472 if (!strcmp(v->name, name))
1474 TRACE("Returning variable %p.\n", v);
1475 return (ID3D10EffectVariable *)v;
1480 WARN("Invalid name specified\n");
1482 return (ID3D10EffectVariable *)&null_variable;
1485 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface,
1488 FIXME("iface %p, semantic %s stub!\n", iface, debugstr_a(semantic));
1493 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByIndex(ID3D10Effect *iface,
1496 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1497 struct d3d10_effect_technique *t;
1499 TRACE("iface %p, index %u\n", iface, index);
1501 if (index >= This->technique_count)
1503 WARN("Invalid index specified\n");
1504 return (ID3D10EffectTechnique *)&null_technique;
1507 t = &This->techniques[index];
1509 TRACE("Returning technique %p, %s.\n", t, debugstr_a(t->name));
1511 return (ID3D10EffectTechnique *)t;
1514 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByName(ID3D10Effect *iface,
1517 struct d3d10_effect *This = (struct d3d10_effect *)iface;
1520 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1522 for (i = 0; i < This->technique_count; ++i)
1524 struct d3d10_effect_technique *t = &This->techniques[i];
1525 if (!strcmp(t->name, name))
1527 TRACE("Returning technique %p\n", t);
1528 return (ID3D10EffectTechnique *)t;
1532 WARN("Invalid name specified\n");
1534 return (ID3D10EffectTechnique *)&null_technique;
1537 static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
1539 FIXME("iface %p stub!\n", iface);
1544 static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface)
1546 FIXME("iface %p stub!\n", iface);
1551 const struct ID3D10EffectVtbl d3d10_effect_vtbl =
1553 /* IUnknown methods */
1554 d3d10_effect_QueryInterface,
1555 d3d10_effect_AddRef,
1556 d3d10_effect_Release,
1557 /* ID3D10Effect methods */
1558 d3d10_effect_IsValid,
1559 d3d10_effect_IsPool,
1560 d3d10_effect_GetDevice,
1561 d3d10_effect_GetDesc,
1562 d3d10_effect_GetConstantBufferByIndex,
1563 d3d10_effect_GetConstantBufferByName,
1564 d3d10_effect_GetVariableByIndex,
1565 d3d10_effect_GetVariableByName,
1566 d3d10_effect_GetVariableBySemantic,
1567 d3d10_effect_GetTechniqueByIndex,
1568 d3d10_effect_GetTechniqueByName,
1569 d3d10_effect_Optimize,
1570 d3d10_effect_IsOptimized,
1573 /* ID3D10EffectTechnique methods */
1575 static BOOL STDMETHODCALLTYPE d3d10_effect_technique_IsValid(ID3D10EffectTechnique *iface)
1577 TRACE("iface %p\n", iface);
1579 return (struct d3d10_effect_technique *)iface != &null_technique;
1582 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_GetDesc(ID3D10EffectTechnique *iface,
1583 D3D10_TECHNIQUE_DESC *desc)
1585 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1587 TRACE("iface %p, desc %p\n", iface, desc);
1589 if(This == &null_technique)
1591 WARN("Null technique specified\n");
1597 WARN("Invalid argument specified\n");
1598 return E_INVALIDARG;
1601 desc->Name = This->name;
1602 desc->Passes = This->pass_count;
1603 desc->Annotations = This->annotation_count;
1608 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByIndex(
1609 ID3D10EffectTechnique *iface, UINT index)
1611 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1612 struct d3d10_effect_variable *a;
1614 TRACE("iface %p, index %u\n", iface, index);
1616 if (index >= This->annotation_count)
1618 WARN("Invalid index specified\n");
1619 return (ID3D10EffectVariable *)&null_variable;
1622 a = &This->annotations[index];
1624 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
1626 return (ID3D10EffectVariable *)a;
1629 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByName(
1630 ID3D10EffectTechnique *iface, LPCSTR name)
1632 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1635 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1637 for (i = 0; i < This->annotation_count; ++i)
1639 struct d3d10_effect_variable *a = &This->annotations[i];
1640 if (!strcmp(a->name, name))
1642 TRACE("Returning annotation %p\n", a);
1643 return (ID3D10EffectVariable *)a;
1647 WARN("Invalid name specified\n");
1649 return (ID3D10EffectVariable *)&null_variable;
1652 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique *iface,
1655 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1656 struct d3d10_effect_pass *p;
1658 TRACE("iface %p, index %u\n", iface, index);
1660 if (index >= This->pass_count)
1662 WARN("Invalid index specified\n");
1663 return (ID3D10EffectPass *)&null_pass;
1666 p = &This->passes[index];
1668 TRACE("Returning pass %p, %s.\n", p, debugstr_a(p->name));
1670 return (ID3D10EffectPass *)p;
1673 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique *iface,
1676 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1679 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1681 for (i = 0; i < This->pass_count; ++i)
1683 struct d3d10_effect_pass *p = &This->passes[i];
1684 if (!strcmp(p->name, name))
1686 TRACE("Returning pass %p\n", p);
1687 return (ID3D10EffectPass *)p;
1691 WARN("Invalid name specified\n");
1693 return (ID3D10EffectPass *)&null_pass;
1696 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique *iface,
1697 D3D10_STATE_BLOCK_MASK *mask)
1699 FIXME("iface %p,mask %p stub!\n", iface, mask);
1704 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl =
1706 /* ID3D10EffectTechnique methods */
1707 d3d10_effect_technique_IsValid,
1708 d3d10_effect_technique_GetDesc,
1709 d3d10_effect_technique_GetAnnotationByIndex,
1710 d3d10_effect_technique_GetAnnotationByName,
1711 d3d10_effect_technique_GetPassByIndex,
1712 d3d10_effect_technique_GetPassByName,
1713 d3d10_effect_technique_ComputeStateBlockMask,
1716 /* ID3D10EffectPass methods */
1718 static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface)
1720 TRACE("iface %p\n", iface);
1722 return (struct d3d10_effect_pass *)iface != &null_pass;
1725 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface, D3D10_PASS_DESC *desc)
1727 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1730 FIXME("iface %p, desc %p partial stub!\n", iface, desc);
1732 if(This == &null_pass)
1734 WARN("Null pass specified\n");
1740 WARN("Invalid argument specified\n");
1741 return E_INVALIDARG;
1744 memset(desc, 0, sizeof(*desc));
1745 desc->Name = This->name;
1746 for (i = 0; i < This->object_count; ++i)
1748 struct d3d10_effect_object *o = &This->objects[i];
1749 if (o->type == D3D10_EOT_VERTEXSHADER)
1751 struct d3d10_effect_shader_variable *s = o->data;
1752 desc->pIAInputSignature = (BYTE *)s->input_signature;
1753 desc->IAInputSignatureSize = s->input_signature_size;
1761 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface,
1762 D3D10_PASS_SHADER_DESC *desc)
1764 FIXME("iface %p, desc %p stub!\n", iface, desc);
1769 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface,
1770 D3D10_PASS_SHADER_DESC *desc)
1772 FIXME("iface %p, desc %p stub!\n", iface, desc);
1777 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface,
1778 D3D10_PASS_SHADER_DESC *desc)
1780 FIXME("iface %p, desc %p stub!\n", iface, desc);
1785 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass *iface,
1788 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1789 struct d3d10_effect_variable *a;
1791 TRACE("iface %p, index %u\n", iface, index);
1793 if (index >= This->annotation_count)
1795 WARN("Invalid index specified\n");
1796 return (ID3D10EffectVariable *)&null_variable;
1799 a = &This->annotations[index];
1801 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
1803 return (ID3D10EffectVariable *)a;
1806 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass *iface,
1809 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1812 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1814 for (i = 0; i < This->annotation_count; ++i)
1816 struct d3d10_effect_variable *a = &This->annotations[i];
1817 if (!strcmp(a->name, name))
1819 TRACE("Returning annotation %p\n", a);
1820 return (ID3D10EffectVariable *)a;
1824 WARN("Invalid name specified\n");
1826 return (ID3D10EffectVariable *)&null_variable;
1829 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
1831 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1835 TRACE("iface %p, flags %#x\n", iface, flags);
1837 if (flags) FIXME("Ignoring flags (%#x)\n", flags);
1839 for (i = 0; i < This->object_count; ++i)
1841 hr = d3d10_effect_object_apply(&This->objects[i]);
1842 if (FAILED(hr)) break;
1848 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass *iface,
1849 D3D10_STATE_BLOCK_MASK *mask)
1851 FIXME("iface %p, mask %p stub!\n", iface, mask);
1856 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl =
1858 /* ID3D10EffectPass methods */
1859 d3d10_effect_pass_IsValid,
1860 d3d10_effect_pass_GetDesc,
1861 d3d10_effect_pass_GetVertexShaderDesc,
1862 d3d10_effect_pass_GetGeometryShaderDesc,
1863 d3d10_effect_pass_GetPixelShaderDesc,
1864 d3d10_effect_pass_GetAnnotationByIndex,
1865 d3d10_effect_pass_GetAnnotationByName,
1866 d3d10_effect_pass_Apply,
1867 d3d10_effect_pass_ComputeStateBlockMask,
1870 /* ID3D10EffectVariable methods */
1872 static BOOL STDMETHODCALLTYPE d3d10_effect_variable_IsValid(ID3D10EffectVariable *iface)
1874 TRACE("iface %p\n", iface);
1876 return (struct d3d10_effect_variable *)iface != &null_variable;
1879 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_variable_GetType(ID3D10EffectVariable *iface)
1881 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1883 TRACE("iface %p\n", iface);
1885 return (ID3D10EffectType *)This->type;
1888 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetDesc(ID3D10EffectVariable *iface,
1889 D3D10_EFFECT_VARIABLE_DESC *desc)
1891 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1893 TRACE("iface %p, desc %p\n", iface, desc);
1895 if(This == &null_variable)
1897 WARN("Null variable specified\n");
1903 WARN("Invalid argument specified\n");
1904 return E_INVALIDARG;
1907 memset(desc, 0, sizeof(*desc));
1908 desc->Name = This->name;
1909 desc->Semantic = This->semantic;
1910 desc->Flags = This->flag;
1911 desc->Annotations = This->annotation_count;
1912 desc->BufferOffset = This->buffer_offset;
1914 if( This->flag == D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT)
1916 desc->ExplicitBindPoint = This->buffer_offset;
1920 FIXME("Unhandled flag %#x!\n", This->flag);
1926 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByIndex(
1927 ID3D10EffectVariable *iface, UINT index)
1929 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1930 struct d3d10_effect_variable *a;
1932 TRACE("iface %p, index %u\n", iface, index);
1934 if (index >= This->annotation_count)
1936 WARN("Invalid index specified\n");
1937 return (ID3D10EffectVariable *)&null_variable;
1940 a = &This->annotations[index];
1942 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
1944 return (ID3D10EffectVariable *)a;
1947 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName(
1948 ID3D10EffectVariable *iface, LPCSTR name)
1950 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
1953 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1955 for (i = 0; i < This->annotation_count; ++i)
1957 struct d3d10_effect_variable *a = &This->annotations[i];
1958 if (!strcmp(a->name, name))
1960 TRACE("Returning annotation %p\n", a);
1961 return (ID3D10EffectVariable *)a;
1965 WARN("Invalid name specified\n");
1967 return (ID3D10EffectVariable *)&null_variable;
1970 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex(
1971 ID3D10EffectVariable *iface, UINT index)
1973 FIXME("iface %p, index %u stub!\n", iface, index);
1978 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName(
1979 ID3D10EffectVariable *iface, LPCSTR name)
1981 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1986 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic(
1987 ID3D10EffectVariable *iface, LPCSTR semantic)
1989 FIXME("iface %p, semantic %s stub!\n", iface, debugstr_a(semantic));
1994 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetElement(
1995 ID3D10EffectVariable *iface, UINT index)
1997 FIXME("iface %p, index %u stub!\n", iface, index);
2002 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_GetParentConstantBuffer(
2003 ID3D10EffectVariable *iface)
2005 FIXME("iface %p stub!\n", iface);
2010 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsScalar(
2011 ID3D10EffectVariable *iface)
2013 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2015 TRACE("iface %p\n", iface);
2017 if (This->vtbl == (ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl)
2018 return (ID3D10EffectScalarVariable *)This;
2020 return (ID3D10EffectScalarVariable *)&null_scalar_variable;
2023 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsVector(
2024 ID3D10EffectVariable *iface)
2026 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2028 TRACE("iface %p\n", iface);
2030 if (This->vtbl == (ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl)
2031 return (ID3D10EffectVectorVariable *)This;
2033 return (ID3D10EffectVectorVariable *)&null_vector_variable;
2036 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix(
2037 ID3D10EffectVariable *iface)
2039 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
2041 TRACE("iface %p\n", iface);
2043 if (This->vtbl == (ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl)
2044 return (ID3D10EffectMatrixVariable *)This;
2046 return (ID3D10EffectMatrixVariable *)&null_matrix_variable;
2049 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsString(
2050 ID3D10EffectVariable *iface)
2052 FIXME("iface %p stub!\n", iface);
2057 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShaderResource(
2058 ID3D10EffectVariable *iface)
2060 FIXME("iface %p stub!\n", iface);
2065 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRenderTargetView(
2066 ID3D10EffectVariable *iface)
2068 FIXME("iface %p stub!\n", iface);
2073 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencilView(
2074 ID3D10EffectVariable *iface)
2076 FIXME("iface %p stub!\n", iface);
2081 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_AsConstantBuffer(
2082 ID3D10EffectVariable *iface)
2084 FIXME("iface %p stub!\n", iface);
2089 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShader(
2090 ID3D10EffectVariable *iface)
2092 FIXME("iface %p stub!\n", iface);
2097 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsBlend(ID3D10EffectVariable *iface)
2099 FIXME("iface %p stub!\n", iface);
2104 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencil(
2105 ID3D10EffectVariable *iface)
2107 FIXME("iface %p stub!\n", iface);
2112 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRasterizer(
2113 ID3D10EffectVariable *iface)
2115 FIXME("iface %p stub!\n", iface);
2120 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsSampler(
2121 ID3D10EffectVariable *iface)
2123 FIXME("iface %p stub!\n", iface);
2128 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface,
2129 void *data, UINT offset, UINT count)
2131 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
2136 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface,
2137 void *data, UINT offset, UINT count)
2139 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
2144 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl =
2146 /* ID3D10EffectVariable methods */
2147 d3d10_effect_variable_IsValid,
2148 d3d10_effect_variable_GetType,
2149 d3d10_effect_variable_GetDesc,
2150 d3d10_effect_variable_GetAnnotationByIndex,
2151 d3d10_effect_variable_GetAnnotationByName,
2152 d3d10_effect_variable_GetMemberByIndex,
2153 d3d10_effect_variable_GetMemberByName,
2154 d3d10_effect_variable_GetMemberBySemantic,
2155 d3d10_effect_variable_GetElement,
2156 d3d10_effect_variable_GetParentConstantBuffer,
2157 d3d10_effect_variable_AsScalar,
2158 d3d10_effect_variable_AsVector,
2159 d3d10_effect_variable_AsMatrix,
2160 d3d10_effect_variable_AsString,
2161 d3d10_effect_variable_AsShaderResource,
2162 d3d10_effect_variable_AsRenderTargetView,
2163 d3d10_effect_variable_AsDepthStencilView,
2164 d3d10_effect_variable_AsConstantBuffer,
2165 d3d10_effect_variable_AsShader,
2166 d3d10_effect_variable_AsBlend,
2167 d3d10_effect_variable_AsDepthStencil,
2168 d3d10_effect_variable_AsRasterizer,
2169 d3d10_effect_variable_AsSampler,
2170 d3d10_effect_variable_SetRawValue,
2171 d3d10_effect_variable_GetRawValue,
2174 /* ID3D10EffectVariable methods */
2175 static BOOL STDMETHODCALLTYPE d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer *iface)
2177 TRACE("iface %p\n", iface);
2179 return (struct d3d10_effect_variable *)iface != &null_local_buffer;
2182 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer *iface)
2184 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
2187 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer *iface,
2188 D3D10_EFFECT_VARIABLE_DESC *desc)
2190 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
2193 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByIndex(
2194 ID3D10EffectConstantBuffer *iface, UINT index)
2196 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
2199 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByName(
2200 ID3D10EffectConstantBuffer *iface, LPCSTR name)
2202 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
2205 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByIndex(
2206 ID3D10EffectConstantBuffer *iface, UINT index)
2208 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
2211 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByName(
2212 ID3D10EffectConstantBuffer *iface, LPCSTR name)
2214 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
2217 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberBySemantic(
2218 ID3D10EffectConstantBuffer *iface, LPCSTR semantic)
2220 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
2223 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetElement(
2224 ID3D10EffectConstantBuffer *iface, UINT index)
2226 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
2229 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetParentConstantBuffer(
2230 ID3D10EffectConstantBuffer *iface)
2232 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
2235 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsScalar(
2236 ID3D10EffectConstantBuffer *iface)
2238 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
2241 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsVector(
2242 ID3D10EffectConstantBuffer *iface)
2244 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
2247 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsMatrix(
2248 ID3D10EffectConstantBuffer *iface)
2250 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
2253 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsString(
2254 ID3D10EffectConstantBuffer *iface)
2256 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
2259 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShaderResource(
2260 ID3D10EffectConstantBuffer *iface)
2262 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
2265 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRenderTargetView(
2266 ID3D10EffectConstantBuffer *iface)
2268 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
2271 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencilView(
2272 ID3D10EffectConstantBuffer *iface)
2274 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
2277 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsConstantBuffer(
2278 ID3D10EffectConstantBuffer *iface)
2280 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
2283 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShader(
2284 ID3D10EffectConstantBuffer *iface)
2286 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
2289 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer *iface)
2291 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
2294 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencil(
2295 ID3D10EffectConstantBuffer *iface)
2297 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
2300 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRasterizer(
2301 ID3D10EffectConstantBuffer *iface)
2303 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
2306 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsSampler(
2307 ID3D10EffectConstantBuffer *iface)
2309 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
2312 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer *iface,
2313 void *data, UINT offset, UINT count)
2315 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2318 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer *iface,
2319 void *data, UINT offset, UINT count)
2321 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2324 /* ID3D10EffectConstantBuffer methods */
2325 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer *iface,
2326 ID3D10Buffer *buffer)
2328 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
2333 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer *iface,
2334 ID3D10Buffer **buffer)
2336 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
2341 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer *iface,
2342 ID3D10ShaderResourceView *view)
2344 FIXME("iface %p, view %p stub!\n", iface, view);
2349 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer *iface,
2350 ID3D10ShaderResourceView **view)
2352 FIXME("iface %p, view %p stub!\n", iface, view);
2357 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl =
2359 /* ID3D10EffectVariable methods */
2360 d3d10_effect_constant_buffer_IsValid,
2361 d3d10_effect_constant_buffer_GetType,
2362 d3d10_effect_constant_buffer_GetDesc,
2363 d3d10_effect_constant_buffer_GetAnnotationByIndex,
2364 d3d10_effect_constant_buffer_GetAnnotationByName,
2365 d3d10_effect_constant_buffer_GetMemberByIndex,
2366 d3d10_effect_constant_buffer_GetMemberByName,
2367 d3d10_effect_constant_buffer_GetMemberBySemantic,
2368 d3d10_effect_constant_buffer_GetElement,
2369 d3d10_effect_constant_buffer_GetParentConstantBuffer,
2370 d3d10_effect_constant_buffer_AsScalar,
2371 d3d10_effect_constant_buffer_AsVector,
2372 d3d10_effect_constant_buffer_AsMatrix,
2373 d3d10_effect_constant_buffer_AsString,
2374 d3d10_effect_constant_buffer_AsShaderResource,
2375 d3d10_effect_constant_buffer_AsRenderTargetView,
2376 d3d10_effect_constant_buffer_AsDepthStencilView,
2377 d3d10_effect_constant_buffer_AsConstantBuffer,
2378 d3d10_effect_constant_buffer_AsShader,
2379 d3d10_effect_constant_buffer_AsBlend,
2380 d3d10_effect_constant_buffer_AsDepthStencil,
2381 d3d10_effect_constant_buffer_AsRasterizer,
2382 d3d10_effect_constant_buffer_AsSampler,
2383 d3d10_effect_constant_buffer_SetRawValue,
2384 d3d10_effect_constant_buffer_GetRawValue,
2385 /* ID3D10EffectConstantBuffer methods */
2386 d3d10_effect_constant_buffer_SetConstantBuffer,
2387 d3d10_effect_constant_buffer_GetConstantBuffer,
2388 d3d10_effect_constant_buffer_SetTextureBuffer,
2389 d3d10_effect_constant_buffer_GetTextureBuffer,
2392 /* ID3D10EffectVariable methods */
2394 static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
2396 TRACE("iface %p\n", iface);
2398 return (struct d3d10_effect_variable *)iface != &null_scalar_variable;
2401 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetType(
2402 ID3D10EffectScalarVariable *iface)
2404 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
2407 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetDesc(ID3D10EffectScalarVariable *iface,
2408 D3D10_EFFECT_VARIABLE_DESC *desc)
2410 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
2413 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByIndex(
2414 ID3D10EffectScalarVariable *iface, UINT index)
2416 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
2419 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByName(
2420 ID3D10EffectScalarVariable *iface, LPCSTR name)
2422 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
2425 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByIndex(
2426 ID3D10EffectScalarVariable *iface, UINT index)
2428 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
2431 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByName(
2432 ID3D10EffectScalarVariable *iface, LPCSTR name)
2434 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
2437 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberBySemantic(
2438 ID3D10EffectScalarVariable *iface, LPCSTR semantic)
2440 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
2443 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetElement(
2444 ID3D10EffectScalarVariable *iface, UINT index)
2446 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
2449 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetParentConstantBuffer(
2450 ID3D10EffectScalarVariable *iface)
2452 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
2455 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsScalar(
2456 ID3D10EffectScalarVariable *iface)
2458 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
2461 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsVector(
2462 ID3D10EffectScalarVariable *iface)
2464 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
2467 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsMatrix(
2468 ID3D10EffectScalarVariable *iface)
2470 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
2473 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsString(
2474 ID3D10EffectScalarVariable *iface)
2476 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
2479 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShaderResource(
2480 ID3D10EffectScalarVariable *iface)
2482 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
2485 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRenderTargetView(
2486 ID3D10EffectScalarVariable *iface)
2488 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
2491 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencilView(
2492 ID3D10EffectScalarVariable *iface)
2494 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
2497 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsConstantBuffer(
2498 ID3D10EffectScalarVariable *iface)
2500 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
2503 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShader(
2504 ID3D10EffectScalarVariable *iface)
2506 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
2509 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsBlend(
2510 ID3D10EffectScalarVariable *iface)
2512 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
2515 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencil(
2516 ID3D10EffectScalarVariable *iface)
2518 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
2521 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRasterizer(
2522 ID3D10EffectScalarVariable *iface)
2524 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
2527 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsSampler(
2528 ID3D10EffectScalarVariable *iface)
2530 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
2533 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetRawValue(ID3D10EffectScalarVariable *iface,
2534 void *data, UINT offset, UINT count)
2536 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2539 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetRawValue(ID3D10EffectScalarVariable *iface,
2540 void *data, UINT offset, UINT count)
2542 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2545 /* ID3D10EffectScalarVariable methods */
2547 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable *iface,
2550 FIXME("iface %p, value %.8e stub!\n", iface, value);
2555 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable *iface,
2558 FIXME("iface %p, value %p stub!\n", iface, value);
2563 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable *iface,
2564 float *values, UINT offset, UINT count)
2566 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2571 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable *iface,
2572 float *values, UINT offset, UINT count)
2574 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2579 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable *iface,
2582 FIXME("iface %p, value %d stub!\n", iface, value);
2587 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable *iface,
2590 FIXME("iface %p, value %p stub!\n", iface, value);
2595 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable *iface,
2596 int *values, UINT offset, UINT count)
2598 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2603 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable *iface,
2604 int *values, UINT offset, UINT count)
2606 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2611 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable *iface,
2614 FIXME("iface %p, value %d stub!\n", iface, value);
2619 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable *iface,
2622 FIXME("iface %p, value %p stub!\n", iface, value);
2627 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable *iface,
2628 BOOL *values, UINT offset, UINT count)
2630 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2635 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable *iface,
2636 BOOL *values, UINT offset, UINT count)
2638 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2643 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl =
2645 /* ID3D10EffectVariable methods */
2646 d3d10_effect_scalar_variable_IsValid,
2647 d3d10_effect_scalar_variable_GetType,
2648 d3d10_effect_scalar_variable_GetDesc,
2649 d3d10_effect_scalar_variable_GetAnnotationByIndex,
2650 d3d10_effect_scalar_variable_GetAnnotationByName,
2651 d3d10_effect_scalar_variable_GetMemberByIndex,
2652 d3d10_effect_scalar_variable_GetMemberByName,
2653 d3d10_effect_scalar_variable_GetMemberBySemantic,
2654 d3d10_effect_scalar_variable_GetElement,
2655 d3d10_effect_scalar_variable_GetParentConstantBuffer,
2656 d3d10_effect_scalar_variable_AsScalar,
2657 d3d10_effect_scalar_variable_AsVector,
2658 d3d10_effect_scalar_variable_AsMatrix,
2659 d3d10_effect_scalar_variable_AsString,
2660 d3d10_effect_scalar_variable_AsShaderResource,
2661 d3d10_effect_scalar_variable_AsRenderTargetView,
2662 d3d10_effect_scalar_variable_AsDepthStencilView,
2663 d3d10_effect_scalar_variable_AsConstantBuffer,
2664 d3d10_effect_scalar_variable_AsShader,
2665 d3d10_effect_scalar_variable_AsBlend,
2666 d3d10_effect_scalar_variable_AsDepthStencil,
2667 d3d10_effect_scalar_variable_AsRasterizer,
2668 d3d10_effect_scalar_variable_AsSampler,
2669 d3d10_effect_scalar_variable_SetRawValue,
2670 d3d10_effect_scalar_variable_GetRawValue,
2671 /* ID3D10EffectScalarVariable methods */
2672 d3d10_effect_scalar_variable_SetFloat,
2673 d3d10_effect_scalar_variable_GetFloat,
2674 d3d10_effect_scalar_variable_SetFloatArray,
2675 d3d10_effect_scalar_variable_GetFloatArray,
2676 d3d10_effect_scalar_variable_SetInt,
2677 d3d10_effect_scalar_variable_GetInt,
2678 d3d10_effect_scalar_variable_SetIntArray,
2679 d3d10_effect_scalar_variable_GetIntArray,
2680 d3d10_effect_scalar_variable_SetBool,
2681 d3d10_effect_scalar_variable_GetBool,
2682 d3d10_effect_scalar_variable_SetBoolArray,
2683 d3d10_effect_scalar_variable_GetBoolArray,
2686 /* ID3D10EffectVariable methods */
2688 static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
2690 TRACE("iface %p\n", iface);
2692 return (struct d3d10_effect_variable *)iface != &null_vector_variable;
2695 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetType(
2696 ID3D10EffectVectorVariable *iface)
2698 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
2701 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable *iface,
2702 D3D10_EFFECT_VARIABLE_DESC *desc)
2704 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
2707 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByIndex(
2708 ID3D10EffectVectorVariable *iface, UINT index)
2710 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
2713 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByName(
2714 ID3D10EffectVectorVariable *iface, LPCSTR name)
2716 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
2719 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByIndex(
2720 ID3D10EffectVectorVariable *iface, UINT index)
2722 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
2725 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByName(
2726 ID3D10EffectVectorVariable *iface, LPCSTR name)
2728 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
2731 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberBySemantic(
2732 ID3D10EffectVectorVariable *iface, LPCSTR semantic)
2734 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
2737 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetElement(
2738 ID3D10EffectVectorVariable *iface, UINT index)
2740 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
2743 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetParentConstantBuffer(
2744 ID3D10EffectVectorVariable *iface)
2746 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
2749 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsScalar(
2750 ID3D10EffectVectorVariable *iface)
2752 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
2755 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsVector(
2756 ID3D10EffectVectorVariable *iface)
2758 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
2761 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsMatrix(
2762 ID3D10EffectVectorVariable *iface)
2764 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
2767 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsString(
2768 ID3D10EffectVectorVariable *iface)
2770 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
2773 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShaderResource(
2774 ID3D10EffectVectorVariable *iface)
2776 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
2779 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRenderTargetView(
2780 ID3D10EffectVectorVariable *iface)
2782 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
2785 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencilView(
2786 ID3D10EffectVectorVariable *iface)
2788 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
2791 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsConstantBuffer(
2792 ID3D10EffectVectorVariable *iface)
2794 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
2797 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShader(
2798 ID3D10EffectVectorVariable *iface)
2800 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
2803 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsBlend(
2804 ID3D10EffectVectorVariable *iface)
2806 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
2809 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencil(
2810 ID3D10EffectVectorVariable *iface)
2812 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
2815 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRasterizer(
2816 ID3D10EffectVectorVariable *iface)
2818 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
2821 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsSampler(
2822 ID3D10EffectVectorVariable *iface)
2824 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
2827 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable *iface,
2828 void *data, UINT offset, UINT count)
2830 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2833 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable *iface,
2834 void *data, UINT offset, UINT count)
2836 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
2839 /* ID3D10EffectVectorVariable methods */
2841 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable *iface,
2844 FIXME("iface %p, value %p stub!\n", iface, value);
2849 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable *iface,
2852 FIXME("iface %p, value %p stub!\n", iface, value);
2857 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable *iface,
2860 FIXME("iface %p, value %p stub!\n", iface, value);
2865 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable *iface,
2868 FIXME("iface %p, value %p stub!\n", iface, value);
2873 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable *iface,
2876 FIXME("iface %p, value %p stub!\n", iface, value);
2881 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable *iface,
2884 FIXME("iface %p, value %p stub!\n", iface, value);
2889 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable *iface,
2890 BOOL *values, UINT offset, UINT count)
2892 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2897 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable *iface,
2898 int *values, UINT offset, UINT count)
2900 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2905 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable *iface,
2906 float *values, UINT offset, UINT count)
2908 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2913 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable *iface,
2914 BOOL *values, UINT offset, UINT count)
2916 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2921 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable *iface,
2922 int *values, UINT offset, UINT count)
2924 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2929 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable *iface,
2930 float *values, UINT offset, UINT count)
2932 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
2937 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl =
2939 /* ID3D10EffectVariable methods */
2940 d3d10_effect_vector_variable_IsValid,
2941 d3d10_effect_vector_variable_GetType,
2942 d3d10_effect_vector_variable_GetDesc,
2943 d3d10_effect_vector_variable_GetAnnotationByIndex,
2944 d3d10_effect_vector_variable_GetAnnotationByName,
2945 d3d10_effect_vector_variable_GetMemberByIndex,
2946 d3d10_effect_vector_variable_GetMemberByName,
2947 d3d10_effect_vector_variable_GetMemberBySemantic,
2948 d3d10_effect_vector_variable_GetElement,
2949 d3d10_effect_vector_variable_GetParentConstantBuffer,
2950 d3d10_effect_vector_variable_AsScalar,
2951 d3d10_effect_vector_variable_AsVector,
2952 d3d10_effect_vector_variable_AsMatrix,
2953 d3d10_effect_vector_variable_AsString,
2954 d3d10_effect_vector_variable_AsShaderResource,
2955 d3d10_effect_vector_variable_AsRenderTargetView,
2956 d3d10_effect_vector_variable_AsDepthStencilView,
2957 d3d10_effect_vector_variable_AsConstantBuffer,
2958 d3d10_effect_vector_variable_AsShader,
2959 d3d10_effect_vector_variable_AsBlend,
2960 d3d10_effect_vector_variable_AsDepthStencil,
2961 d3d10_effect_vector_variable_AsRasterizer,
2962 d3d10_effect_vector_variable_AsSampler,
2963 d3d10_effect_vector_variable_SetRawValue,
2964 d3d10_effect_vector_variable_GetRawValue,
2965 /* ID3D10EffectVectorVariable methods */
2966 d3d10_effect_vector_variable_SetBoolVector,
2967 d3d10_effect_vector_variable_SetIntVector,
2968 d3d10_effect_vector_variable_SetFloatVector,
2969 d3d10_effect_vector_variable_GetBoolVector,
2970 d3d10_effect_vector_variable_GetIntVector,
2971 d3d10_effect_vector_variable_GetFloatVector,
2972 d3d10_effect_vector_variable_SetBoolVectorArray,
2973 d3d10_effect_vector_variable_SetIntVectorArray,
2974 d3d10_effect_vector_variable_SetFloatVectorArray,
2975 d3d10_effect_vector_variable_GetBoolVectorArray,
2976 d3d10_effect_vector_variable_GetIntVectorArray,
2977 d3d10_effect_vector_variable_GetFloatVectorArray,
2980 /* ID3D10EffectVariable methods */
2982 static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
2984 TRACE("iface %p\n", iface);
2986 return (struct d3d10_effect_variable *)iface != &null_matrix_variable;
2989 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetType(
2990 ID3D10EffectMatrixVariable *iface)
2992 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
2995 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetDesc(ID3D10EffectMatrixVariable *iface,
2996 D3D10_EFFECT_VARIABLE_DESC *desc)
2998 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3001 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByIndex(
3002 ID3D10EffectMatrixVariable *iface, UINT index)
3004 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3007 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByName(
3008 ID3D10EffectMatrixVariable *iface, LPCSTR name)
3010 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3013 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByIndex(
3014 ID3D10EffectMatrixVariable *iface, UINT index)
3016 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3019 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByName(
3020 ID3D10EffectMatrixVariable *iface, LPCSTR name)
3022 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3025 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberBySemantic(
3026 ID3D10EffectMatrixVariable *iface, LPCSTR semantic)
3028 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3031 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetElement(
3032 ID3D10EffectMatrixVariable *iface, UINT index)
3034 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3037 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetParentConstantBuffer(
3038 ID3D10EffectMatrixVariable *iface)
3040 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3043 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsScalar(
3044 ID3D10EffectMatrixVariable *iface)
3046 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3049 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsVector(
3050 ID3D10EffectMatrixVariable *iface)
3052 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3055 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsMatrix(
3056 ID3D10EffectMatrixVariable *iface)
3058 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3061 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsString(
3062 ID3D10EffectMatrixVariable *iface)
3064 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3067 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShaderResource(
3068 ID3D10EffectMatrixVariable *iface)
3070 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3073 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRenderTargetView(
3074 ID3D10EffectMatrixVariable *iface)
3076 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3079 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencilView(
3080 ID3D10EffectMatrixVariable *iface)
3082 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3085 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsConstantBuffer(
3086 ID3D10EffectMatrixVariable *iface)
3088 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3091 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShader(
3092 ID3D10EffectMatrixVariable *iface)
3094 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3097 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsBlend(
3098 ID3D10EffectMatrixVariable *iface)
3100 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3103 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencil(
3104 ID3D10EffectMatrixVariable *iface)
3106 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3109 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRasterizer(
3110 ID3D10EffectMatrixVariable *iface)
3112 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3115 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsSampler(
3116 ID3D10EffectMatrixVariable *iface)
3118 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3121 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetRawValue(ID3D10EffectMatrixVariable *iface,
3122 void *data, UINT offset, UINT count)
3124 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3127 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetRawValue(ID3D10EffectMatrixVariable *iface,
3128 void *data, UINT offset, UINT count)
3130 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3133 /* ID3D10EffectMatrixVariable methods */
3135 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrix(ID3D10EffectMatrixVariable *iface,
3138 FIXME("iface %p, data %p stub!\n", iface, data);
3143 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrix(ID3D10EffectMatrixVariable *iface,
3146 FIXME("iface %p, data %p stub!\n", iface, data);
3151 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixArray(ID3D10EffectMatrixVariable *iface,
3152 float *data, UINT offset, UINT count)
3154 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3159 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixArray(ID3D10EffectMatrixVariable *iface,
3160 float *data, UINT offset, UINT count)
3162 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3167 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
3170 FIXME("iface %p, data %p stub!\n", iface, data);
3175 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
3178 FIXME("iface %p, data %p stub!\n", iface, data);
3183 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
3184 float *data, UINT offset, UINT count)
3186 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3191 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
3192 float *data, UINT offset, UINT count)
3194 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3200 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl =
3202 /* ID3D10EffectVariable methods */
3203 d3d10_effect_matrix_variable_IsValid,
3204 d3d10_effect_matrix_variable_GetType,
3205 d3d10_effect_matrix_variable_GetDesc,
3206 d3d10_effect_matrix_variable_GetAnnotationByIndex,
3207 d3d10_effect_matrix_variable_GetAnnotationByName,
3208 d3d10_effect_matrix_variable_GetMemberByIndex,
3209 d3d10_effect_matrix_variable_GetMemberByName,
3210 d3d10_effect_matrix_variable_GetMemberBySemantic,
3211 d3d10_effect_matrix_variable_GetElement,
3212 d3d10_effect_matrix_variable_GetParentConstantBuffer,
3213 d3d10_effect_matrix_variable_AsScalar,
3214 d3d10_effect_matrix_variable_AsVector,
3215 d3d10_effect_matrix_variable_AsMatrix,
3216 d3d10_effect_matrix_variable_AsString,
3217 d3d10_effect_matrix_variable_AsShaderResource,
3218 d3d10_effect_matrix_variable_AsRenderTargetView,
3219 d3d10_effect_matrix_variable_AsDepthStencilView,
3220 d3d10_effect_matrix_variable_AsConstantBuffer,
3221 d3d10_effect_matrix_variable_AsShader,
3222 d3d10_effect_matrix_variable_AsBlend,
3223 d3d10_effect_matrix_variable_AsDepthStencil,
3224 d3d10_effect_matrix_variable_AsRasterizer,
3225 d3d10_effect_matrix_variable_AsSampler,
3226 d3d10_effect_matrix_variable_SetRawValue,
3227 d3d10_effect_matrix_variable_GetRawValue,
3228 /* ID3D10EffectMatrixVariable methods */
3229 d3d10_effect_matrix_variable_SetMatrix,
3230 d3d10_effect_matrix_variable_GetMatrix,
3231 d3d10_effect_matrix_variable_SetMatrixArray,
3232 d3d10_effect_matrix_variable_GetMatrixArray,
3233 d3d10_effect_matrix_variable_SetMatrixTranspose,
3234 d3d10_effect_matrix_variable_GetMatrixTranspose,
3235 d3d10_effect_matrix_variable_SetMatrixTransposeArray,
3236 d3d10_effect_matrix_variable_GetMatrixTransposeArray,
3239 static BOOL STDMETHODCALLTYPE d3d10_effect_type_IsValid(ID3D10EffectType *iface)
3241 FIXME("iface %p stub!\n", iface);
3246 static HRESULT STDMETHODCALLTYPE d3d10_effect_type_GetDesc(ID3D10EffectType *iface, D3D10_EFFECT_TYPE_DESC *desc)
3248 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
3250 TRACE("iface %p, desc %p\n", iface, desc);
3252 if (!desc) return E_INVALIDARG;
3254 desc->TypeName = This->name;
3255 desc->Class = This->type_class;
3256 desc->Type = This->basetype;
3257 desc->Elements = This->element_count;
3258 desc->Members = This->member_count;
3259 desc->Rows = This->row_count;
3260 desc->Columns = This->column_count;
3261 desc->PackedSize = This->size_packed;
3262 desc->UnpackedSize = This->size_unpacked;
3263 desc->Stride = This->stride;
3268 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByIndex(ID3D10EffectType *iface,
3271 FIXME("iface %p, index %u stub!\n", iface, index);
3276 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByName(ID3D10EffectType *iface,
3279 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
3284 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeBySemantic(ID3D10EffectType *iface,
3287 FIXME("iface %p, semantic %s stub!\n", iface, debugstr_a(semantic));
3292 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberName(ID3D10EffectType *iface, UINT index)
3294 struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;
3296 TRACE("iface %p, index %u\n", iface, index);
3298 if(index >= This->member_count) return NULL;
3300 return This->members[index].name;
3303 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberSemantic(ID3D10EffectType *iface, UINT index)
3305 FIXME("iface %p, index %u stub!\n", iface, index);
3310 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl =
3312 /* ID3D10EffectType */
3313 d3d10_effect_type_IsValid,
3314 d3d10_effect_type_GetDesc,
3315 d3d10_effect_type_GetMemberTypeByIndex,
3316 d3d10_effect_type_GetMemberTypeByName,
3317 d3d10_effect_type_GetMemberTypeBySemantic,
3318 d3d10_effect_type_GetMemberName,
3319 d3d10_effect_type_GetMemberSemantic,