dsound: Get rid of the DSOUND_QueryInterface() helper.
[wine/multimedia.git] / dlls / d3d10 / effect.c
blob0f36161b5eab4d0225fbbb20d132e6860a81de35
1 /*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
3 * Copyright 2009 Rico Schüller
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "config.h"
22 #include "wine/port.h"
24 #include "d3d10_private.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
28 #define D3D10_FX10_TYPE_COLUMN_SHIFT 11
29 #define D3D10_FX10_TYPE_COLUMN_MASK (0x7 << D3D10_FX10_TYPE_COLUMN_SHIFT)
31 #define D3D10_FX10_TYPE_ROW_SHIFT 8
32 #define D3D10_FX10_TYPE_ROW_MASK (0x7 << D3D10_FX10_TYPE_ROW_SHIFT)
34 #define D3D10_FX10_TYPE_BASETYPE_SHIFT 3
35 #define D3D10_FX10_TYPE_BASETYPE_MASK (0x1f << D3D10_FX10_TYPE_BASETYPE_SHIFT)
37 #define D3D10_FX10_TYPE_CLASS_SHIFT 0
38 #define D3D10_FX10_TYPE_CLASS_MASK (0x7 << D3D10_FX10_TYPE_CLASS_SHIFT)
40 #define D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK 0x4000
42 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl;
43 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl;
44 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl;
45 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl;
46 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl;
47 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl;
48 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl;
49 static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl;
50 static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl;
51 static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl;
52 static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl;
53 static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl;
54 static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl;
55 static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl;
56 static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl;
57 static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl;
58 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl;
60 /* null objects - needed for invalid calls */
61 static struct d3d10_effect_technique null_technique = {{&d3d10_effect_technique_vtbl}};
62 static struct d3d10_effect_pass null_pass = {{&d3d10_effect_pass_vtbl}};
63 static struct d3d10_effect_type null_type = {{&d3d10_effect_type_vtbl}};
64 static struct d3d10_effect_variable null_local_buffer = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl},
65 &null_local_buffer, &null_type};
66 static struct d3d10_effect_variable null_variable = {{&d3d10_effect_variable_vtbl},
67 &null_local_buffer, &null_type};
68 static struct d3d10_effect_variable null_scalar_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl},
69 &null_local_buffer, &null_type};
70 static struct d3d10_effect_variable null_vector_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl},
71 &null_local_buffer, &null_type};
72 static struct d3d10_effect_variable null_matrix_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl},
73 &null_local_buffer, &null_type};
74 static struct d3d10_effect_variable null_string_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl},
75 &null_local_buffer, &null_type};
76 static struct d3d10_effect_variable null_shader_resource_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl},
77 &null_local_buffer, &null_type};
78 static struct d3d10_effect_variable null_render_target_view_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl},
79 &null_local_buffer, &null_type};
80 static struct d3d10_effect_variable null_depth_stencil_view_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl},
81 &null_local_buffer, &null_type};
82 static struct d3d10_effect_variable null_shader_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
83 &null_local_buffer, &null_type};
84 static struct d3d10_effect_variable null_blend_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl},
85 &null_local_buffer, &null_type};
86 static struct d3d10_effect_variable null_depth_stencil_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl},
87 &null_local_buffer, &null_type};
88 static struct d3d10_effect_variable null_rasterizer_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl},
89 &null_local_buffer, &null_type};
90 static struct d3d10_effect_variable null_sampler_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl},
91 &null_local_buffer, &null_type};
93 /* anonymous_shader_type and anonymous_shader */
94 static char anonymous_name[] = "$Anonymous";
95 static char anonymous_vertexshader_name[] = "vertexshader";
96 static char anonymous_pixelshader_name[] = "pixelshader";
97 static char anonymous_geometryshader_name[] = "geometryshader";
98 static struct d3d10_effect_type anonymous_vs_type = {{&d3d10_effect_type_vtbl},
99 anonymous_vertexshader_name, D3D10_SVT_VERTEXSHADER, D3D10_SVC_OBJECT};
100 static struct d3d10_effect_type anonymous_ps_type = {{&d3d10_effect_type_vtbl},
101 anonymous_pixelshader_name, D3D10_SVT_PIXELSHADER, D3D10_SVC_OBJECT};
102 static struct d3d10_effect_type anonymous_gs_type = {{&d3d10_effect_type_vtbl},
103 anonymous_geometryshader_name, D3D10_SVT_GEOMETRYSHADER, D3D10_SVC_OBJECT};
104 static struct d3d10_effect_variable anonymous_vs = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
105 &null_local_buffer, &anonymous_vs_type, &null_shader_variable, anonymous_name};
106 static struct d3d10_effect_variable anonymous_ps = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
107 &null_local_buffer, &anonymous_ps_type, &null_shader_variable, anonymous_name};
108 static struct d3d10_effect_variable anonymous_gs = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
109 &null_local_buffer, &anonymous_gs_type, &null_shader_variable, anonymous_name};
111 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset);
113 static inline struct d3d10_effect_variable *impl_from_ID3D10EffectVariable(ID3D10EffectVariable *iface)
115 return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
118 static BOOL copy_name(const char *ptr, char **name)
120 size_t name_len;
122 if (!ptr) return TRUE;
124 name_len = strlen(ptr) + 1;
125 if (name_len == 1)
127 return TRUE;
130 *name = HeapAlloc(GetProcessHeap(), 0, name_len);
131 if (!*name)
133 ERR("Failed to allocate name memory.\n");
134 return FALSE;
137 memcpy(*name, ptr, name_len);
139 return TRUE;
142 static HRESULT shader_parse_signature(const char *data, DWORD data_size, struct d3d10_effect_shader_signature *s)
144 D3D10_SIGNATURE_PARAMETER_DESC *e;
145 const char *ptr = data;
146 unsigned int i;
147 DWORD count;
149 read_dword(&ptr, &count);
150 TRACE("%u elements\n", count);
152 skip_dword_unknown("shader signature", &ptr, 1);
154 e = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*e));
155 if (!e)
157 ERR("Failed to allocate signature memory.\n");
158 return E_OUTOFMEMORY;
161 for (i = 0; i < count; ++i)
163 UINT name_offset;
164 UINT mask;
166 read_dword(&ptr, &name_offset);
167 e[i].SemanticName = data + name_offset;
168 read_dword(&ptr, &e[i].SemanticIndex);
169 read_dword(&ptr, &e[i].SystemValueType);
170 read_dword(&ptr, &e[i].ComponentType);
171 read_dword(&ptr, &e[i].Register);
172 read_dword(&ptr, &mask);
174 e[i].ReadWriteMask = mask >> 8;
175 e[i].Mask = mask & 0xff;
177 TRACE("semantic: %s, semantic idx: %u, sysval_semantic %#x, "
178 "type %u, register idx: %u, use_mask %#x, input_mask %#x\n",
179 debugstr_a(e[i].SemanticName), e[i].SemanticIndex, e[i].SystemValueType,
180 e[i].ComponentType, e[i].Register, e[i].Mask, e[i].ReadWriteMask);
183 s->elements = e;
184 s->element_count = count;
186 return S_OK;
189 static void shader_free_signature(struct d3d10_effect_shader_signature *s)
191 HeapFree(GetProcessHeap(), 0, s->signature);
192 HeapFree(GetProcessHeap(), 0, s->elements);
195 static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
197 struct d3d10_effect_shader_variable *s = ctx;
198 HRESULT hr;
200 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
202 TRACE("chunk size: %#x\n", data_size);
204 switch(tag)
206 case TAG_ISGN:
207 case TAG_OSGN:
209 /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */
210 UINT size = 44 + data_size;
211 struct d3d10_effect_shader_signature *sig;
212 char *ptr;
214 if (tag == TAG_ISGN) sig = &s->input_signature;
215 else sig = &s->output_signature;
217 sig->signature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
218 if (!sig->signature)
220 ERR("Failed to allocate input signature data\n");
221 return E_OUTOFMEMORY;
223 sig->signature_size = size;
225 ptr = sig->signature;
227 write_dword(&ptr, TAG_DXBC);
229 /* signature(?) */
230 write_dword_unknown(&ptr, 0);
231 write_dword_unknown(&ptr, 0);
232 write_dword_unknown(&ptr, 0);
233 write_dword_unknown(&ptr, 0);
235 /* seems to be always 1 */
236 write_dword_unknown(&ptr, 1);
238 /* DXBC size */
239 write_dword(&ptr, size);
241 /* chunk count */
242 write_dword(&ptr, 1);
244 /* chunk index */
245 write_dword(&ptr, (ptr - sig->signature) + 4);
247 /* chunk */
248 write_dword(&ptr, tag);
249 write_dword(&ptr, data_size);
250 memcpy(ptr, data, data_size);
252 hr = shader_parse_signature(ptr, data_size, sig);
253 if (FAILED(hr))
255 ERR("Failed to parse shader, hr %#x\n", hr);
256 shader_free_signature(sig);
259 break;
262 default:
263 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
264 break;
267 return S_OK;
270 static HRESULT parse_shader(struct d3d10_effect_variable *v, const char *data)
272 ID3D10Device *device = v->effect->device;
273 struct d3d10_effect_shader_variable *s;
274 const char *ptr = data;
275 DWORD dxbc_size;
276 HRESULT hr;
278 s = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*s));
279 if (!s)
281 ERR("Failed to allocate shader variable memory\n");
282 return E_OUTOFMEMORY;
285 v->data = s;
287 if (v->effect->used_shader_current >= v->effect->used_shader_count)
289 WARN("Invalid shader? Used shader current(%u) >= used shader count(%u)\n", v->effect->used_shader_current, v->effect->used_shader_count);
290 return E_FAIL;
293 v->effect->used_shaders[v->effect->used_shader_current] = v;
294 ++v->effect->used_shader_current;
296 if (!ptr) return S_OK;
298 read_dword(&ptr, &dxbc_size);
299 TRACE("dxbc size: %#x\n", dxbc_size);
301 /* We got a shader VertexShader vs = NULL, so it is fine to skip this. */
302 if (!dxbc_size) return S_OK;
304 switch (v->type->basetype)
306 case D3D10_SVT_VERTEXSHADER:
307 hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &s->shader.vs);
308 if (FAILED(hr)) return hr;
309 break;
311 case D3D10_SVT_PIXELSHADER:
312 hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &s->shader.ps);
313 if (FAILED(hr)) return hr;
314 break;
316 case D3D10_SVT_GEOMETRYSHADER:
317 hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &s->shader.gs);
318 if (FAILED(hr)) return hr;
319 break;
321 default:
322 ERR("This should not happen!\n");
323 return E_FAIL;
326 return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, s);
329 static D3D10_SHADER_VARIABLE_CLASS d3d10_variable_class(DWORD c, BOOL is_column_major)
331 switch (c)
333 case 1: return D3D10_SVC_SCALAR;
334 case 2: return D3D10_SVC_VECTOR;
335 case 3: if (is_column_major) return D3D10_SVC_MATRIX_COLUMNS;
336 else return D3D10_SVC_MATRIX_ROWS;
337 default:
338 FIXME("Unknown variable class %#x.\n", c);
339 return 0;
343 static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(DWORD t, BOOL is_object)
345 if(is_object)
347 switch (t)
349 case 1: return D3D10_SVT_STRING;
350 case 2: return D3D10_SVT_BLEND;
351 case 3: return D3D10_SVT_DEPTHSTENCIL;
352 case 4: return D3D10_SVT_RASTERIZER;
353 case 5: return D3D10_SVT_PIXELSHADER;
354 case 6: return D3D10_SVT_VERTEXSHADER;
355 case 7: return D3D10_SVT_GEOMETRYSHADER;
357 case 10: return D3D10_SVT_TEXTURE1D;
358 case 11: return D3D10_SVT_TEXTURE1DARRAY;
359 case 12: return D3D10_SVT_TEXTURE2D;
360 case 13: return D3D10_SVT_TEXTURE2DARRAY;
361 case 14: return D3D10_SVT_TEXTURE2DMS;
362 case 15: return D3D10_SVT_TEXTURE2DMSARRAY;
363 case 16: return D3D10_SVT_TEXTURE3D;
364 case 17: return D3D10_SVT_TEXTURECUBE;
366 case 19: return D3D10_SVT_RENDERTARGETVIEW;
367 case 20: return D3D10_SVT_DEPTHSTENCILVIEW;
368 case 21: return D3D10_SVT_SAMPLER;
369 case 22: return D3D10_SVT_BUFFER;
370 default:
371 FIXME("Unknown variable type %#x.\n", t);
372 return D3D10_SVT_VOID;
375 else
377 switch (t)
379 case 1: return D3D10_SVT_FLOAT;
380 case 2: return D3D10_SVT_INT;
381 case 3: return D3D10_SVT_UINT;
382 case 4: return D3D10_SVT_BOOL;
383 default:
384 FIXME("Unknown variable type %#x.\n", t);
385 return D3D10_SVT_VOID;
390 static HRESULT parse_fx10_type(struct d3d10_effect_type *t, const char *ptr, const char *data)
392 DWORD unknown0;
393 DWORD offset;
394 DWORD typeinfo;
395 unsigned int i;
397 read_dword(&ptr, &offset);
398 TRACE("Type name at offset %#x.\n", offset);
400 if (!copy_name(data + offset, &t->name))
402 ERR("Failed to copy name.\n");
403 return E_OUTOFMEMORY;
405 TRACE("Type name: %s.\n", debugstr_a(t->name));
407 read_dword(&ptr, &unknown0);
408 TRACE("Unknown 0: %u.\n", unknown0);
410 read_dword(&ptr, &t->element_count);
411 TRACE("Element count: %u.\n", t->element_count);
413 read_dword(&ptr, &t->size_unpacked);
414 TRACE("Unpacked size: %#x.\n", t->size_unpacked);
416 read_dword(&ptr, &t->stride);
417 TRACE("Stride: %#x.\n", t->stride);
419 read_dword(&ptr, &t->size_packed);
420 TRACE("Packed size %#x.\n", t->size_packed);
422 switch (unknown0)
424 case 1:
425 t->member_count = 0;
427 read_dword(&ptr, &typeinfo);
428 t->column_count = (typeinfo & D3D10_FX10_TYPE_COLUMN_MASK) >> D3D10_FX10_TYPE_COLUMN_SHIFT;
429 t->row_count = (typeinfo & D3D10_FX10_TYPE_ROW_MASK) >> D3D10_FX10_TYPE_ROW_SHIFT;
430 t->basetype = d3d10_variable_type((typeinfo & D3D10_FX10_TYPE_BASETYPE_MASK) >> D3D10_FX10_TYPE_BASETYPE_SHIFT, FALSE);
431 t->type_class = d3d10_variable_class((typeinfo & D3D10_FX10_TYPE_CLASS_MASK) >> D3D10_FX10_TYPE_CLASS_SHIFT, typeinfo & D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK);
433 TRACE("Type description: %#x.\n", typeinfo);
434 TRACE("\tcolumns: %u.\n", t->column_count);
435 TRACE("\trows: %u.\n", t->row_count);
436 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
437 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
438 TRACE("\tunknown bits: %#x.\n", typeinfo & ~(D3D10_FX10_TYPE_COLUMN_MASK | D3D10_FX10_TYPE_ROW_MASK
439 | D3D10_FX10_TYPE_BASETYPE_MASK | D3D10_FX10_TYPE_CLASS_MASK | D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK));
440 break;
442 case 2:
443 TRACE("Type is an object.\n");
445 t->member_count = 0;
446 t->column_count = 0;
447 t->row_count = 0;
448 t->type_class = D3D10_SVC_OBJECT;
450 read_dword(&ptr, &typeinfo);
451 t->basetype = d3d10_variable_type(typeinfo, TRUE);
453 TRACE("Type description: %#x.\n", typeinfo);
454 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
455 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
456 break;
458 case 3:
459 TRACE("Type is a structure.\n");
461 read_dword(&ptr, &t->member_count);
462 TRACE("Member count: %u.\n", t->member_count);
464 t->column_count = 0;
465 t->row_count = 0;
466 t->basetype = 0;
467 t->type_class = D3D10_SVC_STRUCT;
469 t->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->member_count * sizeof(*t->members));
470 if (!t->members)
472 ERR("Failed to allocate members memory.\n");
473 return E_OUTOFMEMORY;
476 for (i = 0; i < t->member_count; ++i)
478 struct d3d10_effect_type_member *typem = &t->members[i];
480 read_dword(&ptr, &offset);
481 TRACE("Member name at offset %#x.\n", offset);
483 if (!copy_name(data + offset, &typem->name))
485 ERR("Failed to copy name.\n");
486 return E_OUTOFMEMORY;
488 TRACE("Member name: %s.\n", debugstr_a(typem->name));
490 read_dword(&ptr, &offset);
491 TRACE("Member semantic at offset %#x.\n", offset);
493 if (!copy_name(data + offset, &typem->semantic))
495 ERR("Failed to copy semantic.\n");
496 return E_OUTOFMEMORY;
498 TRACE("Member semantic: %s.\n", debugstr_a(typem->semantic));
500 read_dword(&ptr, &typem->buffer_offset);
501 TRACE("Member offset in struct: %#x.\n", typem->buffer_offset);
503 read_dword(&ptr, &offset);
504 TRACE("Member type info at offset %#x.\n", offset);
506 typem->type = get_fx10_type(t->effect, data, offset);
507 if (!typem->type)
509 ERR("Failed to get variable type.\n");
510 return E_FAIL;
513 break;
515 default:
516 FIXME("Unhandled case %#x.\n", unknown0);
517 return E_FAIL;
520 if (t->element_count)
522 TRACE("Elementtype for type at offset: %#x\n", t->id);
524 /* allocate elementtype - we need only one, because all elements have the same type */
525 t->elementtype = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*t->elementtype));
526 if (!t->elementtype)
528 ERR("Failed to allocate members memory.\n");
529 return E_OUTOFMEMORY;
532 /* create a copy of the original type with some minor changes */
533 t->elementtype->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
534 t->elementtype->effect = t->effect;
536 if (!copy_name(t->name, &t->elementtype->name))
538 ERR("Failed to copy name.\n");
539 return E_OUTOFMEMORY;
541 TRACE("\tType name: %s.\n", debugstr_a(t->elementtype->name));
543 t->elementtype->element_count = 0;
544 TRACE("\tElement count: %u.\n", t->elementtype->element_count);
547 * Not sure if this calculation is 100% correct, but a test
548 * shows that these values work.
550 t->elementtype->size_unpacked = t->size_packed / t->element_count;
551 TRACE("\tUnpacked size: %#x.\n", t->elementtype->size_unpacked);
553 t->elementtype->stride = t->stride;
554 TRACE("\tStride: %#x.\n", t->elementtype->stride);
556 t->elementtype->size_packed = t->size_packed / t->element_count;
557 TRACE("\tPacked size: %#x.\n", t->elementtype->size_packed);
559 t->elementtype->member_count = t->member_count;
560 TRACE("\tMember count: %u.\n", t->elementtype->member_count);
562 t->elementtype->column_count = t->column_count;
563 TRACE("\tColumns: %u.\n", t->elementtype->column_count);
565 t->elementtype->row_count = t->row_count;
566 TRACE("\tRows: %u.\n", t->elementtype->row_count);
568 t->elementtype->basetype = t->basetype;
569 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(t->elementtype->basetype));
571 t->elementtype->type_class = t->type_class;
572 TRACE("\tClass: %s.\n", debug_d3d10_shader_variable_class(t->elementtype->type_class));
574 t->elementtype->members = t->members;
577 return S_OK;
580 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset)
582 struct d3d10_effect_type *type;
583 struct wine_rb_entry *entry;
584 HRESULT hr;
586 entry = wine_rb_get(&effect->types, &offset);
587 if (entry)
589 TRACE("Returning existing type.\n");
590 return WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
593 type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*type));
594 if (!type)
596 ERR("Failed to allocate type memory.\n");
597 return NULL;
600 type->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
601 type->id = offset;
602 type->effect = effect;
603 hr = parse_fx10_type(type, data + offset, data);
604 if (FAILED(hr))
606 ERR("Failed to parse type info, hr %#x.\n", hr);
607 HeapFree(GetProcessHeap(), 0, type);
608 return NULL;
611 if (wine_rb_put(&effect->types, &offset, &type->entry) == -1)
613 ERR("Failed to insert type entry.\n");
614 HeapFree(GetProcessHeap(), 0, type);
615 return NULL;
618 return type;
621 static void set_variable_vtbl(struct d3d10_effect_variable *v)
623 const ID3D10EffectVariableVtbl **vtbl = &v->ID3D10EffectVariable_iface.lpVtbl;
625 switch (v->type->type_class)
627 case D3D10_SVC_SCALAR:
628 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl;
629 break;
631 case D3D10_SVC_VECTOR:
632 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl;
633 break;
635 case D3D10_SVC_MATRIX_ROWS:
636 case D3D10_SVC_MATRIX_COLUMNS:
637 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl;
638 break;
640 case D3D10_SVC_STRUCT:
641 *vtbl = &d3d10_effect_variable_vtbl;
642 break;
644 case D3D10_SVC_OBJECT:
645 switch(v->type->basetype)
647 case D3D10_SVT_STRING:
648 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl;
649 break;
651 case D3D10_SVT_TEXTURE1D:
652 case D3D10_SVT_TEXTURE1DARRAY:
653 case D3D10_SVT_TEXTURE2D:
654 case D3D10_SVT_TEXTURE2DARRAY:
655 case D3D10_SVT_TEXTURE2DMS:
656 case D3D10_SVT_TEXTURE2DMSARRAY:
657 case D3D10_SVT_TEXTURE3D:
658 case D3D10_SVT_TEXTURECUBE:
659 case D3D10_SVT_BUFFER: /* Either resource or constant buffer. */
660 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl;
661 break;
663 case D3D10_SVT_RENDERTARGETVIEW:
664 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl;
665 break;
667 case D3D10_SVT_DEPTHSTENCILVIEW:
668 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl;
669 break;
671 case D3D10_SVT_DEPTHSTENCIL:
672 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl;
673 break;
675 case D3D10_SVT_VERTEXSHADER:
676 case D3D10_SVT_GEOMETRYSHADER:
677 case D3D10_SVT_PIXELSHADER:
678 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl;
679 break;
681 case D3D10_SVT_BLEND:
682 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl;
683 break;
685 case D3D10_SVT_RASTERIZER:
686 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl;
687 break;
689 case D3D10_SVT_SAMPLER:
690 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl;
691 break;
693 default:
694 FIXME("Unhandled basetype %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
695 *vtbl = &d3d10_effect_variable_vtbl;
696 break;
698 break;
700 default:
701 FIXME("Unhandled type class %s.\n", debug_d3d10_shader_variable_class(v->type->type_class));
702 *vtbl = &d3d10_effect_variable_vtbl;
703 break;
707 static HRESULT copy_variableinfo_from_type(struct d3d10_effect_variable *v)
709 unsigned int i;
710 HRESULT hr;
712 if (v->type->member_count)
714 v->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->member_count * sizeof(*v->members));
715 if (!v->members)
717 ERR("Failed to allocate members memory.\n");
718 return E_OUTOFMEMORY;
721 for (i = 0; i < v->type->member_count; ++i)
723 struct d3d10_effect_variable *var = &v->members[i];
724 struct d3d10_effect_type_member *typem = &v->type->members[i];
726 var->buffer = v->buffer;
727 var->effect = v->effect;
728 var->type = typem->type;
729 set_variable_vtbl(var);
731 if (!copy_name(typem->name, &var->name))
733 ERR("Failed to copy name.\n");
734 return E_OUTOFMEMORY;
736 TRACE("Variable name: %s.\n", debugstr_a(var->name));
738 if (!copy_name(typem->semantic, &var->semantic))
740 ERR("Failed to copy name.\n");
741 return E_OUTOFMEMORY;
743 TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
745 var->buffer_offset = v->buffer_offset + typem->buffer_offset;
746 TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
748 hr = copy_variableinfo_from_type(var);
749 if (FAILED(hr)) return hr;
753 if (v->type->element_count)
755 unsigned int bufferoffset = v->buffer_offset;
757 v->elements = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->element_count * sizeof(*v->elements));
758 if (!v->elements)
760 ERR("Failed to allocate elements memory.\n");
761 return E_OUTOFMEMORY;
764 for (i = 0; i < v->type->element_count; ++i)
766 struct d3d10_effect_variable *var = &v->elements[i];
768 var->buffer = v->buffer;
769 var->effect = v->effect;
770 var->type = v->type->elementtype;
771 set_variable_vtbl(var);
773 if (!copy_name(v->name, &var->name))
775 ERR("Failed to copy name.\n");
776 return E_OUTOFMEMORY;
778 TRACE("Variable name: %s.\n", debugstr_a(var->name));
780 if (!copy_name(v->semantic, &var->semantic))
782 ERR("Failed to copy name.\n");
783 return E_OUTOFMEMORY;
785 TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
787 if (i != 0)
789 bufferoffset += v->type->stride;
791 var->buffer_offset = bufferoffset;
792 TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
794 hr = copy_variableinfo_from_type(var);
795 if (FAILED(hr)) return hr;
799 return S_OK;
802 static HRESULT parse_fx10_variable_head(struct d3d10_effect_variable *v, const char **ptr, const char *data)
804 DWORD offset;
806 read_dword(ptr, &offset);
807 TRACE("Variable name at offset %#x.\n", offset);
809 if (!copy_name(data + offset, &v->name))
811 ERR("Failed to copy name.\n");
812 return E_OUTOFMEMORY;
814 TRACE("Variable name: %s.\n", debugstr_a(v->name));
816 read_dword(ptr, &offset);
817 TRACE("Variable type info at offset %#x.\n", offset);
819 v->type = get_fx10_type(v->effect, data, offset);
820 if (!v->type)
822 ERR("Failed to get variable type.\n");
823 return E_FAIL;
825 set_variable_vtbl(v);
827 return copy_variableinfo_from_type(v);
830 static HRESULT parse_fx10_annotation(struct d3d10_effect_variable *a, const char **ptr, const char *data)
832 HRESULT hr;
834 hr = parse_fx10_variable_head(a, ptr, data);
835 if (FAILED(hr)) return hr;
837 skip_dword_unknown("annotation", ptr, 1);
839 /* mark the variable as annotation */
840 a->flag = D3D10_EFFECT_VARIABLE_ANNOTATION;
842 return S_OK;
845 static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, struct d3d10_effect_anonymous_shader *s,
846 enum d3d10_effect_object_type otype)
848 struct d3d10_effect_variable *v = &s->shader;
849 struct d3d10_effect_type *t = &s->type;
850 const char *shader = NULL;
852 switch (otype)
854 case D3D10_EOT_VERTEXSHADER:
855 shader = "vertexshader";
856 t->basetype = D3D10_SVT_VERTEXSHADER;
857 break;
859 case D3D10_EOT_PIXELSHADER:
860 shader = "pixelshader";
861 t->basetype = D3D10_SVT_PIXELSHADER;
862 break;
864 case D3D10_EOT_GEOMETRYSHADER:
865 shader = "geometryshader";
866 t->basetype = D3D10_SVT_GEOMETRYSHADER;
867 break;
869 default:
870 FIXME("Unhandled object type %#x.\n", otype);
871 return E_FAIL;
874 if (!copy_name(shader, &t->name))
876 ERR("Failed to copy name.\n");
877 return E_OUTOFMEMORY;
879 TRACE("Type name: %s.\n", debugstr_a(t->name));
881 t->type_class = D3D10_SVC_OBJECT;
883 t->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
885 v->type = t;
886 v->effect = e;
887 set_variable_vtbl(v);
889 if (!copy_name("$Anonymous", &v->name))
891 ERR("Failed to copy semantic.\n");
892 return E_OUTOFMEMORY;
894 TRACE("Variable name: %s.\n", debugstr_a(v->name));
896 if (!copy_name(NULL, &v->semantic))
898 ERR("Failed to copy semantic.\n");
899 return E_OUTOFMEMORY;
901 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
903 return S_OK;
906 static BOOL read_float_value(DWORD value, D3D_SHADER_VARIABLE_TYPE in_type, float *out_data, UINT idx)
908 switch (in_type)
910 case D3D10_SVT_FLOAT:
911 out_data[idx] = *(float *)&value;
912 return TRUE;
914 default:
915 FIXME("Unhandled in_type %#x.\n", in_type);
916 return FALSE;
920 static BOOL read_int32_value(DWORD value, D3D_SHADER_VARIABLE_TYPE in_type, INT *out_data, UINT idx)
922 switch (in_type)
924 case D3D10_SVT_FLOAT:
925 out_data[idx] = *(float *)&value;
926 return TRUE;
928 case D3D10_SVT_INT:
929 out_data[idx] = value;
930 return TRUE;
932 default:
933 FIXME("Unhandled in_type %#x.\n", in_type);
934 return FALSE;
938 static BOOL read_value_list(const char *ptr, D3D_SHADER_VARIABLE_TYPE out_type,
939 UINT out_size, void *out_data)
941 D3D_SHADER_VARIABLE_TYPE in_type;
942 DWORD t, value;
943 DWORD count, i;
945 read_dword(&ptr, &count);
946 if (count != out_size)
947 return FALSE;
949 TRACE("%u values:\n", count);
950 for (i = 0; i < count; ++i)
952 read_dword(&ptr, &t);
953 read_dword(&ptr, &value);
955 in_type = d3d10_variable_type(t, FALSE);
956 TRACE("\t%s: %#x.\n", debug_d3d10_shader_variable_type(in_type), value);
958 switch (out_type)
960 case D3D10_SVT_FLOAT:
961 if (!read_float_value(value, in_type, out_data, i))
962 return FALSE;
963 break;
965 case D3D10_SVT_UINT:
966 if (!read_int32_value(value, in_type, out_data, i))
967 return FALSE;
968 break;
970 default:
971 FIXME("Unhandled out_type %#x.\n", out_type);
972 return FALSE;
976 return TRUE;
979 static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr, const char *data)
981 const char *data_ptr = NULL;
982 DWORD offset;
983 enum d3d10_effect_object_operation operation;
984 HRESULT hr;
985 struct d3d10_effect *effect = o->pass->technique->effect;
986 ID3D10Effect *e = &effect->ID3D10Effect_iface;
988 read_dword(ptr, &o->type);
989 TRACE("Effect object is of type %#x.\n", o->type);
991 read_dword(ptr, &o->index);
992 TRACE("Effect object index %#x.\n", o->index);
994 read_dword(ptr, &operation);
995 TRACE("Effect object operation %#x.\n", operation);
997 read_dword(ptr, &offset);
998 TRACE("Effect object idx is at offset %#x.\n", offset);
1000 switch(operation)
1002 case D3D10_EOO_VALUE:
1003 TRACE("Copy variable values\n");
1005 switch (o->type)
1007 case D3D10_EOT_VERTEXSHADER:
1008 TRACE("Vertex shader\n");
1009 o->data = &anonymous_vs;
1010 hr = S_OK;
1011 break;
1013 case D3D10_EOT_PIXELSHADER:
1014 TRACE("Pixel shader\n");
1015 o->data = &anonymous_ps;
1016 hr = S_OK;
1017 break;
1019 case D3D10_EOT_GEOMETRYSHADER:
1020 TRACE("Geometry shader\n");
1021 o->data = &anonymous_gs;
1022 hr = S_OK;
1023 break;
1025 case D3D10_EOT_STENCIL_REF:
1026 if (!read_value_list(data + offset, D3D10_SVT_UINT, 1, &o->pass->stencil_ref))
1028 ERR("Failed to read stencil ref.\n");
1029 return E_FAIL;
1032 hr = S_OK;
1033 break;
1035 case D3D10_EOT_SAMPLE_MASK:
1036 if (!read_value_list(data + offset, D3D10_SVT_UINT, 1, &o->pass->sample_mask))
1038 FIXME("Failed to read sample mask.\n");
1039 return E_FAIL;
1042 hr = S_OK;
1043 break;
1045 case D3D10_EOT_BLEND_FACTOR:
1046 if (!read_value_list(data + offset, D3D10_SVT_FLOAT, 4, &o->pass->blend_factor[0]))
1048 FIXME("Failed to read blend factor.\n");
1049 return E_FAIL;
1052 hr = S_OK;
1053 break;
1055 default:
1056 FIXME("Unhandled object type %#x\n", o->type);
1057 hr = E_FAIL;
1058 break;
1060 break;
1062 case D3D10_EOO_PARSED_OBJECT:
1063 /* This is a local object, we've parsed in parse_fx10_local_object. */
1064 TRACE("Shader = %s.\n", data + offset);
1066 o->data = e->lpVtbl->GetVariableByName(e, data + offset);
1067 hr = S_OK;
1068 break;
1070 case D3D10_EOO_PARSED_OBJECT_INDEX:
1071 /* This is a local object, we've parsed in parse_fx10_local_object, which has an array index. */
1072 data_ptr = data + offset;
1073 read_dword(&data_ptr, &offset);
1074 read_dword(&data_ptr, &o->index);
1075 TRACE("Shader = %s[%u].\n", data + offset, o->index);
1077 o->data = e->lpVtbl->GetVariableByName(e, data + offset);
1078 hr = S_OK;
1079 break;
1081 case D3D10_EOO_ANONYMOUS_SHADER:
1082 TRACE("Anonymous shader\n");
1084 /* check anonymous_shader_current for validity */
1085 if (effect->anonymous_shader_current >= effect->anonymous_shader_count)
1087 ERR("Anonymous shader count is wrong!\n");
1088 return E_FAIL;
1091 data_ptr = data + offset;
1092 read_dword(&data_ptr, &offset);
1093 TRACE("Effect object starts at offset %#x.\n", offset);
1095 data_ptr = data + offset;
1097 hr = parse_fx10_anonymous_shader(effect, &effect->anonymous_shaders[effect->anonymous_shader_current], o->type);
1098 if (FAILED(hr)) return hr;
1100 o->data = &effect->anonymous_shaders[effect->anonymous_shader_current].shader;
1101 ++effect->anonymous_shader_current;
1103 switch (o->type)
1105 case D3D10_EOT_VERTEXSHADER:
1106 TRACE("Vertex shader\n");
1107 hr = parse_shader(o->data, data_ptr);
1108 break;
1110 case D3D10_EOT_PIXELSHADER:
1111 TRACE("Pixel shader\n");
1112 hr = parse_shader(o->data, data_ptr);
1113 break;
1115 case D3D10_EOT_GEOMETRYSHADER:
1116 TRACE("Geometry shader\n");
1117 hr = parse_shader(o->data, data_ptr);
1118 break;
1120 default:
1121 FIXME("Unhandled object type %#x\n", o->type);
1122 hr = E_FAIL;
1123 break;
1125 break;
1127 default:
1128 hr = E_FAIL;
1129 FIXME("Unhandled operation %#x.\n", operation);
1130 break;
1133 return hr;
1136 static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, const char *data)
1138 HRESULT hr = S_OK;
1139 unsigned int i;
1140 DWORD offset;
1142 read_dword(ptr, &offset);
1143 TRACE("Pass name at offset %#x.\n", offset);
1145 if (!copy_name(data + offset, &p->name))
1147 ERR("Failed to copy name.\n");
1148 return E_OUTOFMEMORY;
1150 TRACE("Pass name: %s.\n", debugstr_a(p->name));
1152 read_dword(ptr, &p->object_count);
1153 TRACE("Pass has %u effect objects.\n", p->object_count);
1155 read_dword(ptr, &p->annotation_count);
1156 TRACE("Pass has %u annotations.\n", p->annotation_count);
1158 p->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->annotation_count * sizeof(*p->annotations));
1159 if (!p->annotations)
1161 ERR("Failed to allocate pass annotations memory.\n");
1162 return E_OUTOFMEMORY;
1165 for (i = 0; i < p->annotation_count; ++i)
1167 struct d3d10_effect_variable *a = &p->annotations[i];
1169 a->effect = p->technique->effect;
1170 a->buffer = &null_local_buffer;
1172 hr = parse_fx10_annotation(a, ptr, data);
1173 if (FAILED(hr)) return hr;
1176 p->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->object_count * sizeof(*p->objects));
1177 if (!p->objects)
1179 ERR("Failed to allocate effect objects memory.\n");
1180 return E_OUTOFMEMORY;
1183 for (i = 0; i < p->object_count; ++i)
1185 struct d3d10_effect_object *o = &p->objects[i];
1187 o->pass = p;
1189 hr = parse_fx10_object(o, ptr, data);
1190 if (FAILED(hr)) return hr;
1193 return hr;
1196 static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char **ptr, const char *data)
1198 unsigned int i;
1199 DWORD offset;
1200 HRESULT hr;
1202 read_dword(ptr, &offset);
1203 TRACE("Technique name at offset %#x.\n", offset);
1205 if (!copy_name(data + offset, &t->name))
1207 ERR("Failed to copy name.\n");
1208 return E_OUTOFMEMORY;
1210 TRACE("Technique name: %s.\n", debugstr_a(t->name));
1212 read_dword(ptr, &t->pass_count);
1213 TRACE("Technique has %u passes\n", t->pass_count);
1215 read_dword(ptr, &t->annotation_count);
1216 TRACE("Technique has %u annotations.\n", t->annotation_count);
1218 t->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->annotation_count * sizeof(*t->annotations));
1219 if (!t->annotations)
1221 ERR("Failed to allocate technique annotations memory.\n");
1222 return E_OUTOFMEMORY;
1225 for (i = 0; i < t->annotation_count; ++i)
1227 struct d3d10_effect_variable *a = &t->annotations[i];
1229 a->effect = t->effect;
1230 a->buffer = &null_local_buffer;
1232 hr = parse_fx10_annotation(a, ptr, data);
1233 if (FAILED(hr)) return hr;
1236 t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes));
1237 if (!t->passes)
1239 ERR("Failed to allocate passes memory\n");
1240 return E_OUTOFMEMORY;
1243 for (i = 0; i < t->pass_count; ++i)
1245 struct d3d10_effect_pass *p = &t->passes[i];
1247 p->ID3D10EffectPass_iface.lpVtbl = &d3d10_effect_pass_vtbl;
1248 p->technique = t;
1250 hr = parse_fx10_pass(p, ptr, data);
1251 if (FAILED(hr)) return hr;
1254 return S_OK;
1257 static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
1259 DWORD offset;
1260 unsigned int i;
1261 HRESULT hr;
1263 hr = parse_fx10_variable_head(v, ptr, data);
1264 if (FAILED(hr)) return hr;
1266 read_dword(ptr, &offset);
1267 TRACE("Variable semantic at offset %#x.\n", offset);
1269 if (!copy_name(data + offset, &v->semantic))
1271 ERR("Failed to copy semantic.\n");
1272 return E_OUTOFMEMORY;
1274 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
1276 read_dword(ptr, &v->buffer_offset);
1277 TRACE("Variable offset in buffer: %#x.\n", v->buffer_offset);
1279 skip_dword_unknown("variable", ptr, 1);
1281 read_dword(ptr, &v->flag);
1282 TRACE("Variable flag: %#x.\n", v->flag);
1284 read_dword(ptr, &v->annotation_count);
1285 TRACE("Variable has %u annotations.\n", v->annotation_count);
1287 v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
1288 if (!v->annotations)
1290 ERR("Failed to allocate variable annotations memory.\n");
1291 return E_OUTOFMEMORY;
1294 for (i = 0; i < v->annotation_count; ++i)
1296 struct d3d10_effect_variable *a = &v->annotations[i];
1298 a->effect = v->effect;
1299 a->buffer = &null_local_buffer;
1301 hr = parse_fx10_annotation(a, ptr, data);
1302 if (FAILED(hr)) return hr;
1305 return S_OK;
1308 static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
1310 unsigned int i;
1311 HRESULT hr;
1312 DWORD offset;
1314 hr = parse_fx10_variable_head(v, ptr, data);
1315 if (FAILED(hr)) return hr;
1317 read_dword(ptr, &offset);
1318 TRACE("Variable semantic at offset %#x.\n", offset);
1320 if (!copy_name(data + offset, &v->semantic))
1322 ERR("Failed to copy semantic.\n");
1323 return E_OUTOFMEMORY;
1325 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
1327 skip_dword_unknown("local variable", ptr, 1);
1329 switch (v->type->basetype)
1331 case D3D10_SVT_TEXTURE1D:
1332 case D3D10_SVT_TEXTURE1DARRAY:
1333 case D3D10_SVT_TEXTURE2D:
1334 case D3D10_SVT_TEXTURE2DARRAY:
1335 case D3D10_SVT_TEXTURE2DMS:
1336 case D3D10_SVT_TEXTURE2DMSARRAY:
1337 case D3D10_SVT_TEXTURE3D:
1338 case D3D10_SVT_TEXTURECUBE:
1339 case D3D10_SVT_RENDERTARGETVIEW:
1340 case D3D10_SVT_DEPTHSTENCILVIEW:
1341 case D3D10_SVT_BUFFER:
1342 TRACE("SVT could not have elements.\n");
1343 break;
1345 case D3D10_SVT_VERTEXSHADER:
1346 case D3D10_SVT_PIXELSHADER:
1347 case D3D10_SVT_GEOMETRYSHADER:
1348 TRACE("Shader type is %s\n", debug_d3d10_shader_variable_type(v->type->basetype));
1349 for (i = 0; i < max(v->type->element_count, 1); ++i)
1351 DWORD shader_offset;
1352 struct d3d10_effect_variable *var;
1354 if (!v->type->element_count)
1356 var = v;
1358 else
1360 var = &v->elements[i];
1363 read_dword(ptr, &shader_offset);
1364 TRACE("Shader offset: %#x.\n", shader_offset);
1366 hr = parse_shader(var, data + shader_offset);
1367 if (FAILED(hr)) return hr;
1369 break;
1371 case D3D10_SVT_DEPTHSTENCIL:
1372 case D3D10_SVT_BLEND:
1373 case D3D10_SVT_RASTERIZER:
1374 case D3D10_SVT_SAMPLER:
1375 TRACE("SVT is a state.\n");
1376 for (i = 0; i < max(v->type->element_count, 1); ++i)
1378 unsigned int j;
1379 DWORD object_count;
1381 read_dword(ptr, &object_count);
1382 TRACE("Object count: %#x.\n", object_count);
1384 for (j = 0; j < object_count; ++j)
1386 skip_dword_unknown("state object attribute", ptr, 4);
1389 break;
1391 default:
1392 FIXME("Unhandled case %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
1393 return E_FAIL;
1396 read_dword(ptr, &v->annotation_count);
1397 TRACE("Variable has %u annotations.\n", v->annotation_count);
1399 v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
1400 if (!v->annotations)
1402 ERR("Failed to allocate variable annotations memory.\n");
1403 return E_OUTOFMEMORY;
1406 for (i = 0; i < v->annotation_count; ++i)
1408 struct d3d10_effect_variable *a = &v->annotations[i];
1410 a->effect = v->effect;
1411 a->buffer = &null_local_buffer;
1413 hr = parse_fx10_annotation(a, ptr, data);
1414 if (FAILED(hr)) return hr;
1417 return S_OK;
1420 static HRESULT parse_fx10_local_buffer(struct d3d10_effect_variable *l, const char **ptr, const char *data)
1422 unsigned int i;
1423 DWORD offset;
1424 D3D10_CBUFFER_TYPE d3d10_cbuffer_type;
1425 HRESULT hr;
1426 unsigned int stride = 0;
1428 /* Generate our own type, it isn't in the fx blob. */
1429 l->type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*l->type));
1430 if (!l->type)
1432 ERR("Failed to allocate local buffer type memory.\n");
1433 return E_OUTOFMEMORY;
1435 l->type->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
1436 l->type->type_class = D3D10_SVC_OBJECT;
1437 l->type->effect = l->effect;
1439 read_dword(ptr, &offset);
1440 TRACE("Local buffer name at offset %#x.\n", offset);
1442 if (!copy_name(data + offset, &l->name))
1444 ERR("Failed to copy name.\n");
1445 return E_OUTOFMEMORY;
1447 TRACE("Local buffer name: %s.\n", debugstr_a(l->name));
1449 read_dword(ptr, &l->data_size);
1450 TRACE("Local buffer data size: %#x.\n", l->data_size);
1452 read_dword(ptr, &d3d10_cbuffer_type);
1453 TRACE("Local buffer type: %#x.\n", d3d10_cbuffer_type);
1455 switch(d3d10_cbuffer_type)
1457 case D3D10_CT_CBUFFER:
1458 l->type->basetype = D3D10_SVT_CBUFFER;
1459 if (!copy_name("cbuffer", &l->type->name))
1461 ERR("Failed to copy name.\n");
1462 return E_OUTOFMEMORY;
1464 break;
1466 case D3D10_CT_TBUFFER:
1467 l->type->basetype = D3D10_SVT_TBUFFER;
1468 if (!copy_name("tbuffer", &l->type->name))
1470 ERR("Failed to copy name.\n");
1471 return E_OUTOFMEMORY;
1473 break;
1475 default:
1476 ERR("Unexpected D3D10_CBUFFER_TYPE %#x!\n", d3d10_cbuffer_type);
1477 return E_FAIL;
1480 read_dword(ptr, &l->type->member_count);
1481 TRACE("Local buffer member count: %#x.\n", l->type->member_count);
1483 skip_dword_unknown("local buffer", ptr, 1);
1485 read_dword(ptr, &l->annotation_count);
1486 TRACE("Local buffer has %u annotations.\n", l->annotation_count);
1488 l->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->annotation_count * sizeof(*l->annotations));
1489 if (!l->annotations)
1491 ERR("Failed to allocate local buffer annotations memory.\n");
1492 return E_OUTOFMEMORY;
1495 for (i = 0; i < l->annotation_count; ++i)
1497 struct d3d10_effect_variable *a = &l->annotations[i];
1499 a->effect = l->effect;
1500 a->buffer = &null_local_buffer;
1502 hr = parse_fx10_annotation(a, ptr, data);
1503 if (FAILED(hr)) return hr;
1506 l->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->members));
1507 if (!l->members)
1509 ERR("Failed to allocate members memory.\n");
1510 return E_OUTOFMEMORY;
1513 l->type->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->type->members));
1514 if (!l->type->members)
1516 ERR("Failed to allocate type members memory.\n");
1517 return E_OUTOFMEMORY;
1520 for (i = 0; i < l->type->member_count; ++i)
1522 struct d3d10_effect_variable *v = &l->members[i];
1523 struct d3d10_effect_type_member *typem = &l->type->members[i];
1525 v->buffer = l;
1526 v->effect = l->effect;
1528 hr = parse_fx10_variable(v, ptr, data);
1529 if (FAILED(hr)) return hr;
1532 * Copy the values from the variable type to the constant buffers type
1533 * members structure, because it is our own generated type.
1535 typem->type = v->type;
1537 if (!copy_name(v->name, &typem->name))
1539 ERR("Failed to copy name.\n");
1540 return E_OUTOFMEMORY;
1542 TRACE("Variable name: %s.\n", debugstr_a(typem->name));
1544 if (!copy_name(v->semantic, &typem->semantic))
1546 ERR("Failed to copy name.\n");
1547 return E_OUTOFMEMORY;
1549 TRACE("Variable semantic: %s.\n", debugstr_a(typem->semantic));
1551 typem->buffer_offset = v->buffer_offset;
1552 TRACE("Variable buffer offset: %u.\n", typem->buffer_offset);
1554 l->type->size_packed += v->type->size_packed;
1557 * For the complete constantbuffer the size_unpacked = stride,
1558 * the stride is calculated like this:
1560 * 1) if the constant buffer variables are packed with packoffset
1561 * - stride = the highest used constant
1562 * - the complete stride has to be a multiple of 0x10
1564 * 2) if the constant buffer variables are NOT packed with packoffset
1565 * - sum of unpacked size for all variables which fit in a 0x10 part
1566 * - if the size exceeds a 0x10 part, the rest of the old part is skipped
1567 * and a new part is started
1568 * - if the variable is a struct it is always used a new part
1569 * - the complete stride has to be a multiple of 0x10
1571 * e.g.:
1572 * 0x4, 0x4, 0x4, 0x8, 0x4, 0x14, 0x4
1573 * part 0x10 0x10 0x20 -> 0x40
1575 if (v->flag & D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT)
1577 if ((v->type->size_unpacked + v->buffer_offset) > stride)
1579 stride = v->type->size_unpacked + v->buffer_offset;
1582 else
1584 if (v->type->type_class == D3D10_SVC_STRUCT)
1586 stride = (stride + 0xf) & ~0xf;
1589 if ( ((stride & 0xf) + v->type->size_unpacked) > 0x10)
1591 stride = (stride + 0xf) & ~0xf;
1594 stride += v->type->size_unpacked;
1597 l->type->stride = l->type->size_unpacked = (stride + 0xf) & ~0xf;
1599 TRACE("Constant buffer:\n");
1600 TRACE("\tType name: %s.\n", debugstr_a(l->type->name));
1601 TRACE("\tElement count: %u.\n", l->type->element_count);
1602 TRACE("\tMember count: %u.\n", l->type->member_count);
1603 TRACE("\tUnpacked size: %#x.\n", l->type->size_unpacked);
1604 TRACE("\tStride: %#x.\n", l->type->stride);
1605 TRACE("\tPacked size %#x.\n", l->type->size_packed);
1606 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l->type->basetype));
1607 TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l->type->type_class));
1609 return S_OK;
1612 static int d3d10_effect_type_compare(const void *key, const struct wine_rb_entry *entry)
1614 const struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, const struct d3d10_effect_type, entry);
1615 const DWORD *id = key;
1617 return *id - t->id;
1620 static void d3d10_effect_type_member_destroy(struct d3d10_effect_type_member *typem)
1622 TRACE("effect type member %p.\n", typem);
1624 /* Do not release typem->type, it will be covered by d3d10_effect_type_destroy(). */
1625 HeapFree(GetProcessHeap(), 0, typem->semantic);
1626 HeapFree(GetProcessHeap(), 0, typem->name);
1629 static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context)
1631 struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
1633 TRACE("effect type %p.\n", t);
1635 if (t->elementtype)
1637 HeapFree(GetProcessHeap(), 0, t->elementtype->name);
1638 HeapFree(GetProcessHeap(), 0, t->elementtype);
1641 if (t->members)
1643 unsigned int i;
1645 for (i = 0; i < t->member_count; ++i)
1647 d3d10_effect_type_member_destroy(&t->members[i]);
1649 HeapFree(GetProcessHeap(), 0, t->members);
1652 HeapFree(GetProcessHeap(), 0, t->name);
1653 HeapFree(GetProcessHeap(), 0, t);
1656 static const struct wine_rb_functions d3d10_effect_type_rb_functions =
1658 d3d10_rb_alloc,
1659 d3d10_rb_realloc,
1660 d3d10_rb_free,
1661 d3d10_effect_type_compare,
1664 static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size)
1666 const char *ptr = data + e->index_offset;
1667 unsigned int i;
1668 HRESULT hr;
1670 if (wine_rb_init(&e->types, &d3d10_effect_type_rb_functions) == -1)
1672 ERR("Failed to initialize type rbtree.\n");
1673 return E_FAIL;
1676 e->local_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_buffer_count * sizeof(*e->local_buffers));
1677 if (!e->local_buffers)
1679 ERR("Failed to allocate local buffer memory.\n");
1680 return E_OUTOFMEMORY;
1683 e->local_variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_variable_count * sizeof(*e->local_variables));
1684 if (!e->local_variables)
1686 ERR("Failed to allocate local variable memory.\n");
1687 return E_OUTOFMEMORY;
1690 e->anonymous_shaders = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->anonymous_shader_count * sizeof(*e->anonymous_shaders));
1691 if (!e->anonymous_shaders)
1693 ERR("Failed to allocate anonymous shaders memory\n");
1694 return E_OUTOFMEMORY;
1697 e->used_shaders = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->used_shader_count * sizeof(*e->used_shaders));
1698 if (!e->used_shaders)
1700 ERR("Failed to allocate used shaders memory\n");
1701 return E_OUTOFMEMORY;
1704 e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques));
1705 if (!e->techniques)
1707 ERR("Failed to allocate techniques memory\n");
1708 return E_OUTOFMEMORY;
1711 for (i = 0; i < e->local_buffer_count; ++i)
1713 struct d3d10_effect_variable *l = &e->local_buffers[i];
1714 l->ID3D10EffectVariable_iface.lpVtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl;
1715 l->effect = e;
1716 l->buffer = &null_local_buffer;
1718 hr = parse_fx10_local_buffer(l, &ptr, data);
1719 if (FAILED(hr)) return hr;
1722 for (i = 0; i < e->local_variable_count; ++i)
1724 struct d3d10_effect_variable *v = &e->local_variables[i];
1726 v->effect = e;
1727 v->ID3D10EffectVariable_iface.lpVtbl = &d3d10_effect_variable_vtbl;
1728 v->buffer = &null_local_buffer;
1730 hr = parse_fx10_local_variable(v, &ptr, data);
1731 if (FAILED(hr)) return hr;
1734 for (i = 0; i < e->technique_count; ++i)
1736 struct d3d10_effect_technique *t = &e->techniques[i];
1738 t->ID3D10EffectTechnique_iface.lpVtbl = &d3d10_effect_technique_vtbl;
1739 t->effect = e;
1741 hr = parse_fx10_technique(t, &ptr, data);
1742 if (FAILED(hr)) return hr;
1745 return S_OK;
1748 static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_size)
1750 const char *ptr = data;
1751 DWORD unknown;
1753 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
1754 read_dword(&ptr, &e->version);
1755 TRACE("Target: %#x\n", e->version);
1757 read_dword(&ptr, &e->local_buffer_count);
1758 TRACE("Local buffer count: %u.\n", e->local_buffer_count);
1760 read_dword(&ptr, &e->variable_count);
1761 TRACE("Variable count: %u\n", e->variable_count);
1763 read_dword(&ptr, &e->local_variable_count);
1764 TRACE("Object count: %u\n", e->local_variable_count);
1766 read_dword(&ptr, &e->sharedbuffers_count);
1767 TRACE("Sharedbuffers count: %u\n", e->sharedbuffers_count);
1769 /* Number of variables in shared buffers? */
1770 read_dword(&ptr, &unknown);
1771 FIXME("Unknown 0: %u\n", unknown);
1773 read_dword(&ptr, &e->sharedobjects_count);
1774 TRACE("Sharedobjects count: %u\n", e->sharedobjects_count);
1776 read_dword(&ptr, &e->technique_count);
1777 TRACE("Technique count: %u\n", e->technique_count);
1779 read_dword(&ptr, &e->index_offset);
1780 TRACE("Index offset: %#x\n", e->index_offset);
1782 read_dword(&ptr, &unknown);
1783 FIXME("Unknown 1: %u\n", unknown);
1785 read_dword(&ptr, &e->texture_count);
1786 TRACE("Texture count: %u\n", e->texture_count);
1788 read_dword(&ptr, &e->dephstencilstate_count);
1789 TRACE("Depthstencilstate count: %u\n", e->dephstencilstate_count);
1791 read_dword(&ptr, &e->blendstate_count);
1792 TRACE("Blendstate count: %u\n", e->blendstate_count);
1794 read_dword(&ptr, &e->rasterizerstate_count);
1795 TRACE("Rasterizerstate count: %u\n", e->rasterizerstate_count);
1797 read_dword(&ptr, &e->samplerstate_count);
1798 TRACE("Samplerstate count: %u\n", e->samplerstate_count);
1800 read_dword(&ptr, &e->rendertargetview_count);
1801 TRACE("Rendertargetview count: %u\n", e->rendertargetview_count);
1803 read_dword(&ptr, &e->depthstencilview_count);
1804 TRACE("Depthstencilview count: %u\n", e->depthstencilview_count);
1806 read_dword(&ptr, &e->used_shader_count);
1807 TRACE("Used shader count: %u\n", e->used_shader_count);
1809 read_dword(&ptr, &e->anonymous_shader_count);
1810 TRACE("Anonymous shader count: %u\n", e->anonymous_shader_count);
1812 return parse_fx10_body(e, ptr, data_size - (ptr - data));
1815 static HRESULT fx10_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
1817 struct d3d10_effect *e = ctx;
1819 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
1821 TRACE("chunk size: %#x\n", data_size);
1823 switch(tag)
1825 case TAG_FX10:
1826 return parse_fx10(e, data, data_size);
1828 default:
1829 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
1830 return S_OK;
1834 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size)
1836 return parse_dxbc(data, data_size, fx10_chunk_handler, This);
1839 static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
1841 ID3D10Device *device = o->pass->technique->effect->device;
1842 struct d3d10_effect_variable *v = (struct d3d10_effect_variable*) o->data;
1844 TRACE("effect object %p, type %#x.\n", o, o->type);
1846 switch(o->type)
1848 case D3D10_EOT_VERTEXSHADER:
1849 ID3D10Device_VSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.vs);
1850 return S_OK;
1852 case D3D10_EOT_PIXELSHADER:
1853 ID3D10Device_PSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.ps);
1854 return S_OK;
1856 case D3D10_EOT_GEOMETRYSHADER:
1857 ID3D10Device_GSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.gs);
1858 return S_OK;
1860 default:
1861 FIXME("Unhandled effect object type %#x.\n", o->type);
1862 return E_FAIL;
1866 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
1868 unsigned int i;
1870 TRACE("variable %p.\n", v);
1872 HeapFree(GetProcessHeap(), 0, v->name);
1873 HeapFree(GetProcessHeap(), 0, v->semantic);
1874 if (v->annotations)
1876 for (i = 0; i < v->annotation_count; ++i)
1878 d3d10_effect_variable_destroy(&v->annotations[i]);
1880 HeapFree(GetProcessHeap(), 0, v->annotations);
1883 if (v->members)
1885 for (i = 0; i < v->type->member_count; ++i)
1887 d3d10_effect_variable_destroy(&v->members[i]);
1889 HeapFree(GetProcessHeap(), 0, v->members);
1892 if (v->elements)
1894 for (i = 0; i < v->type->element_count; ++i)
1896 d3d10_effect_variable_destroy(&v->elements[i]);
1898 HeapFree(GetProcessHeap(), 0, v->elements);
1901 if (v->data)
1903 switch(v->type->basetype)
1905 case D3D10_SVT_VERTEXSHADER:
1906 case D3D10_SVT_PIXELSHADER:
1907 case D3D10_SVT_GEOMETRYSHADER:
1908 shader_free_signature(&((struct d3d10_effect_shader_variable *)v->data)->input_signature);
1909 shader_free_signature(&((struct d3d10_effect_shader_variable *)v->data)->output_signature);
1910 break;
1912 default:
1913 break;
1915 HeapFree(GetProcessHeap(), 0, v->data);
1919 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p)
1921 unsigned int i;
1923 TRACE("pass %p\n", p);
1925 HeapFree(GetProcessHeap(), 0, p->name);
1926 HeapFree(GetProcessHeap(), 0, p->objects);
1928 if (p->annotations)
1930 for (i = 0; i < p->annotation_count; ++i)
1932 d3d10_effect_variable_destroy(&p->annotations[i]);
1934 HeapFree(GetProcessHeap(), 0, p->annotations);
1938 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
1940 unsigned int i;
1942 TRACE("technique %p\n", t);
1944 HeapFree(GetProcessHeap(), 0, t->name);
1945 if (t->passes)
1947 for (i = 0; i < t->pass_count; ++i)
1949 d3d10_effect_pass_destroy(&t->passes[i]);
1951 HeapFree(GetProcessHeap(), 0, t->passes);
1954 if (t->annotations)
1956 for (i = 0; i < t->annotation_count; ++i)
1958 d3d10_effect_variable_destroy(&t->annotations[i]);
1960 HeapFree(GetProcessHeap(), 0, t->annotations);
1964 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_variable *l)
1966 unsigned int i;
1968 TRACE("local buffer %p.\n", l);
1970 HeapFree(GetProcessHeap(), 0, l->name);
1971 if (l->members)
1973 for (i = 0; i < l->type->member_count; ++i)
1975 d3d10_effect_variable_destroy(&l->members[i]);
1977 HeapFree(GetProcessHeap(), 0, l->members);
1980 if (l->type->members)
1982 for (i = 0; i < l->type->member_count; ++i)
1984 /* Do not release l->type->members[i].type, it will be covered by d3d10_effect_type_destroy(). */
1985 HeapFree(GetProcessHeap(), 0, l->type->members[i].semantic);
1986 HeapFree(GetProcessHeap(), 0, l->type->members[i].name);
1988 HeapFree(GetProcessHeap(), 0, l->type->members);
1990 HeapFree(GetProcessHeap(), 0, l->type->name);
1991 HeapFree(GetProcessHeap(), 0, l->type);
1993 if (l->annotations)
1995 for (i = 0; i < l->annotation_count; ++i)
1997 d3d10_effect_variable_destroy(&l->annotations[i]);
1999 HeapFree(GetProcessHeap(), 0, l->annotations);
2003 /* IUnknown methods */
2005 static inline struct d3d10_effect *impl_from_ID3D10Effect(ID3D10Effect *iface)
2007 return CONTAINING_RECORD(iface, struct d3d10_effect, ID3D10Effect_iface);
2010 static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
2012 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
2014 if (IsEqualGUID(riid, &IID_ID3D10Effect)
2015 || IsEqualGUID(riid, &IID_IUnknown))
2017 IUnknown_AddRef(iface);
2018 *object = iface;
2019 return S_OK;
2022 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
2024 *object = NULL;
2025 return E_NOINTERFACE;
2028 static ULONG STDMETHODCALLTYPE d3d10_effect_AddRef(ID3D10Effect *iface)
2030 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2031 ULONG refcount = InterlockedIncrement(&This->refcount);
2033 TRACE("%p increasing refcount to %u\n", This, refcount);
2035 return refcount;
2038 static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
2040 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2041 ULONG refcount = InterlockedDecrement(&This->refcount);
2043 TRACE("%p decreasing refcount to %u\n", This, refcount);
2045 if (!refcount)
2047 unsigned int i;
2049 if (This->techniques)
2051 for (i = 0; i < This->technique_count; ++i)
2053 d3d10_effect_technique_destroy(&This->techniques[i]);
2055 HeapFree(GetProcessHeap(), 0, This->techniques);
2058 if (This->local_variables)
2060 for (i = 0; i < This->local_variable_count; ++i)
2062 d3d10_effect_variable_destroy(&This->local_variables[i]);
2064 HeapFree(GetProcessHeap(), 0, This->local_variables);
2067 if (This->local_buffers)
2069 for (i = 0; i < This->local_buffer_count; ++i)
2071 d3d10_effect_local_buffer_destroy(&This->local_buffers[i]);
2073 HeapFree(GetProcessHeap(), 0, This->local_buffers);
2076 if (This->anonymous_shaders)
2078 for (i = 0; i < This->anonymous_shader_count; ++i)
2080 d3d10_effect_variable_destroy(&This->anonymous_shaders[i].shader);
2081 HeapFree(GetProcessHeap(), 0, This->anonymous_shaders[i].type.name);
2083 HeapFree(GetProcessHeap(), 0, This->anonymous_shaders);
2086 HeapFree(GetProcessHeap(), 0, This->used_shaders);
2088 wine_rb_destroy(&This->types, d3d10_effect_type_destroy, NULL);
2090 ID3D10Device_Release(This->device);
2091 HeapFree(GetProcessHeap(), 0, This);
2094 return refcount;
2097 /* ID3D10Effect methods */
2099 static BOOL STDMETHODCALLTYPE d3d10_effect_IsValid(ID3D10Effect *iface)
2101 FIXME("iface %p stub!\n", iface);
2103 return FALSE;
2106 static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
2108 FIXME("iface %p stub!\n", iface);
2110 return FALSE;
2113 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
2115 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2117 TRACE("iface %p, device %p\n", iface, device);
2119 ID3D10Device_AddRef(This->device);
2120 *device = This->device;
2122 return S_OK;
2125 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)
2127 FIXME("iface %p, desc %p stub!\n", iface, desc);
2129 return E_NOTIMPL;
2132 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface,
2133 UINT index)
2135 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2136 struct d3d10_effect_variable *l;
2138 TRACE("iface %p, index %u\n", iface, index);
2140 if (index >= This->local_buffer_count)
2142 WARN("Invalid index specified\n");
2143 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
2146 l = &This->local_buffers[index];
2148 TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name));
2150 return (ID3D10EffectConstantBuffer *)l;
2153 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,
2154 LPCSTR name)
2156 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2157 unsigned int i;
2159 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2161 for (i = 0; i < This->local_buffer_count; ++i)
2163 struct d3d10_effect_variable *l = &This->local_buffers[i];
2165 if (!strcmp(l->name, name))
2167 TRACE("Returning buffer %p.\n", l);
2168 return (ID3D10EffectConstantBuffer *)l;
2172 WARN("Invalid name specified\n");
2174 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
2177 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index)
2179 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2180 unsigned int i;
2182 TRACE("iface %p, index %u\n", iface, index);
2184 for (i = 0; i < This->local_buffer_count; ++i)
2186 struct d3d10_effect_variable *l = &This->local_buffers[i];
2188 if (index < l->type->member_count)
2190 struct d3d10_effect_variable *v = &l->members[index];
2192 TRACE("Returning variable %p.\n", v);
2193 return &v->ID3D10EffectVariable_iface;
2195 index -= l->type->member_count;
2198 if (index < This->local_variable_count)
2200 struct d3d10_effect_variable *v = &This->local_variables[index];
2202 TRACE("Returning variable %p.\n", v);
2203 return &v->ID3D10EffectVariable_iface;
2206 WARN("Invalid index specified\n");
2208 return &null_variable.ID3D10EffectVariable_iface;
2211 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name)
2213 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2214 unsigned int i;
2216 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2218 if (!name)
2220 WARN("Invalid name specified\n");
2221 return &null_variable.ID3D10EffectVariable_iface;
2224 for (i = 0; i < This->local_buffer_count; ++i)
2226 struct d3d10_effect_variable *l = &This->local_buffers[i];
2227 unsigned int j;
2229 for (j = 0; j < l->type->member_count; ++j)
2231 struct d3d10_effect_variable *v = &l->members[j];
2233 if (!strcmp(v->name, name))
2235 TRACE("Returning variable %p.\n", v);
2236 return &v->ID3D10EffectVariable_iface;
2241 for (i = 0; i < This->local_variable_count; ++i)
2243 struct d3d10_effect_variable *v = &This->local_variables[i];
2245 if (!strcmp(v->name, name))
2247 TRACE("Returning variable %p.\n", v);
2248 return &v->ID3D10EffectVariable_iface;
2252 WARN("Invalid name specified\n");
2254 return &null_variable.ID3D10EffectVariable_iface;
2257 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface,
2258 LPCSTR semantic)
2260 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2261 unsigned int i;
2263 TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
2265 if (!semantic)
2267 WARN("Invalid semantic specified\n");
2268 return &null_variable.ID3D10EffectVariable_iface;
2271 for (i = 0; i < This->local_buffer_count; ++i)
2273 struct d3d10_effect_variable *l = &This->local_buffers[i];
2274 unsigned int j;
2276 for (j = 0; j < l->type->member_count; ++j)
2278 struct d3d10_effect_variable *v = &l->members[j];
2280 if (!strcmp(v->semantic, semantic))
2282 TRACE("Returning variable %p.\n", v);
2283 return &v->ID3D10EffectVariable_iface;
2288 for (i = 0; i < This->local_variable_count; ++i)
2290 struct d3d10_effect_variable *v = &This->local_variables[i];
2292 if (!strcmp(v->semantic, semantic))
2294 TRACE("Returning variable %p.\n", v);
2295 return &v->ID3D10EffectVariable_iface;
2299 WARN("Invalid semantic specified\n");
2301 return &null_variable.ID3D10EffectVariable_iface;
2304 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByIndex(ID3D10Effect *iface,
2305 UINT index)
2307 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2308 struct d3d10_effect_technique *t;
2310 TRACE("iface %p, index %u\n", iface, index);
2312 if (index >= This->technique_count)
2314 WARN("Invalid index specified\n");
2315 return &null_technique.ID3D10EffectTechnique_iface;
2318 t = &This->techniques[index];
2320 TRACE("Returning technique %p, %s.\n", t, debugstr_a(t->name));
2322 return &t->ID3D10EffectTechnique_iface;
2325 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByName(ID3D10Effect *iface,
2326 LPCSTR name)
2328 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2329 unsigned int i;
2331 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2333 if (!name)
2335 WARN("Invalid name specified\n");
2336 return &null_technique.ID3D10EffectTechnique_iface;
2339 for (i = 0; i < This->technique_count; ++i)
2341 struct d3d10_effect_technique *t = &This->techniques[i];
2342 if (!strcmp(t->name, name))
2344 TRACE("Returning technique %p\n", t);
2345 return &t->ID3D10EffectTechnique_iface;
2349 WARN("Invalid name specified\n");
2351 return &null_technique.ID3D10EffectTechnique_iface;
2354 static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
2356 FIXME("iface %p stub!\n", iface);
2358 return E_NOTIMPL;
2361 static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface)
2363 FIXME("iface %p stub!\n", iface);
2365 return FALSE;
2368 const struct ID3D10EffectVtbl d3d10_effect_vtbl =
2370 /* IUnknown methods */
2371 d3d10_effect_QueryInterface,
2372 d3d10_effect_AddRef,
2373 d3d10_effect_Release,
2374 /* ID3D10Effect methods */
2375 d3d10_effect_IsValid,
2376 d3d10_effect_IsPool,
2377 d3d10_effect_GetDevice,
2378 d3d10_effect_GetDesc,
2379 d3d10_effect_GetConstantBufferByIndex,
2380 d3d10_effect_GetConstantBufferByName,
2381 d3d10_effect_GetVariableByIndex,
2382 d3d10_effect_GetVariableByName,
2383 d3d10_effect_GetVariableBySemantic,
2384 d3d10_effect_GetTechniqueByIndex,
2385 d3d10_effect_GetTechniqueByName,
2386 d3d10_effect_Optimize,
2387 d3d10_effect_IsOptimized,
2390 /* ID3D10EffectTechnique methods */
2392 static inline struct d3d10_effect_technique *impl_from_ID3D10EffectTechnique(ID3D10EffectTechnique *iface)
2394 return CONTAINING_RECORD(iface, struct d3d10_effect_technique, ID3D10EffectTechnique_iface);
2397 static BOOL STDMETHODCALLTYPE d3d10_effect_technique_IsValid(ID3D10EffectTechnique *iface)
2399 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2401 TRACE("iface %p\n", iface);
2403 return This != &null_technique;
2406 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_GetDesc(ID3D10EffectTechnique *iface,
2407 D3D10_TECHNIQUE_DESC *desc)
2409 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2411 TRACE("iface %p, desc %p\n", iface, desc);
2413 if(This == &null_technique)
2415 WARN("Null technique specified\n");
2416 return E_FAIL;
2419 if(!desc)
2421 WARN("Invalid argument specified\n");
2422 return E_INVALIDARG;
2425 desc->Name = This->name;
2426 desc->Passes = This->pass_count;
2427 desc->Annotations = This->annotation_count;
2429 return S_OK;
2432 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByIndex(
2433 ID3D10EffectTechnique *iface, UINT index)
2435 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2436 struct d3d10_effect_variable *a;
2438 TRACE("iface %p, index %u\n", iface, index);
2440 if (index >= This->annotation_count)
2442 WARN("Invalid index specified\n");
2443 return &null_variable.ID3D10EffectVariable_iface;
2446 a = &This->annotations[index];
2448 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
2450 return &a->ID3D10EffectVariable_iface;
2453 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByName(
2454 ID3D10EffectTechnique *iface, LPCSTR name)
2456 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2457 unsigned int i;
2459 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2461 for (i = 0; i < This->annotation_count; ++i)
2463 struct d3d10_effect_variable *a = &This->annotations[i];
2464 if (!strcmp(a->name, name))
2466 TRACE("Returning annotation %p\n", a);
2467 return &a->ID3D10EffectVariable_iface;
2471 WARN("Invalid name specified\n");
2473 return &null_variable.ID3D10EffectVariable_iface;
2476 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique *iface,
2477 UINT index)
2479 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2480 struct d3d10_effect_pass *p;
2482 TRACE("iface %p, index %u\n", iface, index);
2484 if (index >= This->pass_count)
2486 WARN("Invalid index specified\n");
2487 return &null_pass.ID3D10EffectPass_iface;
2490 p = &This->passes[index];
2492 TRACE("Returning pass %p, %s.\n", p, debugstr_a(p->name));
2494 return &p->ID3D10EffectPass_iface;
2497 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique *iface,
2498 LPCSTR name)
2500 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2501 unsigned int i;
2503 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2505 /* Do not check for name==NULL, W7/DX10 crashes in that case. */
2507 for (i = 0; i < This->pass_count; ++i)
2509 struct d3d10_effect_pass *p = &This->passes[i];
2510 if (!strcmp(p->name, name))
2512 TRACE("Returning pass %p\n", p);
2513 return &p->ID3D10EffectPass_iface;
2517 WARN("Invalid name specified\n");
2519 return &null_pass.ID3D10EffectPass_iface;
2522 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique *iface,
2523 D3D10_STATE_BLOCK_MASK *mask)
2525 FIXME("iface %p,mask %p stub!\n", iface, mask);
2527 return E_NOTIMPL;
2530 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl =
2532 /* ID3D10EffectTechnique methods */
2533 d3d10_effect_technique_IsValid,
2534 d3d10_effect_technique_GetDesc,
2535 d3d10_effect_technique_GetAnnotationByIndex,
2536 d3d10_effect_technique_GetAnnotationByName,
2537 d3d10_effect_technique_GetPassByIndex,
2538 d3d10_effect_technique_GetPassByName,
2539 d3d10_effect_technique_ComputeStateBlockMask,
2542 /* ID3D10EffectPass methods */
2544 static inline struct d3d10_effect_pass *impl_from_ID3D10EffectPass(ID3D10EffectPass *iface)
2546 return CONTAINING_RECORD(iface, struct d3d10_effect_pass, ID3D10EffectPass_iface);
2549 static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface)
2551 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2553 TRACE("iface %p\n", iface);
2555 return This != &null_pass;
2558 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface,
2559 D3D10_PASS_DESC *desc)
2561 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2562 unsigned int i;
2564 FIXME("iface %p, desc %p partial stub!\n", iface, desc);
2566 if(This == &null_pass)
2568 WARN("Null pass specified\n");
2569 return E_FAIL;
2572 if(!desc)
2574 WARN("Invalid argument specified\n");
2575 return E_INVALIDARG;
2578 memset(desc, 0, sizeof(*desc));
2579 desc->Name = This->name;
2580 for (i = 0; i < This->object_count; ++i)
2582 struct d3d10_effect_object *o = &This->objects[i];
2583 if (o->type == D3D10_EOT_VERTEXSHADER)
2585 struct d3d10_effect_variable *v = o->data;
2586 struct d3d10_effect_shader_variable *s = v->data;
2587 desc->pIAInputSignature = (BYTE *)s->input_signature.signature;
2588 desc->IAInputSignatureSize = s->input_signature.signature_size;
2589 break;
2593 desc->StencilRef = This->stencil_ref;
2594 desc->SampleMask = This->sample_mask;
2595 memcpy(desc->BlendFactor, This->blend_factor, 4 * sizeof(float));
2597 return S_OK;
2600 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface,
2601 D3D10_PASS_SHADER_DESC *desc)
2603 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2604 unsigned int i;
2606 TRACE("iface %p, desc %p\n", iface, desc);
2608 if (This == &null_pass)
2610 WARN("Null pass specified\n");
2611 return E_FAIL;
2614 if (!desc)
2616 WARN("Invalid argument specified\n");
2617 return E_INVALIDARG;
2620 for (i = 0; i < This->object_count; ++i)
2622 struct d3d10_effect_object *o = &This->objects[i];
2624 if (o->type == D3D10_EOT_VERTEXSHADER)
2626 desc->pShaderVariable = o->data;
2627 desc->ShaderIndex = o->index;
2628 return S_OK;
2632 TRACE("Returning null_shader_variable\n");
2633 desc->pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable;
2634 desc->ShaderIndex = 0;
2636 return S_OK;
2639 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface,
2640 D3D10_PASS_SHADER_DESC *desc)
2642 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2643 unsigned int i;
2645 TRACE("iface %p, desc %p\n", iface, desc);
2647 if (This == &null_pass)
2649 WARN("Null pass specified\n");
2650 return E_FAIL;
2653 if (!desc)
2655 WARN("Invalid argument specified\n");
2656 return E_INVALIDARG;
2659 for (i = 0; i < This->object_count; ++i)
2661 struct d3d10_effect_object *o = &This->objects[i];
2663 if (o->type == D3D10_EOT_GEOMETRYSHADER)
2665 desc->pShaderVariable = o->data;
2666 desc->ShaderIndex = o->index;
2667 return S_OK;
2671 TRACE("Returning null_shader_variable\n");
2672 desc->pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable;
2673 desc->ShaderIndex = 0;
2675 return S_OK;
2678 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface,
2679 D3D10_PASS_SHADER_DESC *desc)
2681 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2682 unsigned int i;
2684 TRACE("iface %p, desc %p\n", iface, desc);
2686 if (This == &null_pass)
2688 WARN("Null pass specified\n");
2689 return E_FAIL;
2692 if (!desc)
2694 WARN("Invalid argument specified\n");
2695 return E_INVALIDARG;
2698 for (i = 0; i < This->object_count; ++i)
2700 struct d3d10_effect_object *o = &This->objects[i];
2702 if (o->type == D3D10_EOT_PIXELSHADER)
2704 desc->pShaderVariable = o->data;
2705 desc->ShaderIndex = o->index;
2706 return S_OK;
2710 TRACE("Returning null_shader_variable\n");
2711 desc->pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable;
2712 desc->ShaderIndex = 0;
2714 return S_OK;
2717 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass *iface,
2718 UINT index)
2720 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2721 struct d3d10_effect_variable *a;
2723 TRACE("iface %p, index %u\n", iface, index);
2725 if (index >= This->annotation_count)
2727 WARN("Invalid index specified\n");
2728 return &null_variable.ID3D10EffectVariable_iface;
2731 a = &This->annotations[index];
2733 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
2735 return &a->ID3D10EffectVariable_iface;
2738 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass *iface,
2739 LPCSTR name)
2741 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2742 unsigned int i;
2744 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2746 for (i = 0; i < This->annotation_count; ++i)
2748 struct d3d10_effect_variable *a = &This->annotations[i];
2749 if (!strcmp(a->name, name))
2751 TRACE("Returning annotation %p\n", a);
2752 return &a->ID3D10EffectVariable_iface;
2756 WARN("Invalid name specified\n");
2758 return &null_variable.ID3D10EffectVariable_iface;
2761 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
2763 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2764 HRESULT hr = S_OK;
2765 unsigned int i;
2767 TRACE("iface %p, flags %#x\n", iface, flags);
2769 if (flags) FIXME("Ignoring flags (%#x)\n", flags);
2771 for (i = 0; i < This->object_count; ++i)
2773 hr = d3d10_effect_object_apply(&This->objects[i]);
2774 if (FAILED(hr)) break;
2777 return hr;
2780 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass *iface,
2781 D3D10_STATE_BLOCK_MASK *mask)
2783 FIXME("iface %p, mask %p stub!\n", iface, mask);
2785 return E_NOTIMPL;
2788 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl =
2790 /* ID3D10EffectPass methods */
2791 d3d10_effect_pass_IsValid,
2792 d3d10_effect_pass_GetDesc,
2793 d3d10_effect_pass_GetVertexShaderDesc,
2794 d3d10_effect_pass_GetGeometryShaderDesc,
2795 d3d10_effect_pass_GetPixelShaderDesc,
2796 d3d10_effect_pass_GetAnnotationByIndex,
2797 d3d10_effect_pass_GetAnnotationByName,
2798 d3d10_effect_pass_Apply,
2799 d3d10_effect_pass_ComputeStateBlockMask,
2802 /* ID3D10EffectVariable methods */
2804 static BOOL STDMETHODCALLTYPE d3d10_effect_variable_IsValid(ID3D10EffectVariable *iface)
2806 TRACE("iface %p\n", iface);
2808 return impl_from_ID3D10EffectVariable(iface) != &null_variable;
2811 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_variable_GetType(ID3D10EffectVariable *iface)
2813 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
2815 TRACE("iface %p\n", iface);
2817 return &This->type->ID3D10EffectType_iface;
2820 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetDesc(ID3D10EffectVariable *iface,
2821 D3D10_EFFECT_VARIABLE_DESC *desc)
2823 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
2825 TRACE("iface %p, desc %p\n", iface, desc);
2827 if (!iface->lpVtbl->IsValid(iface))
2829 WARN("Null variable specified\n");
2830 return E_FAIL;
2833 if (!desc)
2835 WARN("Invalid argument specified\n");
2836 return E_INVALIDARG;
2839 /* FIXME: This isn't correct. Anonymous shaders let desc->ExplicitBindPoint untouched, but normal shaders set it! */
2840 memset(desc, 0, sizeof(*desc));
2841 desc->Name = This->name;
2842 desc->Semantic = This->semantic;
2843 desc->Flags = This->flag;
2844 desc->Annotations = This->annotation_count;
2845 desc->BufferOffset = This->buffer_offset;
2847 if (This->flag & D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT)
2849 desc->ExplicitBindPoint = This->buffer_offset;
2852 return S_OK;
2855 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByIndex(
2856 ID3D10EffectVariable *iface, UINT index)
2858 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
2859 struct d3d10_effect_variable *a;
2861 TRACE("iface %p, index %u\n", iface, index);
2863 if (index >= This->annotation_count)
2865 WARN("Invalid index specified\n");
2866 return &null_variable.ID3D10EffectVariable_iface;
2869 a = &This->annotations[index];
2871 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
2873 return &a->ID3D10EffectVariable_iface;
2876 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName(
2877 ID3D10EffectVariable *iface, LPCSTR name)
2879 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
2880 unsigned int i;
2882 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2884 for (i = 0; i < This->annotation_count; ++i)
2886 struct d3d10_effect_variable *a = &This->annotations[i];
2887 if (!strcmp(a->name, name))
2889 TRACE("Returning annotation %p\n", a);
2890 return &a->ID3D10EffectVariable_iface;
2894 WARN("Invalid name specified\n");
2896 return &null_variable.ID3D10EffectVariable_iface;
2899 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex(
2900 ID3D10EffectVariable *iface, UINT index)
2902 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
2903 struct d3d10_effect_variable *m;
2905 TRACE("iface %p, index %u\n", iface, index);
2907 if (index >= This->type->member_count)
2909 WARN("Invalid index specified\n");
2910 return &null_variable.ID3D10EffectVariable_iface;
2913 m = &This->members[index];
2915 TRACE("Returning member %p, %s\n", m, debugstr_a(m->name));
2917 return &m->ID3D10EffectVariable_iface;
2920 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName(
2921 ID3D10EffectVariable *iface, LPCSTR name)
2923 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
2924 unsigned int i;
2926 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2928 if (!name)
2930 WARN("Invalid name specified\n");
2931 return &null_variable.ID3D10EffectVariable_iface;
2934 for (i = 0; i < This->type->member_count; ++i)
2936 struct d3d10_effect_variable *m = &This->members[i];
2938 if (m->name)
2940 if (!strcmp(m->name, name))
2942 TRACE("Returning member %p\n", m);
2943 return &m->ID3D10EffectVariable_iface;
2948 WARN("Invalid name specified\n");
2950 return &null_variable.ID3D10EffectVariable_iface;
2953 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic(
2954 ID3D10EffectVariable *iface, LPCSTR semantic)
2956 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
2957 unsigned int i;
2959 TRACE("iface %p, semantic %s.\n", iface, debugstr_a(semantic));
2961 if (!semantic)
2963 WARN("Invalid semantic specified\n");
2964 return &null_variable.ID3D10EffectVariable_iface;
2967 for (i = 0; i < This->type->member_count; ++i)
2969 struct d3d10_effect_variable *m = &This->members[i];
2971 if (m->semantic)
2973 if (!strcmp(m->semantic, semantic))
2975 TRACE("Returning member %p\n", m);
2976 return &m->ID3D10EffectVariable_iface;
2981 WARN("Invalid semantic specified\n");
2983 return &null_variable.ID3D10EffectVariable_iface;
2986 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetElement(
2987 ID3D10EffectVariable *iface, UINT index)
2989 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
2990 struct d3d10_effect_variable *v;
2992 TRACE("iface %p, index %u\n", iface, index);
2994 if (index >= This->type->element_count)
2996 WARN("Invalid index specified\n");
2997 return &null_variable.ID3D10EffectVariable_iface;
3000 v = &This->elements[index];
3002 TRACE("Returning element %p, %s\n", v, debugstr_a(v->name));
3004 return &v->ID3D10EffectVariable_iface;
3007 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_GetParentConstantBuffer(
3008 ID3D10EffectVariable *iface)
3010 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3012 TRACE("iface %p\n", iface);
3014 return (ID3D10EffectConstantBuffer *)This->buffer;
3017 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsScalar(
3018 ID3D10EffectVariable *iface)
3020 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3022 TRACE("iface %p\n", iface);
3024 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl)
3025 return (ID3D10EffectScalarVariable *)&This->ID3D10EffectVariable_iface;
3027 return (ID3D10EffectScalarVariable *)&null_scalar_variable.ID3D10EffectVariable_iface;
3030 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsVector(
3031 ID3D10EffectVariable *iface)
3033 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3035 TRACE("iface %p\n", iface);
3037 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl)
3038 return (ID3D10EffectVectorVariable *)&This->ID3D10EffectVariable_iface;
3040 return (ID3D10EffectVectorVariable *)&null_vector_variable.ID3D10EffectVariable_iface;
3043 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix(
3044 ID3D10EffectVariable *iface)
3046 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3048 TRACE("iface %p\n", iface);
3050 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl)
3051 return (ID3D10EffectMatrixVariable *)&This->ID3D10EffectVariable_iface;
3053 return (ID3D10EffectMatrixVariable *)&null_matrix_variable.ID3D10EffectVariable_iface;
3056 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsString(
3057 ID3D10EffectVariable *iface)
3059 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3061 TRACE("iface %p\n", iface);
3063 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl)
3064 return (ID3D10EffectStringVariable *)&This->ID3D10EffectVariable_iface;
3066 return (ID3D10EffectStringVariable *)&null_string_variable.ID3D10EffectVariable_iface;
3069 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShaderResource(
3070 ID3D10EffectVariable *iface)
3072 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3074 TRACE("iface %p\n", iface);
3076 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl)
3077 return (ID3D10EffectShaderResourceVariable *)&This->ID3D10EffectVariable_iface;
3079 return (ID3D10EffectShaderResourceVariable *)&null_shader_resource_variable.ID3D10EffectVariable_iface;
3082 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRenderTargetView(
3083 ID3D10EffectVariable *iface)
3085 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3087 TRACE("iface %p\n", iface);
3089 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl)
3090 return (ID3D10EffectRenderTargetViewVariable *)&This->ID3D10EffectVariable_iface;
3092 return (ID3D10EffectRenderTargetViewVariable *)&null_render_target_view_variable.ID3D10EffectVariable_iface;
3095 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencilView(
3096 ID3D10EffectVariable *iface)
3098 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3100 TRACE("iface %p\n", iface);
3102 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl)
3103 return (ID3D10EffectDepthStencilViewVariable *)&This->ID3D10EffectVariable_iface;
3105 return (ID3D10EffectDepthStencilViewVariable *)&null_depth_stencil_view_variable.ID3D10EffectVariable_iface;
3108 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_AsConstantBuffer(
3109 ID3D10EffectVariable *iface)
3111 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3113 TRACE("iface %p\n", iface);
3115 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl)
3116 return (ID3D10EffectConstantBuffer *)&This->ID3D10EffectVariable_iface;
3118 return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface;
3121 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShader(
3122 ID3D10EffectVariable *iface)
3124 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3126 TRACE("iface %p\n", iface);
3128 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl)
3129 return (ID3D10EffectShaderVariable *)&This->ID3D10EffectVariable_iface;
3131 return (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface;
3134 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsBlend(ID3D10EffectVariable *iface)
3136 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3138 TRACE("iface %p\n", iface);
3140 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl)
3141 return (ID3D10EffectBlendVariable *)&This->ID3D10EffectVariable_iface;
3143 return (ID3D10EffectBlendVariable *)&null_blend_variable.ID3D10EffectVariable_iface;
3146 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencil(
3147 ID3D10EffectVariable *iface)
3149 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3151 TRACE("iface %p\n", iface);
3153 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl)
3154 return (ID3D10EffectDepthStencilVariable *)&This->ID3D10EffectVariable_iface;
3156 return (ID3D10EffectDepthStencilVariable *)&null_depth_stencil_variable.ID3D10EffectVariable_iface;
3159 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRasterizer(
3160 ID3D10EffectVariable *iface)
3162 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3164 TRACE("iface %p\n", iface);
3166 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl)
3167 return (ID3D10EffectRasterizerVariable *)&This->ID3D10EffectVariable_iface;
3169 return (ID3D10EffectRasterizerVariable *)&null_rasterizer_variable.ID3D10EffectVariable_iface;
3172 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsSampler(
3173 ID3D10EffectVariable *iface)
3175 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3177 TRACE("iface %p\n", iface);
3179 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl)
3180 return (ID3D10EffectSamplerVariable *)&This->ID3D10EffectVariable_iface;
3182 return (ID3D10EffectSamplerVariable *)&null_sampler_variable.ID3D10EffectVariable_iface;
3185 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface,
3186 void *data, UINT offset, UINT count)
3188 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3190 return E_NOTIMPL;
3193 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface,
3194 void *data, UINT offset, UINT count)
3196 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3198 return E_NOTIMPL;
3201 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl =
3203 /* ID3D10EffectVariable methods */
3204 d3d10_effect_variable_IsValid,
3205 d3d10_effect_variable_GetType,
3206 d3d10_effect_variable_GetDesc,
3207 d3d10_effect_variable_GetAnnotationByIndex,
3208 d3d10_effect_variable_GetAnnotationByName,
3209 d3d10_effect_variable_GetMemberByIndex,
3210 d3d10_effect_variable_GetMemberByName,
3211 d3d10_effect_variable_GetMemberBySemantic,
3212 d3d10_effect_variable_GetElement,
3213 d3d10_effect_variable_GetParentConstantBuffer,
3214 d3d10_effect_variable_AsScalar,
3215 d3d10_effect_variable_AsVector,
3216 d3d10_effect_variable_AsMatrix,
3217 d3d10_effect_variable_AsString,
3218 d3d10_effect_variable_AsShaderResource,
3219 d3d10_effect_variable_AsRenderTargetView,
3220 d3d10_effect_variable_AsDepthStencilView,
3221 d3d10_effect_variable_AsConstantBuffer,
3222 d3d10_effect_variable_AsShader,
3223 d3d10_effect_variable_AsBlend,
3224 d3d10_effect_variable_AsDepthStencil,
3225 d3d10_effect_variable_AsRasterizer,
3226 d3d10_effect_variable_AsSampler,
3227 d3d10_effect_variable_SetRawValue,
3228 d3d10_effect_variable_GetRawValue,
3231 /* ID3D10EffectVariable methods */
3232 static BOOL STDMETHODCALLTYPE d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer *iface)
3234 TRACE("iface %p\n", iface);
3236 return (struct d3d10_effect_variable *)iface != &null_local_buffer;
3239 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer *iface)
3241 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3244 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer *iface,
3245 D3D10_EFFECT_VARIABLE_DESC *desc)
3247 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3250 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByIndex(
3251 ID3D10EffectConstantBuffer *iface, UINT index)
3253 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3256 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByName(
3257 ID3D10EffectConstantBuffer *iface, LPCSTR name)
3259 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3262 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByIndex(
3263 ID3D10EffectConstantBuffer *iface, UINT index)
3265 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3268 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByName(
3269 ID3D10EffectConstantBuffer *iface, LPCSTR name)
3271 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3274 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberBySemantic(
3275 ID3D10EffectConstantBuffer *iface, LPCSTR semantic)
3277 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3280 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetElement(
3281 ID3D10EffectConstantBuffer *iface, UINT index)
3283 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3286 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetParentConstantBuffer(
3287 ID3D10EffectConstantBuffer *iface)
3289 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3292 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsScalar(
3293 ID3D10EffectConstantBuffer *iface)
3295 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3298 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsVector(
3299 ID3D10EffectConstantBuffer *iface)
3301 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3304 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsMatrix(
3305 ID3D10EffectConstantBuffer *iface)
3307 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3310 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsString(
3311 ID3D10EffectConstantBuffer *iface)
3313 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3316 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShaderResource(
3317 ID3D10EffectConstantBuffer *iface)
3319 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3322 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRenderTargetView(
3323 ID3D10EffectConstantBuffer *iface)
3325 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3328 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencilView(
3329 ID3D10EffectConstantBuffer *iface)
3331 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3334 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsConstantBuffer(
3335 ID3D10EffectConstantBuffer *iface)
3337 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3340 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShader(
3341 ID3D10EffectConstantBuffer *iface)
3343 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3346 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer *iface)
3348 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3351 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencil(
3352 ID3D10EffectConstantBuffer *iface)
3354 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3357 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRasterizer(
3358 ID3D10EffectConstantBuffer *iface)
3360 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3363 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsSampler(
3364 ID3D10EffectConstantBuffer *iface)
3366 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3369 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer *iface,
3370 void *data, UINT offset, UINT count)
3372 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3375 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer *iface,
3376 void *data, UINT offset, UINT count)
3378 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3381 /* ID3D10EffectConstantBuffer methods */
3382 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer *iface,
3383 ID3D10Buffer *buffer)
3385 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
3387 return E_NOTIMPL;
3390 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer *iface,
3391 ID3D10Buffer **buffer)
3393 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
3395 return E_NOTIMPL;
3398 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer *iface,
3399 ID3D10ShaderResourceView *view)
3401 FIXME("iface %p, view %p stub!\n", iface, view);
3403 return E_NOTIMPL;
3406 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer *iface,
3407 ID3D10ShaderResourceView **view)
3409 FIXME("iface %p, view %p stub!\n", iface, view);
3411 return E_NOTIMPL;
3414 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl =
3416 /* ID3D10EffectVariable methods */
3417 d3d10_effect_constant_buffer_IsValid,
3418 d3d10_effect_constant_buffer_GetType,
3419 d3d10_effect_constant_buffer_GetDesc,
3420 d3d10_effect_constant_buffer_GetAnnotationByIndex,
3421 d3d10_effect_constant_buffer_GetAnnotationByName,
3422 d3d10_effect_constant_buffer_GetMemberByIndex,
3423 d3d10_effect_constant_buffer_GetMemberByName,
3424 d3d10_effect_constant_buffer_GetMemberBySemantic,
3425 d3d10_effect_constant_buffer_GetElement,
3426 d3d10_effect_constant_buffer_GetParentConstantBuffer,
3427 d3d10_effect_constant_buffer_AsScalar,
3428 d3d10_effect_constant_buffer_AsVector,
3429 d3d10_effect_constant_buffer_AsMatrix,
3430 d3d10_effect_constant_buffer_AsString,
3431 d3d10_effect_constant_buffer_AsShaderResource,
3432 d3d10_effect_constant_buffer_AsRenderTargetView,
3433 d3d10_effect_constant_buffer_AsDepthStencilView,
3434 d3d10_effect_constant_buffer_AsConstantBuffer,
3435 d3d10_effect_constant_buffer_AsShader,
3436 d3d10_effect_constant_buffer_AsBlend,
3437 d3d10_effect_constant_buffer_AsDepthStencil,
3438 d3d10_effect_constant_buffer_AsRasterizer,
3439 d3d10_effect_constant_buffer_AsSampler,
3440 d3d10_effect_constant_buffer_SetRawValue,
3441 d3d10_effect_constant_buffer_GetRawValue,
3442 /* ID3D10EffectConstantBuffer methods */
3443 d3d10_effect_constant_buffer_SetConstantBuffer,
3444 d3d10_effect_constant_buffer_GetConstantBuffer,
3445 d3d10_effect_constant_buffer_SetTextureBuffer,
3446 d3d10_effect_constant_buffer_GetTextureBuffer,
3449 /* ID3D10EffectVariable methods */
3451 static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
3453 TRACE("iface %p\n", iface);
3455 return (struct d3d10_effect_variable *)iface != &null_scalar_variable;
3458 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetType(
3459 ID3D10EffectScalarVariable *iface)
3461 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3464 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetDesc(ID3D10EffectScalarVariable *iface,
3465 D3D10_EFFECT_VARIABLE_DESC *desc)
3467 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3470 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByIndex(
3471 ID3D10EffectScalarVariable *iface, UINT index)
3473 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3476 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByName(
3477 ID3D10EffectScalarVariable *iface, LPCSTR name)
3479 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3482 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByIndex(
3483 ID3D10EffectScalarVariable *iface, UINT index)
3485 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3488 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByName(
3489 ID3D10EffectScalarVariable *iface, LPCSTR name)
3491 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3494 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberBySemantic(
3495 ID3D10EffectScalarVariable *iface, LPCSTR semantic)
3497 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3500 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetElement(
3501 ID3D10EffectScalarVariable *iface, UINT index)
3503 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3506 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetParentConstantBuffer(
3507 ID3D10EffectScalarVariable *iface)
3509 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3512 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsScalar(
3513 ID3D10EffectScalarVariable *iface)
3515 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3518 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsVector(
3519 ID3D10EffectScalarVariable *iface)
3521 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3524 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsMatrix(
3525 ID3D10EffectScalarVariable *iface)
3527 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3530 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsString(
3531 ID3D10EffectScalarVariable *iface)
3533 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3536 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShaderResource(
3537 ID3D10EffectScalarVariable *iface)
3539 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3542 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRenderTargetView(
3543 ID3D10EffectScalarVariable *iface)
3545 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3548 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencilView(
3549 ID3D10EffectScalarVariable *iface)
3551 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3554 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsConstantBuffer(
3555 ID3D10EffectScalarVariable *iface)
3557 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3560 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShader(
3561 ID3D10EffectScalarVariable *iface)
3563 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3566 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsBlend(
3567 ID3D10EffectScalarVariable *iface)
3569 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3572 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencil(
3573 ID3D10EffectScalarVariable *iface)
3575 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3578 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRasterizer(
3579 ID3D10EffectScalarVariable *iface)
3581 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3584 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsSampler(
3585 ID3D10EffectScalarVariable *iface)
3587 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3590 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetRawValue(ID3D10EffectScalarVariable *iface,
3591 void *data, UINT offset, UINT count)
3593 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3596 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetRawValue(ID3D10EffectScalarVariable *iface,
3597 void *data, UINT offset, UINT count)
3599 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3602 /* ID3D10EffectScalarVariable methods */
3604 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable *iface,
3605 float value)
3607 FIXME("iface %p, value %.8e stub!\n", iface, value);
3609 return E_NOTIMPL;
3612 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable *iface,
3613 float *value)
3615 FIXME("iface %p, value %p stub!\n", iface, value);
3617 return E_NOTIMPL;
3620 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable *iface,
3621 float *values, UINT offset, UINT count)
3623 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3625 return E_NOTIMPL;
3628 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable *iface,
3629 float *values, UINT offset, UINT count)
3631 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3633 return E_NOTIMPL;
3636 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable *iface,
3637 int value)
3639 FIXME("iface %p, value %d stub!\n", iface, value);
3641 return E_NOTIMPL;
3644 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable *iface,
3645 int *value)
3647 FIXME("iface %p, value %p stub!\n", iface, value);
3649 return E_NOTIMPL;
3652 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable *iface,
3653 int *values, UINT offset, UINT count)
3655 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3657 return E_NOTIMPL;
3660 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable *iface,
3661 int *values, UINT offset, UINT count)
3663 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3665 return E_NOTIMPL;
3668 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable *iface,
3669 BOOL value)
3671 FIXME("iface %p, value %d stub!\n", iface, value);
3673 return E_NOTIMPL;
3676 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable *iface,
3677 BOOL *value)
3679 FIXME("iface %p, value %p stub!\n", iface, value);
3681 return E_NOTIMPL;
3684 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable *iface,
3685 BOOL *values, UINT offset, UINT count)
3687 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3689 return E_NOTIMPL;
3692 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable *iface,
3693 BOOL *values, UINT offset, UINT count)
3695 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3697 return E_NOTIMPL;
3700 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl =
3702 /* ID3D10EffectVariable methods */
3703 d3d10_effect_scalar_variable_IsValid,
3704 d3d10_effect_scalar_variable_GetType,
3705 d3d10_effect_scalar_variable_GetDesc,
3706 d3d10_effect_scalar_variable_GetAnnotationByIndex,
3707 d3d10_effect_scalar_variable_GetAnnotationByName,
3708 d3d10_effect_scalar_variable_GetMemberByIndex,
3709 d3d10_effect_scalar_variable_GetMemberByName,
3710 d3d10_effect_scalar_variable_GetMemberBySemantic,
3711 d3d10_effect_scalar_variable_GetElement,
3712 d3d10_effect_scalar_variable_GetParentConstantBuffer,
3713 d3d10_effect_scalar_variable_AsScalar,
3714 d3d10_effect_scalar_variable_AsVector,
3715 d3d10_effect_scalar_variable_AsMatrix,
3716 d3d10_effect_scalar_variable_AsString,
3717 d3d10_effect_scalar_variable_AsShaderResource,
3718 d3d10_effect_scalar_variable_AsRenderTargetView,
3719 d3d10_effect_scalar_variable_AsDepthStencilView,
3720 d3d10_effect_scalar_variable_AsConstantBuffer,
3721 d3d10_effect_scalar_variable_AsShader,
3722 d3d10_effect_scalar_variable_AsBlend,
3723 d3d10_effect_scalar_variable_AsDepthStencil,
3724 d3d10_effect_scalar_variable_AsRasterizer,
3725 d3d10_effect_scalar_variable_AsSampler,
3726 d3d10_effect_scalar_variable_SetRawValue,
3727 d3d10_effect_scalar_variable_GetRawValue,
3728 /* ID3D10EffectScalarVariable methods */
3729 d3d10_effect_scalar_variable_SetFloat,
3730 d3d10_effect_scalar_variable_GetFloat,
3731 d3d10_effect_scalar_variable_SetFloatArray,
3732 d3d10_effect_scalar_variable_GetFloatArray,
3733 d3d10_effect_scalar_variable_SetInt,
3734 d3d10_effect_scalar_variable_GetInt,
3735 d3d10_effect_scalar_variable_SetIntArray,
3736 d3d10_effect_scalar_variable_GetIntArray,
3737 d3d10_effect_scalar_variable_SetBool,
3738 d3d10_effect_scalar_variable_GetBool,
3739 d3d10_effect_scalar_variable_SetBoolArray,
3740 d3d10_effect_scalar_variable_GetBoolArray,
3743 /* ID3D10EffectVariable methods */
3745 static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
3747 TRACE("iface %p\n", iface);
3749 return (struct d3d10_effect_variable *)iface != &null_vector_variable;
3752 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetType(
3753 ID3D10EffectVectorVariable *iface)
3755 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3758 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable *iface,
3759 D3D10_EFFECT_VARIABLE_DESC *desc)
3761 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3764 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByIndex(
3765 ID3D10EffectVectorVariable *iface, UINT index)
3767 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3770 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByName(
3771 ID3D10EffectVectorVariable *iface, LPCSTR name)
3773 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3776 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByIndex(
3777 ID3D10EffectVectorVariable *iface, UINT index)
3779 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3782 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByName(
3783 ID3D10EffectVectorVariable *iface, LPCSTR name)
3785 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3788 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberBySemantic(
3789 ID3D10EffectVectorVariable *iface, LPCSTR semantic)
3791 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3794 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetElement(
3795 ID3D10EffectVectorVariable *iface, UINT index)
3797 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3800 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetParentConstantBuffer(
3801 ID3D10EffectVectorVariable *iface)
3803 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3806 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsScalar(
3807 ID3D10EffectVectorVariable *iface)
3809 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3812 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsVector(
3813 ID3D10EffectVectorVariable *iface)
3815 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3818 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsMatrix(
3819 ID3D10EffectVectorVariable *iface)
3821 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3824 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsString(
3825 ID3D10EffectVectorVariable *iface)
3827 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3830 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShaderResource(
3831 ID3D10EffectVectorVariable *iface)
3833 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3836 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRenderTargetView(
3837 ID3D10EffectVectorVariable *iface)
3839 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3842 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencilView(
3843 ID3D10EffectVectorVariable *iface)
3845 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3848 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsConstantBuffer(
3849 ID3D10EffectVectorVariable *iface)
3851 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3854 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShader(
3855 ID3D10EffectVectorVariable *iface)
3857 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3860 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsBlend(
3861 ID3D10EffectVectorVariable *iface)
3863 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3866 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencil(
3867 ID3D10EffectVectorVariable *iface)
3869 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3872 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRasterizer(
3873 ID3D10EffectVectorVariable *iface)
3875 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3878 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsSampler(
3879 ID3D10EffectVectorVariable *iface)
3881 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3884 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable *iface,
3885 void *data, UINT offset, UINT count)
3887 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3890 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable *iface,
3891 void *data, UINT offset, UINT count)
3893 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3896 /* ID3D10EffectVectorVariable methods */
3898 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable *iface,
3899 BOOL *value)
3901 FIXME("iface %p, value %p stub!\n", iface, value);
3903 return E_NOTIMPL;
3906 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable *iface,
3907 int *value)
3909 FIXME("iface %p, value %p stub!\n", iface, value);
3911 return E_NOTIMPL;
3914 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable *iface,
3915 float *value)
3917 FIXME("iface %p, value %p stub!\n", iface, value);
3919 return E_NOTIMPL;
3922 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable *iface,
3923 BOOL *value)
3925 FIXME("iface %p, value %p stub!\n", iface, value);
3927 return E_NOTIMPL;
3930 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable *iface,
3931 int *value)
3933 FIXME("iface %p, value %p stub!\n", iface, value);
3935 return E_NOTIMPL;
3938 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable *iface,
3939 float *value)
3941 FIXME("iface %p, value %p stub!\n", iface, value);
3943 return E_NOTIMPL;
3946 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable *iface,
3947 BOOL *values, UINT offset, UINT count)
3949 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3951 return E_NOTIMPL;
3954 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable *iface,
3955 int *values, UINT offset, UINT count)
3957 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3959 return E_NOTIMPL;
3962 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable *iface,
3963 float *values, UINT offset, UINT count)
3965 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3967 return E_NOTIMPL;
3970 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable *iface,
3971 BOOL *values, UINT offset, UINT count)
3973 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3975 return E_NOTIMPL;
3978 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable *iface,
3979 int *values, UINT offset, UINT count)
3981 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3983 return E_NOTIMPL;
3986 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable *iface,
3987 float *values, UINT offset, UINT count)
3989 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3991 return E_NOTIMPL;
3994 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl =
3996 /* ID3D10EffectVariable methods */
3997 d3d10_effect_vector_variable_IsValid,
3998 d3d10_effect_vector_variable_GetType,
3999 d3d10_effect_vector_variable_GetDesc,
4000 d3d10_effect_vector_variable_GetAnnotationByIndex,
4001 d3d10_effect_vector_variable_GetAnnotationByName,
4002 d3d10_effect_vector_variable_GetMemberByIndex,
4003 d3d10_effect_vector_variable_GetMemberByName,
4004 d3d10_effect_vector_variable_GetMemberBySemantic,
4005 d3d10_effect_vector_variable_GetElement,
4006 d3d10_effect_vector_variable_GetParentConstantBuffer,
4007 d3d10_effect_vector_variable_AsScalar,
4008 d3d10_effect_vector_variable_AsVector,
4009 d3d10_effect_vector_variable_AsMatrix,
4010 d3d10_effect_vector_variable_AsString,
4011 d3d10_effect_vector_variable_AsShaderResource,
4012 d3d10_effect_vector_variable_AsRenderTargetView,
4013 d3d10_effect_vector_variable_AsDepthStencilView,
4014 d3d10_effect_vector_variable_AsConstantBuffer,
4015 d3d10_effect_vector_variable_AsShader,
4016 d3d10_effect_vector_variable_AsBlend,
4017 d3d10_effect_vector_variable_AsDepthStencil,
4018 d3d10_effect_vector_variable_AsRasterizer,
4019 d3d10_effect_vector_variable_AsSampler,
4020 d3d10_effect_vector_variable_SetRawValue,
4021 d3d10_effect_vector_variable_GetRawValue,
4022 /* ID3D10EffectVectorVariable methods */
4023 d3d10_effect_vector_variable_SetBoolVector,
4024 d3d10_effect_vector_variable_SetIntVector,
4025 d3d10_effect_vector_variable_SetFloatVector,
4026 d3d10_effect_vector_variable_GetBoolVector,
4027 d3d10_effect_vector_variable_GetIntVector,
4028 d3d10_effect_vector_variable_GetFloatVector,
4029 d3d10_effect_vector_variable_SetBoolVectorArray,
4030 d3d10_effect_vector_variable_SetIntVectorArray,
4031 d3d10_effect_vector_variable_SetFloatVectorArray,
4032 d3d10_effect_vector_variable_GetBoolVectorArray,
4033 d3d10_effect_vector_variable_GetIntVectorArray,
4034 d3d10_effect_vector_variable_GetFloatVectorArray,
4037 /* ID3D10EffectVariable methods */
4039 static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
4041 TRACE("iface %p\n", iface);
4043 return (struct d3d10_effect_variable *)iface != &null_matrix_variable;
4046 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetType(
4047 ID3D10EffectMatrixVariable *iface)
4049 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4052 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetDesc(ID3D10EffectMatrixVariable *iface,
4053 D3D10_EFFECT_VARIABLE_DESC *desc)
4055 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4058 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByIndex(
4059 ID3D10EffectMatrixVariable *iface, UINT index)
4061 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4064 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByName(
4065 ID3D10EffectMatrixVariable *iface, LPCSTR name)
4067 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4070 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByIndex(
4071 ID3D10EffectMatrixVariable *iface, UINT index)
4073 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4076 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByName(
4077 ID3D10EffectMatrixVariable *iface, LPCSTR name)
4079 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4082 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberBySemantic(
4083 ID3D10EffectMatrixVariable *iface, LPCSTR semantic)
4085 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4088 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetElement(
4089 ID3D10EffectMatrixVariable *iface, UINT index)
4091 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4094 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetParentConstantBuffer(
4095 ID3D10EffectMatrixVariable *iface)
4097 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4100 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsScalar(
4101 ID3D10EffectMatrixVariable *iface)
4103 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4106 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsVector(
4107 ID3D10EffectMatrixVariable *iface)
4109 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4112 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsMatrix(
4113 ID3D10EffectMatrixVariable *iface)
4115 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4118 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsString(
4119 ID3D10EffectMatrixVariable *iface)
4121 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4124 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShaderResource(
4125 ID3D10EffectMatrixVariable *iface)
4127 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4130 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRenderTargetView(
4131 ID3D10EffectMatrixVariable *iface)
4133 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4136 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencilView(
4137 ID3D10EffectMatrixVariable *iface)
4139 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4142 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsConstantBuffer(
4143 ID3D10EffectMatrixVariable *iface)
4145 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4148 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShader(
4149 ID3D10EffectMatrixVariable *iface)
4151 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4154 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsBlend(
4155 ID3D10EffectMatrixVariable *iface)
4157 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4160 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencil(
4161 ID3D10EffectMatrixVariable *iface)
4163 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4166 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRasterizer(
4167 ID3D10EffectMatrixVariable *iface)
4169 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4172 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsSampler(
4173 ID3D10EffectMatrixVariable *iface)
4175 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4178 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetRawValue(ID3D10EffectMatrixVariable *iface,
4179 void *data, UINT offset, UINT count)
4181 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4184 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetRawValue(ID3D10EffectMatrixVariable *iface,
4185 void *data, UINT offset, UINT count)
4187 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4190 /* ID3D10EffectMatrixVariable methods */
4192 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrix(ID3D10EffectMatrixVariable *iface,
4193 float *data)
4195 FIXME("iface %p, data %p stub!\n", iface, data);
4197 return E_NOTIMPL;
4200 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrix(ID3D10EffectMatrixVariable *iface,
4201 float *data)
4203 FIXME("iface %p, data %p stub!\n", iface, data);
4205 return E_NOTIMPL;
4208 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixArray(ID3D10EffectMatrixVariable *iface,
4209 float *data, UINT offset, UINT count)
4211 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4213 return E_NOTIMPL;
4216 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixArray(ID3D10EffectMatrixVariable *iface,
4217 float *data, UINT offset, UINT count)
4219 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4221 return E_NOTIMPL;
4224 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
4225 float *data)
4227 FIXME("iface %p, data %p stub!\n", iface, data);
4229 return E_NOTIMPL;
4232 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
4233 float *data)
4235 FIXME("iface %p, data %p stub!\n", iface, data);
4237 return E_NOTIMPL;
4240 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
4241 float *data, UINT offset, UINT count)
4243 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4245 return E_NOTIMPL;
4248 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
4249 float *data, UINT offset, UINT count)
4251 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4253 return E_NOTIMPL;
4257 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl =
4259 /* ID3D10EffectVariable methods */
4260 d3d10_effect_matrix_variable_IsValid,
4261 d3d10_effect_matrix_variable_GetType,
4262 d3d10_effect_matrix_variable_GetDesc,
4263 d3d10_effect_matrix_variable_GetAnnotationByIndex,
4264 d3d10_effect_matrix_variable_GetAnnotationByName,
4265 d3d10_effect_matrix_variable_GetMemberByIndex,
4266 d3d10_effect_matrix_variable_GetMemberByName,
4267 d3d10_effect_matrix_variable_GetMemberBySemantic,
4268 d3d10_effect_matrix_variable_GetElement,
4269 d3d10_effect_matrix_variable_GetParentConstantBuffer,
4270 d3d10_effect_matrix_variable_AsScalar,
4271 d3d10_effect_matrix_variable_AsVector,
4272 d3d10_effect_matrix_variable_AsMatrix,
4273 d3d10_effect_matrix_variable_AsString,
4274 d3d10_effect_matrix_variable_AsShaderResource,
4275 d3d10_effect_matrix_variable_AsRenderTargetView,
4276 d3d10_effect_matrix_variable_AsDepthStencilView,
4277 d3d10_effect_matrix_variable_AsConstantBuffer,
4278 d3d10_effect_matrix_variable_AsShader,
4279 d3d10_effect_matrix_variable_AsBlend,
4280 d3d10_effect_matrix_variable_AsDepthStencil,
4281 d3d10_effect_matrix_variable_AsRasterizer,
4282 d3d10_effect_matrix_variable_AsSampler,
4283 d3d10_effect_matrix_variable_SetRawValue,
4284 d3d10_effect_matrix_variable_GetRawValue,
4285 /* ID3D10EffectMatrixVariable methods */
4286 d3d10_effect_matrix_variable_SetMatrix,
4287 d3d10_effect_matrix_variable_GetMatrix,
4288 d3d10_effect_matrix_variable_SetMatrixArray,
4289 d3d10_effect_matrix_variable_GetMatrixArray,
4290 d3d10_effect_matrix_variable_SetMatrixTranspose,
4291 d3d10_effect_matrix_variable_GetMatrixTranspose,
4292 d3d10_effect_matrix_variable_SetMatrixTransposeArray,
4293 d3d10_effect_matrix_variable_GetMatrixTransposeArray,
4296 /* ID3D10EffectVariable methods */
4298 static BOOL STDMETHODCALLTYPE d3d10_effect_string_variable_IsValid(ID3D10EffectStringVariable *iface)
4300 TRACE("iface %p\n", iface);
4302 return (struct d3d10_effect_variable *)iface != &null_string_variable;
4305 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_string_variable_GetType(
4306 ID3D10EffectStringVariable *iface)
4308 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4311 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetDesc(ID3D10EffectStringVariable *iface,
4312 D3D10_EFFECT_VARIABLE_DESC *desc)
4314 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4317 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetAnnotationByIndex(
4318 ID3D10EffectStringVariable *iface, UINT index)
4320 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4323 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetAnnotationByName(
4324 ID3D10EffectStringVariable *iface, LPCSTR name)
4326 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4329 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberByIndex(
4330 ID3D10EffectStringVariable *iface, UINT index)
4332 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4335 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberByName(
4336 ID3D10EffectStringVariable *iface, LPCSTR name)
4338 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4341 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberBySemantic(
4342 ID3D10EffectStringVariable *iface, LPCSTR semantic)
4344 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4347 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetElement(
4348 ID3D10EffectStringVariable *iface, UINT index)
4350 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4353 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_string_variable_GetParentConstantBuffer(
4354 ID3D10EffectStringVariable *iface)
4356 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4359 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsScalar(
4360 ID3D10EffectStringVariable *iface)
4362 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4365 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsVector(
4366 ID3D10EffectStringVariable *iface)
4368 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4371 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsMatrix(
4372 ID3D10EffectStringVariable *iface)
4374 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4377 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsString(
4378 ID3D10EffectStringVariable *iface)
4380 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4383 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsShaderResource(
4384 ID3D10EffectStringVariable *iface)
4386 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4389 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsRenderTargetView(
4390 ID3D10EffectStringVariable *iface)
4392 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4395 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsDepthStencilView(
4396 ID3D10EffectStringVariable *iface)
4398 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4401 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_string_variable_AsConstantBuffer(
4402 ID3D10EffectStringVariable *iface)
4404 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4407 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsShader(
4408 ID3D10EffectStringVariable *iface)
4410 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4413 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsBlend(
4414 ID3D10EffectStringVariable *iface)
4416 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4419 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsDepthStencil(
4420 ID3D10EffectStringVariable *iface)
4422 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4425 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsRasterizer(
4426 ID3D10EffectStringVariable *iface)
4428 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4431 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsSampler(
4432 ID3D10EffectStringVariable *iface)
4434 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4437 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_SetRawValue(ID3D10EffectStringVariable *iface,
4438 void *data, UINT offset, UINT count)
4440 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4443 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetRawValue(ID3D10EffectStringVariable *iface,
4444 void *data, UINT offset, UINT count)
4446 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4449 /* ID3D10EffectStringVariable methods */
4451 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetString(ID3D10EffectStringVariable *iface,
4452 LPCSTR *str)
4454 FIXME("iface %p, str %p stub!\n", iface, str);
4456 return E_NOTIMPL;
4459 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetStringArray(ID3D10EffectStringVariable *iface,
4460 LPCSTR *strs, UINT offset, UINT count)
4462 FIXME("iface %p, strs %p, offset %u, count %u stub!\n", iface, strs, offset, count);
4464 return E_NOTIMPL;
4468 static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl =
4470 /* ID3D10EffectVariable methods */
4471 d3d10_effect_string_variable_IsValid,
4472 d3d10_effect_string_variable_GetType,
4473 d3d10_effect_string_variable_GetDesc,
4474 d3d10_effect_string_variable_GetAnnotationByIndex,
4475 d3d10_effect_string_variable_GetAnnotationByName,
4476 d3d10_effect_string_variable_GetMemberByIndex,
4477 d3d10_effect_string_variable_GetMemberByName,
4478 d3d10_effect_string_variable_GetMemberBySemantic,
4479 d3d10_effect_string_variable_GetElement,
4480 d3d10_effect_string_variable_GetParentConstantBuffer,
4481 d3d10_effect_string_variable_AsScalar,
4482 d3d10_effect_string_variable_AsVector,
4483 d3d10_effect_string_variable_AsMatrix,
4484 d3d10_effect_string_variable_AsString,
4485 d3d10_effect_string_variable_AsShaderResource,
4486 d3d10_effect_string_variable_AsRenderTargetView,
4487 d3d10_effect_string_variable_AsDepthStencilView,
4488 d3d10_effect_string_variable_AsConstantBuffer,
4489 d3d10_effect_string_variable_AsShader,
4490 d3d10_effect_string_variable_AsBlend,
4491 d3d10_effect_string_variable_AsDepthStencil,
4492 d3d10_effect_string_variable_AsRasterizer,
4493 d3d10_effect_string_variable_AsSampler,
4494 d3d10_effect_string_variable_SetRawValue,
4495 d3d10_effect_string_variable_GetRawValue,
4496 /* ID3D10EffectStringVariable methods */
4497 d3d10_effect_string_variable_GetString,
4498 d3d10_effect_string_variable_GetStringArray,
4501 /* ID3D10EffectVariable methods */
4503 static BOOL STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_IsValid(ID3D10EffectShaderResourceVariable *iface)
4505 TRACE("iface %p\n", iface);
4507 return (struct d3d10_effect_variable *)iface != &null_shader_resource_variable;
4510 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetType(
4511 ID3D10EffectShaderResourceVariable *iface)
4513 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4516 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetDesc(
4517 ID3D10EffectShaderResourceVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
4519 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4522 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetAnnotationByIndex(
4523 ID3D10EffectShaderResourceVariable *iface, UINT index)
4525 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4528 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetAnnotationByName(
4529 ID3D10EffectShaderResourceVariable *iface, LPCSTR name)
4531 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4534 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberByIndex(
4535 ID3D10EffectShaderResourceVariable *iface, UINT index)
4537 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4540 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberByName(
4541 ID3D10EffectShaderResourceVariable *iface, LPCSTR name)
4543 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4546 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberBySemantic(
4547 ID3D10EffectShaderResourceVariable *iface, LPCSTR semantic)
4549 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4552 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetElement(
4553 ID3D10EffectShaderResourceVariable *iface, UINT index)
4555 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4558 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetParentConstantBuffer(
4559 ID3D10EffectShaderResourceVariable *iface)
4561 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4564 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsScalar(
4565 ID3D10EffectShaderResourceVariable *iface)
4567 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4570 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsVector(
4571 ID3D10EffectShaderResourceVariable *iface)
4573 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4576 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsMatrix(
4577 ID3D10EffectShaderResourceVariable *iface)
4579 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4582 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsString(
4583 ID3D10EffectShaderResourceVariable *iface)
4585 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4588 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsShaderResource(
4589 ID3D10EffectShaderResourceVariable *iface)
4591 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4594 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsRenderTargetView(
4595 ID3D10EffectShaderResourceVariable *iface)
4597 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4600 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsDepthStencilView(
4601 ID3D10EffectShaderResourceVariable *iface)
4603 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4606 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsConstantBuffer(
4607 ID3D10EffectShaderResourceVariable *iface)
4609 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4612 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsShader(
4613 ID3D10EffectShaderResourceVariable *iface)
4615 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4618 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsBlend(
4619 ID3D10EffectShaderResourceVariable *iface)
4621 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4624 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsDepthStencil(
4625 ID3D10EffectShaderResourceVariable *iface)
4627 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4630 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsRasterizer(
4631 ID3D10EffectShaderResourceVariable *iface)
4633 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4636 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsSampler(
4637 ID3D10EffectShaderResourceVariable *iface)
4639 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4642 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetRawValue(
4643 ID3D10EffectShaderResourceVariable *iface, void *data, UINT offset, UINT count)
4645 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4648 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetRawValue(
4649 ID3D10EffectShaderResourceVariable *iface, void *data, UINT offset, UINT count)
4651 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4654 /* ID3D10EffectShaderResourceVariable methods */
4656 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetResource(
4657 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView *resource)
4659 FIXME("iface %p, resource %p stub!\n", iface, resource);
4661 return E_NOTIMPL;
4664 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetResource(
4665 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resource)
4667 FIXME("iface %p, resource %p stub!\n", iface, resource);
4669 return E_NOTIMPL;
4672 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetResourceArray(
4673 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resources, UINT offset, UINT count)
4675 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface, resources, offset, count);
4677 return E_NOTIMPL;
4680 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetResourceArray(
4681 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resources, UINT offset, UINT count)
4683 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface, resources, offset, count);
4685 return E_NOTIMPL;
4689 static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl =
4691 /* ID3D10EffectVariable methods */
4692 d3d10_effect_shader_resource_variable_IsValid,
4693 d3d10_effect_shader_resource_variable_GetType,
4694 d3d10_effect_shader_resource_variable_GetDesc,
4695 d3d10_effect_shader_resource_variable_GetAnnotationByIndex,
4696 d3d10_effect_shader_resource_variable_GetAnnotationByName,
4697 d3d10_effect_shader_resource_variable_GetMemberByIndex,
4698 d3d10_effect_shader_resource_variable_GetMemberByName,
4699 d3d10_effect_shader_resource_variable_GetMemberBySemantic,
4700 d3d10_effect_shader_resource_variable_GetElement,
4701 d3d10_effect_shader_resource_variable_GetParentConstantBuffer,
4702 d3d10_effect_shader_resource_variable_AsScalar,
4703 d3d10_effect_shader_resource_variable_AsVector,
4704 d3d10_effect_shader_resource_variable_AsMatrix,
4705 d3d10_effect_shader_resource_variable_AsString,
4706 d3d10_effect_shader_resource_variable_AsShaderResource,
4707 d3d10_effect_shader_resource_variable_AsRenderTargetView,
4708 d3d10_effect_shader_resource_variable_AsDepthStencilView,
4709 d3d10_effect_shader_resource_variable_AsConstantBuffer,
4710 d3d10_effect_shader_resource_variable_AsShader,
4711 d3d10_effect_shader_resource_variable_AsBlend,
4712 d3d10_effect_shader_resource_variable_AsDepthStencil,
4713 d3d10_effect_shader_resource_variable_AsRasterizer,
4714 d3d10_effect_shader_resource_variable_AsSampler,
4715 d3d10_effect_shader_resource_variable_SetRawValue,
4716 d3d10_effect_shader_resource_variable_GetRawValue,
4717 /* ID3D10EffectShaderResourceVariable methods */
4718 d3d10_effect_shader_resource_variable_SetResource,
4719 d3d10_effect_shader_resource_variable_GetResource,
4720 d3d10_effect_shader_resource_variable_SetResourceArray,
4721 d3d10_effect_shader_resource_variable_GetResourceArray,
4724 /* ID3D10EffectVariable methods */
4726 static BOOL STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_IsValid(
4727 ID3D10EffectRenderTargetViewVariable *iface)
4729 TRACE("iface %p\n", iface);
4731 return (struct d3d10_effect_variable *)iface != &null_render_target_view_variable;
4734 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetType(
4735 ID3D10EffectRenderTargetViewVariable *iface)
4737 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4740 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetDesc(
4741 ID3D10EffectRenderTargetViewVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
4743 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4746 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetAnnotationByIndex(
4747 ID3D10EffectRenderTargetViewVariable *iface, UINT index)
4749 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4752 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetAnnotationByName(
4753 ID3D10EffectRenderTargetViewVariable *iface, LPCSTR name)
4755 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4758 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberByIndex(
4759 ID3D10EffectRenderTargetViewVariable *iface, UINT index)
4761 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4764 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberByName(
4765 ID3D10EffectRenderTargetViewVariable *iface, LPCSTR name)
4767 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4770 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberBySemantic(
4771 ID3D10EffectRenderTargetViewVariable *iface, LPCSTR semantic)
4773 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4776 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetElement(
4777 ID3D10EffectRenderTargetViewVariable *iface, UINT index)
4779 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4782 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetParentConstantBuffer(
4783 ID3D10EffectRenderTargetViewVariable *iface)
4785 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4788 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsScalar(
4789 ID3D10EffectRenderTargetViewVariable *iface)
4791 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4794 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsVector(
4795 ID3D10EffectRenderTargetViewVariable *iface)
4797 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4800 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsMatrix(
4801 ID3D10EffectRenderTargetViewVariable *iface)
4803 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4806 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsString(
4807 ID3D10EffectRenderTargetViewVariable *iface)
4809 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4812 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsShaderResource(
4813 ID3D10EffectRenderTargetViewVariable *iface)
4815 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4818 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsRenderTargetView(
4819 ID3D10EffectRenderTargetViewVariable *iface)
4821 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4824 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsDepthStencilView(
4825 ID3D10EffectRenderTargetViewVariable *iface)
4827 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4830 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsConstantBuffer(
4831 ID3D10EffectRenderTargetViewVariable *iface)
4833 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4836 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsShader(
4837 ID3D10EffectRenderTargetViewVariable *iface)
4839 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4842 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsBlend(
4843 ID3D10EffectRenderTargetViewVariable *iface)
4845 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4848 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsDepthStencil(
4849 ID3D10EffectRenderTargetViewVariable *iface)
4851 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4854 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsRasterizer(
4855 ID3D10EffectRenderTargetViewVariable *iface)
4857 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4860 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsSampler(
4861 ID3D10EffectRenderTargetViewVariable *iface)
4863 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4866 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRawValue(
4867 ID3D10EffectRenderTargetViewVariable *iface, void *data, UINT offset, UINT count)
4869 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4872 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRawValue(
4873 ID3D10EffectRenderTargetViewVariable *iface, void *data, UINT offset, UINT count)
4875 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4878 /* ID3D10EffectRenderTargetViewVariable methods */
4880 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRenderTarget(
4881 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView *view)
4883 FIXME("iface %p, view %p stub!\n", iface, view);
4885 return E_NOTIMPL;
4888 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRenderTarget(
4889 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **view)
4891 FIXME("iface %p, view %p stub!\n", iface, view);
4893 return E_NOTIMPL;
4896 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRenderTargetArray(
4897 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **views, UINT offset, UINT count)
4899 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
4901 return E_NOTIMPL;
4904 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRenderTargetArray(
4905 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **views, UINT offset, UINT count)
4907 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
4909 return E_NOTIMPL;
4913 static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl =
4915 /* ID3D10EffectVariable methods */
4916 d3d10_effect_render_target_view_variable_IsValid,
4917 d3d10_effect_render_target_view_variable_GetType,
4918 d3d10_effect_render_target_view_variable_GetDesc,
4919 d3d10_effect_render_target_view_variable_GetAnnotationByIndex,
4920 d3d10_effect_render_target_view_variable_GetAnnotationByName,
4921 d3d10_effect_render_target_view_variable_GetMemberByIndex,
4922 d3d10_effect_render_target_view_variable_GetMemberByName,
4923 d3d10_effect_render_target_view_variable_GetMemberBySemantic,
4924 d3d10_effect_render_target_view_variable_GetElement,
4925 d3d10_effect_render_target_view_variable_GetParentConstantBuffer,
4926 d3d10_effect_render_target_view_variable_AsScalar,
4927 d3d10_effect_render_target_view_variable_AsVector,
4928 d3d10_effect_render_target_view_variable_AsMatrix,
4929 d3d10_effect_render_target_view_variable_AsString,
4930 d3d10_effect_render_target_view_variable_AsShaderResource,
4931 d3d10_effect_render_target_view_variable_AsRenderTargetView,
4932 d3d10_effect_render_target_view_variable_AsDepthStencilView,
4933 d3d10_effect_render_target_view_variable_AsConstantBuffer,
4934 d3d10_effect_render_target_view_variable_AsShader,
4935 d3d10_effect_render_target_view_variable_AsBlend,
4936 d3d10_effect_render_target_view_variable_AsDepthStencil,
4937 d3d10_effect_render_target_view_variable_AsRasterizer,
4938 d3d10_effect_render_target_view_variable_AsSampler,
4939 d3d10_effect_render_target_view_variable_SetRawValue,
4940 d3d10_effect_render_target_view_variable_GetRawValue,
4941 /* ID3D10EffectRenderTargetViewVariable methods */
4942 d3d10_effect_render_target_view_variable_SetRenderTarget,
4943 d3d10_effect_render_target_view_variable_GetRenderTarget,
4944 d3d10_effect_render_target_view_variable_SetRenderTargetArray,
4945 d3d10_effect_render_target_view_variable_GetRenderTargetArray,
4948 /* ID3D10EffectVariable methods */
4950 static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_IsValid(
4951 ID3D10EffectDepthStencilViewVariable *iface)
4953 TRACE("iface %p\n", iface);
4955 return (struct d3d10_effect_variable *)iface != &null_depth_stencil_view_variable;
4958 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetType(
4959 ID3D10EffectDepthStencilViewVariable *iface)
4961 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4964 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDesc(
4965 ID3D10EffectDepthStencilViewVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
4967 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4970 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex(
4971 ID3D10EffectDepthStencilViewVariable *iface, UINT index)
4973 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4976 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetAnnotationByName(
4977 ID3D10EffectDepthStencilViewVariable *iface, LPCSTR name)
4979 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4982 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberByIndex(
4983 ID3D10EffectDepthStencilViewVariable *iface, UINT index)
4985 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4988 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberByName(
4989 ID3D10EffectDepthStencilViewVariable *iface, LPCSTR name)
4991 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4994 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic(
4995 ID3D10EffectDepthStencilViewVariable *iface, LPCSTR semantic)
4997 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5000 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetElement(
5001 ID3D10EffectDepthStencilViewVariable *iface, UINT index)
5003 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5006 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer(
5007 ID3D10EffectDepthStencilViewVariable *iface)
5009 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5012 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsScalar(
5013 ID3D10EffectDepthStencilViewVariable *iface)
5015 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5018 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsVector(
5019 ID3D10EffectDepthStencilViewVariable *iface)
5021 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5024 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsMatrix(
5025 ID3D10EffectDepthStencilViewVariable *iface)
5027 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5030 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsString(
5031 ID3D10EffectDepthStencilViewVariable *iface)
5033 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5036 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsShaderResource(
5037 ID3D10EffectDepthStencilViewVariable *iface)
5039 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5042 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsRenderTargetView(
5043 ID3D10EffectDepthStencilViewVariable *iface)
5045 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5048 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsDepthStencilView(
5049 ID3D10EffectDepthStencilViewVariable *iface)
5051 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5054 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsConstantBuffer(
5055 ID3D10EffectDepthStencilViewVariable *iface)
5057 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5060 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsShader(
5061 ID3D10EffectDepthStencilViewVariable *iface)
5063 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5066 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsBlend(
5067 ID3D10EffectDepthStencilViewVariable *iface)
5069 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5072 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsDepthStencil(
5073 ID3D10EffectDepthStencilViewVariable *iface)
5075 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5078 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsRasterizer(
5079 ID3D10EffectDepthStencilViewVariable *iface)
5081 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5084 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsSampler(
5085 ID3D10EffectDepthStencilViewVariable *iface)
5087 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5090 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetRawValue(
5091 ID3D10EffectDepthStencilViewVariable *iface, void *data, UINT offset, UINT count)
5093 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5096 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetRawValue(
5097 ID3D10EffectDepthStencilViewVariable *iface, void *data, UINT offset, UINT count)
5099 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5102 /* ID3D10EffectDepthStencilViewVariable methods */
5104 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetDepthStencil(
5105 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView *view)
5107 FIXME("iface %p, view %p stub!\n", iface, view);
5109 return E_NOTIMPL;
5112 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDepthStencil(
5113 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **view)
5115 FIXME("iface %p, view %p stub!\n", iface, view);
5117 return E_NOTIMPL;
5120 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray(
5121 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **views, UINT offset, UINT count)
5123 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
5125 return E_NOTIMPL;
5128 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray(
5129 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **views, UINT offset, UINT count)
5131 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
5133 return E_NOTIMPL;
5137 static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl =
5139 /* ID3D10EffectVariable methods */
5140 d3d10_effect_depth_stencil_view_variable_IsValid,
5141 d3d10_effect_depth_stencil_view_variable_GetType,
5142 d3d10_effect_depth_stencil_view_variable_GetDesc,
5143 d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex,
5144 d3d10_effect_depth_stencil_view_variable_GetAnnotationByName,
5145 d3d10_effect_depth_stencil_view_variable_GetMemberByIndex,
5146 d3d10_effect_depth_stencil_view_variable_GetMemberByName,
5147 d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic,
5148 d3d10_effect_depth_stencil_view_variable_GetElement,
5149 d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer,
5150 d3d10_effect_depth_stencil_view_variable_AsScalar,
5151 d3d10_effect_depth_stencil_view_variable_AsVector,
5152 d3d10_effect_depth_stencil_view_variable_AsMatrix,
5153 d3d10_effect_depth_stencil_view_variable_AsString,
5154 d3d10_effect_depth_stencil_view_variable_AsShaderResource,
5155 d3d10_effect_depth_stencil_view_variable_AsRenderTargetView,
5156 d3d10_effect_depth_stencil_view_variable_AsDepthStencilView,
5157 d3d10_effect_depth_stencil_view_variable_AsConstantBuffer,
5158 d3d10_effect_depth_stencil_view_variable_AsShader,
5159 d3d10_effect_depth_stencil_view_variable_AsBlend,
5160 d3d10_effect_depth_stencil_view_variable_AsDepthStencil,
5161 d3d10_effect_depth_stencil_view_variable_AsRasterizer,
5162 d3d10_effect_depth_stencil_view_variable_AsSampler,
5163 d3d10_effect_depth_stencil_view_variable_SetRawValue,
5164 d3d10_effect_depth_stencil_view_variable_GetRawValue,
5165 /* ID3D10EffectDepthStencilViewVariable methods */
5166 d3d10_effect_depth_stencil_view_variable_SetDepthStencil,
5167 d3d10_effect_depth_stencil_view_variable_GetDepthStencil,
5168 d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray,
5169 d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray,
5172 /* ID3D10EffectVariable methods */
5174 static BOOL STDMETHODCALLTYPE d3d10_effect_shader_variable_IsValid(ID3D10EffectShaderVariable *iface)
5176 TRACE("iface %p\n", iface);
5178 return (struct d3d10_effect_variable *)iface != &null_shader_variable;
5181 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetType(
5182 ID3D10EffectShaderVariable *iface)
5184 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5187 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetDesc(ID3D10EffectShaderVariable *iface,
5188 D3D10_EFFECT_VARIABLE_DESC *desc)
5190 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5193 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetAnnotationByIndex(
5194 ID3D10EffectShaderVariable *iface, UINT index)
5196 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5199 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetAnnotationByName(
5200 ID3D10EffectShaderVariable *iface, LPCSTR name)
5202 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5205 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberByIndex(
5206 ID3D10EffectShaderVariable *iface, UINT index)
5208 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5211 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberByName(
5212 ID3D10EffectShaderVariable *iface, LPCSTR name)
5214 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5217 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberBySemantic(
5218 ID3D10EffectShaderVariable *iface, LPCSTR semantic)
5220 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5223 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetElement(
5224 ID3D10EffectShaderVariable *iface, UINT index)
5226 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5229 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetParentConstantBuffer(
5230 ID3D10EffectShaderVariable *iface)
5232 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5235 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsScalar(
5236 ID3D10EffectShaderVariable *iface)
5238 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5241 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsVector(
5242 ID3D10EffectShaderVariable *iface)
5244 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5247 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsMatrix(
5248 ID3D10EffectShaderVariable *iface)
5250 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5253 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsString(
5254 ID3D10EffectShaderVariable *iface)
5256 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5259 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsShaderResource(
5260 ID3D10EffectShaderVariable *iface)
5262 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5265 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsRenderTargetView(
5266 ID3D10EffectShaderVariable *iface)
5268 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5271 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsDepthStencilView(
5272 ID3D10EffectShaderVariable *iface)
5274 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5277 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsConstantBuffer(
5278 ID3D10EffectShaderVariable *iface)
5280 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5283 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsShader(
5284 ID3D10EffectShaderVariable *iface)
5286 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5289 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsBlend(
5290 ID3D10EffectShaderVariable *iface)
5292 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5295 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsDepthStencil(
5296 ID3D10EffectShaderVariable *iface)
5298 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5301 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsRasterizer(
5302 ID3D10EffectShaderVariable *iface)
5304 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5307 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsSampler(
5308 ID3D10EffectShaderVariable *iface)
5310 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5313 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_SetRawValue(
5314 ID3D10EffectShaderVariable *iface, void *data, UINT offset, UINT count)
5316 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5319 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetRawValue(
5320 ID3D10EffectShaderVariable *iface, void *data, UINT offset, UINT count)
5322 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5325 /* ID3D10EffectShaderVariable methods */
5327 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetShaderDesc(
5328 ID3D10EffectShaderVariable *iface, UINT index, D3D10_EFFECT_SHADER_DESC *desc)
5330 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5332 return E_NOTIMPL;
5335 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetVertexShader(
5336 ID3D10EffectShaderVariable *iface, UINT index, ID3D10VertexShader **shader)
5338 FIXME("iface %p, index %u, shader %p stub!\n", iface, index, shader);
5340 return E_NOTIMPL;
5343 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetGeometryShader(
5344 ID3D10EffectShaderVariable *iface, UINT index, ID3D10GeometryShader **shader)
5346 FIXME("iface %p, index %u, shader %p stub!\n", iface, index, shader);
5348 return E_NOTIMPL;
5351 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetPixelShader(
5352 ID3D10EffectShaderVariable *iface, UINT index, ID3D10PixelShader **shader)
5354 FIXME("iface %p, index %u, shader %p stub!\n", iface, index, shader);
5356 return E_NOTIMPL;
5359 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetInputSignatureElementDesc(
5360 ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index,
5361 D3D10_SIGNATURE_PARAMETER_DESC *desc)
5363 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
5364 struct d3d10_effect_shader_variable *s;
5365 D3D10_SIGNATURE_PARAMETER_DESC *d;
5367 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5368 iface, shader_index, element_index, desc);
5370 if (!iface->lpVtbl->IsValid(iface))
5372 WARN("Null variable specified\n");
5373 return E_FAIL;
5376 /* Check shader_index, this crashes on W7/DX10 */
5377 if (shader_index >= This->effect->used_shader_count)
5379 WARN("This should crash on W7/DX10!\n");
5380 return E_FAIL;
5383 s = This->effect->used_shaders[shader_index]->data;
5384 if (!s->input_signature.signature)
5386 WARN("No shader signature\n");
5387 return D3DERR_INVALIDCALL;
5390 /* Check desc for NULL, this crashes on W7/DX10 */
5391 if (!desc)
5393 WARN("This should crash on W7/DX10!\n");
5394 return E_FAIL;
5397 if (element_index >= s->input_signature.element_count)
5399 WARN("Invalid element index specified\n");
5400 return E_INVALIDARG;
5403 d = &s->input_signature.elements[element_index];
5404 desc->SemanticName = d->SemanticName;
5405 desc->SemanticIndex = d->SemanticIndex;
5406 desc->SystemValueType = d->SystemValueType;
5407 desc->ComponentType = d->ComponentType;
5408 desc->Register = d->Register;
5409 desc->ReadWriteMask = d->ReadWriteMask;
5410 desc->Mask = d->Mask;
5412 return S_OK;
5415 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetOutputSignatureElementDesc(
5416 ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index,
5417 D3D10_SIGNATURE_PARAMETER_DESC *desc)
5419 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
5420 struct d3d10_effect_shader_variable *s;
5421 D3D10_SIGNATURE_PARAMETER_DESC *d;
5423 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5424 iface, shader_index, element_index, desc);
5426 if (!iface->lpVtbl->IsValid(iface))
5428 WARN("Null variable specified\n");
5429 return E_FAIL;
5432 /* Check shader_index, this crashes on W7/DX10 */
5433 if (shader_index >= This->effect->used_shader_count)
5435 WARN("This should crash on W7/DX10!\n");
5436 return E_FAIL;
5439 s = This->effect->used_shaders[shader_index]->data;
5440 if (!s->output_signature.signature)
5442 WARN("No shader signature\n");
5443 return D3DERR_INVALIDCALL;
5446 /* Check desc for NULL, this crashes on W7/DX10 */
5447 if (!desc)
5449 WARN("This should crash on W7/DX10!\n");
5450 return E_FAIL;
5453 if (element_index >= s->output_signature.element_count)
5455 WARN("Invalid element index specified\n");
5456 return E_INVALIDARG;
5459 d = &s->output_signature.elements[element_index];
5460 desc->SemanticName = d->SemanticName;
5461 desc->SemanticIndex = d->SemanticIndex;
5462 desc->SystemValueType = d->SystemValueType;
5463 desc->ComponentType = d->ComponentType;
5464 desc->Register = d->Register;
5465 desc->ReadWriteMask = d->ReadWriteMask;
5466 desc->Mask = d->Mask;
5468 return S_OK;
5472 static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl =
5474 /* ID3D10EffectVariable methods */
5475 d3d10_effect_shader_variable_IsValid,
5476 d3d10_effect_shader_variable_GetType,
5477 d3d10_effect_shader_variable_GetDesc,
5478 d3d10_effect_shader_variable_GetAnnotationByIndex,
5479 d3d10_effect_shader_variable_GetAnnotationByName,
5480 d3d10_effect_shader_variable_GetMemberByIndex,
5481 d3d10_effect_shader_variable_GetMemberByName,
5482 d3d10_effect_shader_variable_GetMemberBySemantic,
5483 d3d10_effect_shader_variable_GetElement,
5484 d3d10_effect_shader_variable_GetParentConstantBuffer,
5485 d3d10_effect_shader_variable_AsScalar,
5486 d3d10_effect_shader_variable_AsVector,
5487 d3d10_effect_shader_variable_AsMatrix,
5488 d3d10_effect_shader_variable_AsString,
5489 d3d10_effect_shader_variable_AsShaderResource,
5490 d3d10_effect_shader_variable_AsRenderTargetView,
5491 d3d10_effect_shader_variable_AsDepthStencilView,
5492 d3d10_effect_shader_variable_AsConstantBuffer,
5493 d3d10_effect_shader_variable_AsShader,
5494 d3d10_effect_shader_variable_AsBlend,
5495 d3d10_effect_shader_variable_AsDepthStencil,
5496 d3d10_effect_shader_variable_AsRasterizer,
5497 d3d10_effect_shader_variable_AsSampler,
5498 d3d10_effect_shader_variable_SetRawValue,
5499 d3d10_effect_shader_variable_GetRawValue,
5500 /* ID3D10EffectShaderVariable methods */
5501 d3d10_effect_shader_variable_GetShaderDesc,
5502 d3d10_effect_shader_variable_GetVertexShader,
5503 d3d10_effect_shader_variable_GetGeometryShader,
5504 d3d10_effect_shader_variable_GetPixelShader,
5505 d3d10_effect_shader_variable_GetInputSignatureElementDesc,
5506 d3d10_effect_shader_variable_GetOutputSignatureElementDesc,
5509 /* ID3D10EffectVariable methods */
5511 static BOOL STDMETHODCALLTYPE d3d10_effect_blend_variable_IsValid(ID3D10EffectBlendVariable *iface)
5513 TRACE("iface %p\n", iface);
5515 return (struct d3d10_effect_variable *)iface != &null_blend_variable;
5518 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetType(
5519 ID3D10EffectBlendVariable *iface)
5521 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5524 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetDesc(ID3D10EffectBlendVariable *iface,
5525 D3D10_EFFECT_VARIABLE_DESC *desc)
5527 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5530 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetAnnotationByIndex(
5531 ID3D10EffectBlendVariable *iface, UINT index)
5533 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5536 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetAnnotationByName(
5537 ID3D10EffectBlendVariable *iface, LPCSTR name)
5539 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5542 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberByIndex(
5543 ID3D10EffectBlendVariable *iface, UINT index)
5545 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5548 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberByName(
5549 ID3D10EffectBlendVariable *iface, LPCSTR name)
5551 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5554 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberBySemantic(
5555 ID3D10EffectBlendVariable *iface, LPCSTR semantic)
5557 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5560 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetElement(
5561 ID3D10EffectBlendVariable *iface, UINT index)
5563 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5566 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetParentConstantBuffer(
5567 ID3D10EffectBlendVariable *iface)
5569 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5572 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsScalar(
5573 ID3D10EffectBlendVariable *iface)
5575 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5578 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsVector(
5579 ID3D10EffectBlendVariable *iface)
5581 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5584 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsMatrix(
5585 ID3D10EffectBlendVariable *iface)
5587 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5590 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsString(
5591 ID3D10EffectBlendVariable *iface)
5593 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5596 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsShaderResource(
5597 ID3D10EffectBlendVariable *iface)
5599 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5602 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsRenderTargetView(
5603 ID3D10EffectBlendVariable *iface)
5605 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5608 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsDepthStencilView(
5609 ID3D10EffectBlendVariable *iface)
5611 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5614 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsConstantBuffer(
5615 ID3D10EffectBlendVariable *iface)
5617 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5620 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsShader(
5621 ID3D10EffectBlendVariable *iface)
5623 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5626 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsBlend(
5627 ID3D10EffectBlendVariable *iface)
5629 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5632 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsDepthStencil(
5633 ID3D10EffectBlendVariable *iface)
5635 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5638 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsRasterizer(
5639 ID3D10EffectBlendVariable *iface)
5641 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5644 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsSampler(
5645 ID3D10EffectBlendVariable *iface)
5647 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5650 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_SetRawValue(ID3D10EffectBlendVariable *iface,
5651 void *data, UINT offset, UINT count)
5653 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5656 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetRawValue(ID3D10EffectBlendVariable *iface,
5657 void *data, UINT offset, UINT count)
5659 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5662 /* ID3D10EffectBlendVariable methods */
5664 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBlendState(ID3D10EffectBlendVariable *iface,
5665 UINT index, ID3D10BlendState **blend_state)
5667 FIXME("iface %p, index %u, blend_state %p stub!\n", iface, index, blend_state);
5669 return E_NOTIMPL;
5672 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBackingStore(ID3D10EffectBlendVariable *iface,
5673 UINT index, D3D10_BLEND_DESC *desc)
5675 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5677 return E_NOTIMPL;
5681 static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl =
5683 /* ID3D10EffectVariable methods */
5684 d3d10_effect_blend_variable_IsValid,
5685 d3d10_effect_blend_variable_GetType,
5686 d3d10_effect_blend_variable_GetDesc,
5687 d3d10_effect_blend_variable_GetAnnotationByIndex,
5688 d3d10_effect_blend_variable_GetAnnotationByName,
5689 d3d10_effect_blend_variable_GetMemberByIndex,
5690 d3d10_effect_blend_variable_GetMemberByName,
5691 d3d10_effect_blend_variable_GetMemberBySemantic,
5692 d3d10_effect_blend_variable_GetElement,
5693 d3d10_effect_blend_variable_GetParentConstantBuffer,
5694 d3d10_effect_blend_variable_AsScalar,
5695 d3d10_effect_blend_variable_AsVector,
5696 d3d10_effect_blend_variable_AsMatrix,
5697 d3d10_effect_blend_variable_AsString,
5698 d3d10_effect_blend_variable_AsShaderResource,
5699 d3d10_effect_blend_variable_AsRenderTargetView,
5700 d3d10_effect_blend_variable_AsDepthStencilView,
5701 d3d10_effect_blend_variable_AsConstantBuffer,
5702 d3d10_effect_blend_variable_AsShader,
5703 d3d10_effect_blend_variable_AsBlend,
5704 d3d10_effect_blend_variable_AsDepthStencil,
5705 d3d10_effect_blend_variable_AsRasterizer,
5706 d3d10_effect_blend_variable_AsSampler,
5707 d3d10_effect_blend_variable_SetRawValue,
5708 d3d10_effect_blend_variable_GetRawValue,
5709 /* ID3D10EffectBlendVariable methods */
5710 d3d10_effect_blend_variable_GetBlendState,
5711 d3d10_effect_blend_variable_GetBackingStore,
5714 /* ID3D10EffectVariable methods */
5716 static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_IsValid(ID3D10EffectDepthStencilVariable *iface)
5718 TRACE("iface %p\n", iface);
5720 return (struct d3d10_effect_variable *)iface != &null_depth_stencil_variable;
5723 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetType(
5724 ID3D10EffectDepthStencilVariable *iface)
5726 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5729 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetDesc(ID3D10EffectDepthStencilVariable *iface,
5730 D3D10_EFFECT_VARIABLE_DESC *desc)
5732 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5735 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetAnnotationByIndex(
5736 ID3D10EffectDepthStencilVariable *iface, UINT index)
5738 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5741 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetAnnotationByName(
5742 ID3D10EffectDepthStencilVariable *iface, LPCSTR name)
5744 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5747 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberByIndex(
5748 ID3D10EffectDepthStencilVariable *iface, UINT index)
5750 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5753 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberByName(
5754 ID3D10EffectDepthStencilVariable *iface, LPCSTR name)
5756 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5759 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberBySemantic(
5760 ID3D10EffectDepthStencilVariable *iface, LPCSTR semantic)
5762 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5765 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetElement(
5766 ID3D10EffectDepthStencilVariable *iface, UINT index)
5768 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5771 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetParentConstantBuffer(
5772 ID3D10EffectDepthStencilVariable *iface)
5774 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5777 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsScalar(
5778 ID3D10EffectDepthStencilVariable *iface)
5780 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5783 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsVector(
5784 ID3D10EffectDepthStencilVariable *iface)
5786 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5789 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsMatrix(
5790 ID3D10EffectDepthStencilVariable *iface)
5792 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5795 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsString(
5796 ID3D10EffectDepthStencilVariable *iface)
5798 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5801 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsShaderResource(
5802 ID3D10EffectDepthStencilVariable *iface)
5804 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5807 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsRenderTargetView(
5808 ID3D10EffectDepthStencilVariable *iface)
5810 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5813 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsDepthStencilView(
5814 ID3D10EffectDepthStencilVariable *iface)
5816 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5819 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsConstantBuffer(
5820 ID3D10EffectDepthStencilVariable *iface)
5822 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5825 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsShader(
5826 ID3D10EffectDepthStencilVariable *iface)
5828 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5831 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsBlend(
5832 ID3D10EffectDepthStencilVariable *iface)
5834 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5837 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsDepthStencil(
5838 ID3D10EffectDepthStencilVariable *iface)
5840 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5843 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsRasterizer(
5844 ID3D10EffectDepthStencilVariable *iface)
5846 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5849 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsSampler(
5850 ID3D10EffectDepthStencilVariable *iface)
5852 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5855 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_SetRawValue(ID3D10EffectDepthStencilVariable *iface,
5856 void *data, UINT offset, UINT count)
5858 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5861 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetRawValue(ID3D10EffectDepthStencilVariable *iface,
5862 void *data, UINT offset, UINT count)
5864 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5867 /* ID3D10EffectDepthStencilVariable methods */
5869 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetDepthStencilState(ID3D10EffectDepthStencilVariable *iface,
5870 UINT index, ID3D10DepthStencilState **depth_stencil_state)
5872 FIXME("iface %p, index %u, depth_stencil_state %p stub!\n", iface, index, depth_stencil_state);
5874 return E_NOTIMPL;
5877 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetBackingStore(ID3D10EffectDepthStencilVariable *iface,
5878 UINT index, D3D10_DEPTH_STENCIL_DESC *desc)
5880 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5882 return E_NOTIMPL;
5886 static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl =
5888 /* ID3D10EffectVariable methods */
5889 d3d10_effect_depth_stencil_variable_IsValid,
5890 d3d10_effect_depth_stencil_variable_GetType,
5891 d3d10_effect_depth_stencil_variable_GetDesc,
5892 d3d10_effect_depth_stencil_variable_GetAnnotationByIndex,
5893 d3d10_effect_depth_stencil_variable_GetAnnotationByName,
5894 d3d10_effect_depth_stencil_variable_GetMemberByIndex,
5895 d3d10_effect_depth_stencil_variable_GetMemberByName,
5896 d3d10_effect_depth_stencil_variable_GetMemberBySemantic,
5897 d3d10_effect_depth_stencil_variable_GetElement,
5898 d3d10_effect_depth_stencil_variable_GetParentConstantBuffer,
5899 d3d10_effect_depth_stencil_variable_AsScalar,
5900 d3d10_effect_depth_stencil_variable_AsVector,
5901 d3d10_effect_depth_stencil_variable_AsMatrix,
5902 d3d10_effect_depth_stencil_variable_AsString,
5903 d3d10_effect_depth_stencil_variable_AsShaderResource,
5904 d3d10_effect_depth_stencil_variable_AsRenderTargetView,
5905 d3d10_effect_depth_stencil_variable_AsDepthStencilView,
5906 d3d10_effect_depth_stencil_variable_AsConstantBuffer,
5907 d3d10_effect_depth_stencil_variable_AsShader,
5908 d3d10_effect_depth_stencil_variable_AsBlend,
5909 d3d10_effect_depth_stencil_variable_AsDepthStencil,
5910 d3d10_effect_depth_stencil_variable_AsRasterizer,
5911 d3d10_effect_depth_stencil_variable_AsSampler,
5912 d3d10_effect_depth_stencil_variable_SetRawValue,
5913 d3d10_effect_depth_stencil_variable_GetRawValue,
5914 /* ID3D10EffectDepthStencilVariable methods */
5915 d3d10_effect_depth_stencil_variable_GetDepthStencilState,
5916 d3d10_effect_depth_stencil_variable_GetBackingStore,
5919 /* ID3D10EffectVariable methods */
5921 static BOOL STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_IsValid(ID3D10EffectRasterizerVariable *iface)
5923 TRACE("iface %p\n", iface);
5925 return (struct d3d10_effect_variable *)iface != &null_rasterizer_variable;
5928 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetType(
5929 ID3D10EffectRasterizerVariable *iface)
5931 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5934 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetDesc(ID3D10EffectRasterizerVariable *iface,
5935 D3D10_EFFECT_VARIABLE_DESC *desc)
5937 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5940 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetAnnotationByIndex(
5941 ID3D10EffectRasterizerVariable *iface, UINT index)
5943 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5946 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetAnnotationByName(
5947 ID3D10EffectRasterizerVariable *iface, LPCSTR name)
5949 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5952 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberByIndex(
5953 ID3D10EffectRasterizerVariable *iface, UINT index)
5955 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5958 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberByName(
5959 ID3D10EffectRasterizerVariable *iface, LPCSTR name)
5961 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5964 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberBySemantic(
5965 ID3D10EffectRasterizerVariable *iface, LPCSTR semantic)
5967 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5970 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetElement(
5971 ID3D10EffectRasterizerVariable *iface, UINT index)
5973 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5976 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetParentConstantBuffer(
5977 ID3D10EffectRasterizerVariable *iface)
5979 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5982 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsScalar(
5983 ID3D10EffectRasterizerVariable *iface)
5985 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5988 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsVector(
5989 ID3D10EffectRasterizerVariable *iface)
5991 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5994 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsMatrix(
5995 ID3D10EffectRasterizerVariable *iface)
5997 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
6000 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsString(
6001 ID3D10EffectRasterizerVariable *iface)
6003 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
6006 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsShaderResource(
6007 ID3D10EffectRasterizerVariable *iface)
6009 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
6012 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsRenderTargetView(
6013 ID3D10EffectRasterizerVariable *iface)
6015 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
6018 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsDepthStencilView(
6019 ID3D10EffectRasterizerVariable *iface)
6021 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
6024 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsConstantBuffer(
6025 ID3D10EffectRasterizerVariable *iface)
6027 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
6030 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsShader(
6031 ID3D10EffectRasterizerVariable *iface)
6033 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
6036 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsBlend(
6037 ID3D10EffectRasterizerVariable *iface)
6039 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
6042 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsDepthStencil(
6043 ID3D10EffectRasterizerVariable *iface)
6045 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
6048 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsRasterizer(
6049 ID3D10EffectRasterizerVariable *iface)
6051 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
6054 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsSampler(
6055 ID3D10EffectRasterizerVariable *iface)
6057 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
6060 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_SetRawValue(ID3D10EffectRasterizerVariable *iface,
6061 void *data, UINT offset, UINT count)
6063 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6066 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetRawValue(ID3D10EffectRasterizerVariable *iface,
6067 void *data, UINT offset, UINT count)
6069 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6072 /* ID3D10EffectRasterizerVariable methods */
6074 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetRasterizerState(ID3D10EffectRasterizerVariable *iface,
6075 UINT index, ID3D10RasterizerState **rasterizer_state)
6077 FIXME("iface %p, index %u, rasterizer_state %p stub!\n", iface, index, rasterizer_state);
6079 return E_NOTIMPL;
6082 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetBackingStore(ID3D10EffectRasterizerVariable *iface,
6083 UINT index, D3D10_RASTERIZER_DESC *desc)
6085 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
6087 return E_NOTIMPL;
6091 static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl =
6093 /* ID3D10EffectVariable methods */
6094 d3d10_effect_rasterizer_variable_IsValid,
6095 d3d10_effect_rasterizer_variable_GetType,
6096 d3d10_effect_rasterizer_variable_GetDesc,
6097 d3d10_effect_rasterizer_variable_GetAnnotationByIndex,
6098 d3d10_effect_rasterizer_variable_GetAnnotationByName,
6099 d3d10_effect_rasterizer_variable_GetMemberByIndex,
6100 d3d10_effect_rasterizer_variable_GetMemberByName,
6101 d3d10_effect_rasterizer_variable_GetMemberBySemantic,
6102 d3d10_effect_rasterizer_variable_GetElement,
6103 d3d10_effect_rasterizer_variable_GetParentConstantBuffer,
6104 d3d10_effect_rasterizer_variable_AsScalar,
6105 d3d10_effect_rasterizer_variable_AsVector,
6106 d3d10_effect_rasterizer_variable_AsMatrix,
6107 d3d10_effect_rasterizer_variable_AsString,
6108 d3d10_effect_rasterizer_variable_AsShaderResource,
6109 d3d10_effect_rasterizer_variable_AsRenderTargetView,
6110 d3d10_effect_rasterizer_variable_AsDepthStencilView,
6111 d3d10_effect_rasterizer_variable_AsConstantBuffer,
6112 d3d10_effect_rasterizer_variable_AsShader,
6113 d3d10_effect_rasterizer_variable_AsBlend,
6114 d3d10_effect_rasterizer_variable_AsDepthStencil,
6115 d3d10_effect_rasterizer_variable_AsRasterizer,
6116 d3d10_effect_rasterizer_variable_AsSampler,
6117 d3d10_effect_rasterizer_variable_SetRawValue,
6118 d3d10_effect_rasterizer_variable_GetRawValue,
6119 /* ID3D10EffectRasterizerVariable methods */
6120 d3d10_effect_rasterizer_variable_GetRasterizerState,
6121 d3d10_effect_rasterizer_variable_GetBackingStore,
6124 /* ID3D10EffectVariable methods */
6126 static BOOL STDMETHODCALLTYPE d3d10_effect_sampler_variable_IsValid(ID3D10EffectSamplerVariable *iface)
6128 TRACE("iface %p\n", iface);
6130 return (struct d3d10_effect_variable *)iface != &null_sampler_variable;
6133 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetType(
6134 ID3D10EffectSamplerVariable *iface)
6136 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
6139 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetDesc(ID3D10EffectSamplerVariable *iface,
6140 D3D10_EFFECT_VARIABLE_DESC *desc)
6142 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
6145 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetAnnotationByIndex(
6146 ID3D10EffectSamplerVariable *iface, UINT index)
6148 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
6151 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetAnnotationByName(
6152 ID3D10EffectSamplerVariable *iface, LPCSTR name)
6154 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
6157 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberByIndex(
6158 ID3D10EffectSamplerVariable *iface, UINT index)
6160 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
6163 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberByName(
6164 ID3D10EffectSamplerVariable *iface, LPCSTR name)
6166 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
6169 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberBySemantic(
6170 ID3D10EffectSamplerVariable *iface, LPCSTR semantic)
6172 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
6175 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetElement(
6176 ID3D10EffectSamplerVariable *iface, UINT index)
6178 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
6181 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetParentConstantBuffer(
6182 ID3D10EffectSamplerVariable *iface)
6184 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
6187 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsScalar(
6188 ID3D10EffectSamplerVariable *iface)
6190 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
6193 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsVector(
6194 ID3D10EffectSamplerVariable *iface)
6196 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
6199 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsMatrix(
6200 ID3D10EffectSamplerVariable *iface)
6202 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
6205 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsString(
6206 ID3D10EffectSamplerVariable *iface)
6208 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
6211 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsShaderResource(
6212 ID3D10EffectSamplerVariable *iface)
6214 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
6217 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsRenderTargetView(
6218 ID3D10EffectSamplerVariable *iface)
6220 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
6223 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsDepthStencilView(
6224 ID3D10EffectSamplerVariable *iface)
6226 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
6229 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsConstantBuffer(
6230 ID3D10EffectSamplerVariable *iface)
6232 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
6235 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsShader(
6236 ID3D10EffectSamplerVariable *iface)
6238 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
6241 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsBlend(
6242 ID3D10EffectSamplerVariable *iface)
6244 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
6247 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsDepthStencil(
6248 ID3D10EffectSamplerVariable *iface)
6250 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
6253 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsRasterizer(
6254 ID3D10EffectSamplerVariable *iface)
6256 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
6259 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsSampler(
6260 ID3D10EffectSamplerVariable *iface)
6262 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
6265 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_SetRawValue(ID3D10EffectSamplerVariable *iface,
6266 void *data, UINT offset, UINT count)
6268 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6271 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetRawValue(ID3D10EffectSamplerVariable *iface,
6272 void *data, UINT offset, UINT count)
6274 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6277 /* ID3D10EffectSamplerVariable methods */
6279 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetSampler(ID3D10EffectSamplerVariable *iface,
6280 UINT index, ID3D10SamplerState **sampler)
6282 FIXME("iface %p, index %u, sampler %p stub!\n", iface, index, sampler);
6284 return E_NOTIMPL;
6287 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetBackingStore(ID3D10EffectSamplerVariable *iface,
6288 UINT index, D3D10_SAMPLER_DESC *desc)
6290 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
6292 return E_NOTIMPL;
6296 static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl =
6298 /* ID3D10EffectVariable methods */
6299 d3d10_effect_sampler_variable_IsValid,
6300 d3d10_effect_sampler_variable_GetType,
6301 d3d10_effect_sampler_variable_GetDesc,
6302 d3d10_effect_sampler_variable_GetAnnotationByIndex,
6303 d3d10_effect_sampler_variable_GetAnnotationByName,
6304 d3d10_effect_sampler_variable_GetMemberByIndex,
6305 d3d10_effect_sampler_variable_GetMemberByName,
6306 d3d10_effect_sampler_variable_GetMemberBySemantic,
6307 d3d10_effect_sampler_variable_GetElement,
6308 d3d10_effect_sampler_variable_GetParentConstantBuffer,
6309 d3d10_effect_sampler_variable_AsScalar,
6310 d3d10_effect_sampler_variable_AsVector,
6311 d3d10_effect_sampler_variable_AsMatrix,
6312 d3d10_effect_sampler_variable_AsString,
6313 d3d10_effect_sampler_variable_AsShaderResource,
6314 d3d10_effect_sampler_variable_AsRenderTargetView,
6315 d3d10_effect_sampler_variable_AsDepthStencilView,
6316 d3d10_effect_sampler_variable_AsConstantBuffer,
6317 d3d10_effect_sampler_variable_AsShader,
6318 d3d10_effect_sampler_variable_AsBlend,
6319 d3d10_effect_sampler_variable_AsDepthStencil,
6320 d3d10_effect_sampler_variable_AsRasterizer,
6321 d3d10_effect_sampler_variable_AsSampler,
6322 d3d10_effect_sampler_variable_SetRawValue,
6323 d3d10_effect_sampler_variable_GetRawValue,
6324 /* ID3D10EffectSamplerVariable methods */
6325 d3d10_effect_sampler_variable_GetSampler,
6326 d3d10_effect_sampler_variable_GetBackingStore,
6329 /* ID3D10EffectType methods */
6331 static inline struct d3d10_effect_type *impl_from_ID3D10EffectType(ID3D10EffectType *iface)
6333 return CONTAINING_RECORD(iface, struct d3d10_effect_type, ID3D10EffectType_iface);
6336 static BOOL STDMETHODCALLTYPE d3d10_effect_type_IsValid(ID3D10EffectType *iface)
6338 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6340 TRACE("iface %p\n", iface);
6342 return This != &null_type;
6345 static HRESULT STDMETHODCALLTYPE d3d10_effect_type_GetDesc(ID3D10EffectType *iface, D3D10_EFFECT_TYPE_DESC *desc)
6347 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6349 TRACE("iface %p, desc %p\n", iface, desc);
6351 if (This == &null_type)
6353 WARN("Null type specified\n");
6354 return E_FAIL;
6357 if (!desc)
6359 WARN("Invalid argument specified\n");
6360 return E_INVALIDARG;
6363 desc->TypeName = This->name;
6364 desc->Class = This->type_class;
6365 desc->Type = This->basetype;
6366 desc->Elements = This->element_count;
6367 desc->Members = This->member_count;
6368 desc->Rows = This->row_count;
6369 desc->Columns = This->column_count;
6370 desc->PackedSize = This->size_packed;
6371 desc->UnpackedSize = This->size_unpacked;
6372 desc->Stride = This->stride;
6374 return S_OK;
6377 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByIndex(ID3D10EffectType *iface,
6378 UINT index)
6380 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6381 struct d3d10_effect_type *t;
6383 TRACE("iface %p, index %u\n", iface, index);
6385 if (index >= This->member_count)
6387 WARN("Invalid index specified\n");
6388 return &null_type.ID3D10EffectType_iface;
6391 t = (&This->members[index])->type;
6393 TRACE("Returning member %p, %s\n", t, debugstr_a(t->name));
6395 return &t->ID3D10EffectType_iface;
6398 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByName(ID3D10EffectType *iface,
6399 LPCSTR name)
6401 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6402 unsigned int i;
6404 TRACE("iface %p, name %s\n", iface, debugstr_a(name));
6406 if (!name)
6408 WARN("Invalid name specified\n");
6409 return &null_type.ID3D10EffectType_iface;
6412 for (i = 0; i < This->member_count; ++i)
6414 struct d3d10_effect_type_member *typem = &This->members[i];
6416 if (typem->name)
6418 if (!strcmp(typem->name, name))
6420 TRACE("Returning type %p.\n", typem->type);
6421 return &typem->type->ID3D10EffectType_iface;
6426 WARN("Invalid name specified\n");
6428 return &null_type.ID3D10EffectType_iface;
6431 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeBySemantic(ID3D10EffectType *iface,
6432 LPCSTR semantic)
6434 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6435 unsigned int i;
6437 TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
6439 if (!semantic)
6441 WARN("Invalid semantic specified\n");
6442 return &null_type.ID3D10EffectType_iface;
6445 for (i = 0; i < This->member_count; ++i)
6447 struct d3d10_effect_type_member *typem = &This->members[i];
6449 if (typem->semantic)
6451 if (!strcmp(typem->semantic, semantic))
6453 TRACE("Returning type %p.\n", typem->type);
6454 return &typem->type->ID3D10EffectType_iface;
6459 WARN("Invalid semantic specified\n");
6461 return &null_type.ID3D10EffectType_iface;
6464 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberName(ID3D10EffectType *iface, UINT index)
6466 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6467 struct d3d10_effect_type_member *typem;
6469 TRACE("iface %p, index %u\n", iface, index);
6471 if (index >= This->member_count)
6473 WARN("Invalid index specified\n");
6474 return NULL;
6477 typem = &This->members[index];
6479 TRACE("Returning name %s\n", debugstr_a(typem->name));
6481 return typem->name;
6484 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberSemantic(ID3D10EffectType *iface, UINT index)
6486 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6487 struct d3d10_effect_type_member *typem;
6489 TRACE("iface %p, index %u\n", iface, index);
6491 if (index >= This->member_count)
6493 WARN("Invalid index specified\n");
6494 return NULL;
6497 typem = &This->members[index];
6499 TRACE("Returning semantic %s\n", debugstr_a(typem->semantic));
6501 return typem->semantic;
6504 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl =
6506 /* ID3D10EffectType */
6507 d3d10_effect_type_IsValid,
6508 d3d10_effect_type_GetDesc,
6509 d3d10_effect_type_GetMemberTypeByIndex,
6510 d3d10_effect_type_GetMemberTypeByName,
6511 d3d10_effect_type_GetMemberTypeBySemantic,
6512 d3d10_effect_type_GetMemberName,
6513 d3d10_effect_type_GetMemberSemantic,