rpcrt4/tests: Fix compilation on systems that don't support nameless unions.
[wine/testsucceed.git] / dlls / d3d10 / effect.c
blob71ec998443bd4a4ad1f6dff4f5d6e9cdded52e3b
1 /*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "config.h"
21 #include "wine/port.h"
23 #include "d3d10_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
27 #define MAKE_TAG(ch0, ch1, ch2, ch3) \
28 ((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \
29 ((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
30 #define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C')
31 #define TAG_FX10 MAKE_TAG('F', 'X', '1', '0')
32 #define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
34 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl;
35 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl;
36 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl;
37 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl;
39 static inline void read_dword(const char **ptr, DWORD *d)
41 memcpy(d, *ptr, sizeof(*d));
42 *ptr += sizeof(*d);
45 static inline void skip_dword_unknown(const char **ptr, unsigned int count)
47 unsigned int i;
48 DWORD d;
50 FIXME("Skipping %u unknown DWORDs:\n", count);
51 for (i = 0; i < count; ++i)
53 read_dword(ptr, &d);
54 FIXME("\t0x%08x\n", d);
58 static inline void write_dword(char **ptr, DWORD d)
60 memcpy(*ptr, &d, sizeof(d));
61 *ptr += sizeof(d);
64 static inline void write_dword_unknown(char **ptr, DWORD d)
66 FIXME("Writing unknown DWORD 0x%08x\n", d);
67 write_dword(ptr, d);
70 static inline void read_tag(const char **ptr, DWORD *t, char t_str[5])
72 read_dword(ptr, t);
73 memcpy(t_str, t, 4);
74 t_str[4] = '\0';
77 static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
78 HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx)
80 const char *ptr = data;
81 HRESULT hr = S_OK;
82 DWORD chunk_count;
83 DWORD total_size;
84 char tag_str[5];
85 unsigned int i;
86 DWORD tag;
88 read_tag(&ptr, &tag, tag_str);
89 TRACE("tag: %s\n", tag_str);
91 if (tag != TAG_DXBC)
93 WARN("Wrong tag.\n");
94 return E_FAIL;
97 /* checksum? */
98 skip_dword_unknown(&ptr, 4);
100 skip_dword_unknown(&ptr, 1);
102 read_dword(&ptr, &total_size);
103 TRACE("total size: %#x\n", total_size);
105 read_dword(&ptr, &chunk_count);
106 TRACE("chunk count: %#x\n", chunk_count);
108 for (i = 0; i < chunk_count; ++i)
110 DWORD chunk_tag, chunk_size;
111 const char *chunk_ptr;
112 DWORD chunk_offset;
114 read_dword(&ptr, &chunk_offset);
115 TRACE("chunk %u at offset %#x\n", i, chunk_offset);
117 chunk_ptr = data + chunk_offset;
119 read_dword(&chunk_ptr, &chunk_tag);
120 read_dword(&chunk_ptr, &chunk_size);
122 hr = chunk_handler(chunk_ptr, chunk_size, chunk_tag, ctx);
123 if (FAILED(hr)) break;
126 return hr;
129 static char *copy_name(const char *ptr)
131 size_t name_len;
132 char *name;
134 name_len = strlen(ptr) + 1;
135 name = HeapAlloc(GetProcessHeap(), 0, name_len);
136 if (!name)
138 ERR("Failed to allocate name memory.\n");
139 return NULL;
142 memcpy(name, ptr, name_len);
144 return name;
147 static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
149 struct d3d10_effect_shader_variable *s = ctx;
150 char tag_str[5];
152 memcpy(tag_str, &tag, 4);
153 tag_str[4] = '\0';
154 TRACE("tag: %s\n", tag_str);
156 TRACE("chunk size: %#x\n", data_size);
158 switch(tag)
160 case TAG_ISGN:
162 /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */
163 UINT size = 44 + data_size;
164 char *ptr;
166 s->input_signature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
167 if (!s->input_signature)
169 ERR("Failed to allocate input signature data\n");
170 return E_OUTOFMEMORY;
172 s->input_signature_size = size;
174 ptr = s->input_signature;
176 write_dword(&ptr, TAG_DXBC);
178 /* signature(?) */
179 write_dword_unknown(&ptr, 0);
180 write_dword_unknown(&ptr, 0);
181 write_dword_unknown(&ptr, 0);
182 write_dword_unknown(&ptr, 0);
184 /* seems to be always 1 */
185 write_dword_unknown(&ptr, 1);
187 /* DXBC size */
188 write_dword(&ptr, size);
190 /* chunk count */
191 write_dword(&ptr, 1);
193 /* chunk index */
194 write_dword(&ptr, (ptr - s->input_signature) + 4);
196 /* chunk */
197 write_dword(&ptr, TAG_ISGN);
198 write_dword(&ptr, data_size);
199 memcpy(ptr, data, data_size);
200 break;
203 default:
204 FIXME("Unhandled chunk %s\n", tag_str);
205 break;
208 return S_OK;
211 static HRESULT parse_shader(struct d3d10_effect_object *o, const char *data)
213 ID3D10Device *device = o->pass->technique->effect->device;
214 struct d3d10_effect_shader_variable *s;
215 const char *ptr = data;
216 DWORD dxbc_size;
217 HRESULT hr;
219 o->data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3d10_effect_shader_variable));
220 if (!o->data)
222 ERR("Failed to allocate shader variable memory\n");
223 return E_OUTOFMEMORY;
226 if (!ptr) return S_OK;
228 s = o->data;
230 read_dword(&ptr, &dxbc_size);
231 TRACE("dxbc size: %#x\n", dxbc_size);
233 switch (o->type)
235 case D3D10_EOT_VERTEXSHADER:
236 hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &s->shader.vs);
237 if (FAILED(hr)) return hr;
238 break;
240 case D3D10_EOT_PIXELSHADER:
241 hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &s->shader.ps);
242 if (FAILED(hr)) return hr;
243 break;
244 case D3D10_EOT_GEOMETRYSHADER:
245 hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &s->shader.gs);
246 if (FAILED(hr)) return hr;
247 break;
250 return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, s);
253 static void parse_fx10_annotation(const char **ptr)
255 skip_dword_unknown(ptr, 3);
258 static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr, const char *data)
260 const char *data_ptr;
261 DWORD offset;
262 HRESULT hr;
264 read_dword(ptr, &o->type);
265 TRACE("Effect object is of type %#x.\n", o->type);
267 skip_dword_unknown(ptr, 2);
269 read_dword(ptr, &offset);
270 TRACE("Effect object idx is at offset %#x.\n", offset);
272 data_ptr = data + offset;
273 read_dword(&data_ptr, &offset);
275 TRACE("Effect object starts at offset %#x.\n", offset);
277 /* FIXME: This probably isn't completely correct. */
278 if (offset == 1)
280 WARN("Skipping effect object.\n");
281 data_ptr = NULL;
283 else
285 data_ptr = data + offset;
288 switch (o->type)
290 case D3D10_EOT_VERTEXSHADER:
291 TRACE("Vertex shader\n");
292 hr = parse_shader(o, data_ptr);
293 break;
295 case D3D10_EOT_PIXELSHADER:
296 TRACE("Pixel shader\n");
297 hr = parse_shader(o, data_ptr);
298 break;
300 case D3D10_EOT_GEOMETRYSHADER:
301 TRACE("Geometry shader\n");
302 hr = parse_shader(o, data_ptr);
303 break;
305 default:
306 FIXME("Unhandled object type %#x\n", o->type);
307 hr = E_FAIL;
308 break;
311 return hr;
314 static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, const char *data)
316 HRESULT hr = S_OK;
317 unsigned int i;
318 DWORD offset;
320 read_dword(ptr, &offset);
321 TRACE("Pass name at offset %#x.\n", offset);
323 p->name = copy_name(data + offset);
324 if (!p->name)
326 ERR("Failed to copy name.\n");
327 return E_OUTOFMEMORY;
329 TRACE("Pass name: %s.\n", p->name);
331 read_dword(ptr, &p->object_count);
332 TRACE("Pass has %u effect objects.\n", p->object_count);
334 read_dword(ptr, &p->annotation_count);
335 for(i = 0; i < p->annotation_count; ++i)
337 parse_fx10_annotation(ptr);
340 p->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->object_count * sizeof(*p->objects));
341 if (!p->objects)
343 ERR("Failed to allocate effect objects memory.\n");
344 return E_OUTOFMEMORY;
347 for (i = 0; i < p->object_count; ++i)
349 struct d3d10_effect_object *o = &p->objects[i];
351 o->pass = p;
353 hr = parse_fx10_object(o, ptr, data);
354 if (FAILED(hr)) return hr;
357 return hr;
360 static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char **ptr, const char *data)
362 unsigned int i;
363 DWORD offset;
365 read_dword(ptr, &offset);
366 TRACE("Technique name at offset %#x.\n", offset);
368 t->name = copy_name(data + offset);
369 if (!t->name)
371 ERR("Failed to copy name.\n");
372 return E_OUTOFMEMORY;
374 TRACE("Technique name: %s.\n", t->name);
376 read_dword(ptr, &t->pass_count);
377 TRACE("Technique has %u passes\n", t->pass_count);
379 read_dword(ptr, &t->annotation_count);
380 for(i = 0; i < t->annotation_count; ++i)
382 parse_fx10_annotation(ptr);
385 t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes));
386 if (!t->passes)
388 ERR("Failed to allocate passes memory\n");
389 return E_OUTOFMEMORY;
392 for (i = 0; i < t->pass_count; ++i)
394 struct d3d10_effect_pass *p = &t->passes[i];
395 HRESULT hr;
397 p->vtbl = &d3d10_effect_pass_vtbl;
398 p->technique = t;
400 hr = parse_fx10_pass(p, ptr, data);
401 if (FAILED(hr)) return hr;
404 return S_OK;
407 static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
409 DWORD offset;
410 unsigned int i;
412 read_dword(ptr, &offset);
413 TRACE("Variable name at offset %#x.\n", offset);
415 v->name = copy_name(data + offset);
416 if (!v->name)
418 ERR("Failed to copy name.\n");
419 return E_OUTOFMEMORY;
421 TRACE("Variable name: %s.\n", v->name);
423 read_dword(ptr, &offset);
424 TRACE("Variable type info at offset %#x.\n", offset);
426 skip_dword_unknown(ptr, 1);
428 read_dword(ptr, &v->buffer_offset);
429 TRACE("Variable offset in buffer: %#x.\n", v->buffer_offset);
431 skip_dword_unknown(ptr, 1);
433 read_dword(ptr, &v->flag);
434 TRACE("Variable flag: %#x.\n", v->flag);
436 read_dword(ptr, &v->annotation_count);
437 for(i = 0; i < v->annotation_count; ++i)
439 parse_fx10_annotation(ptr);
442 return S_OK;
445 static HRESULT parse_fx10_local_buffer(struct d3d10_effect_local_buffer *l, const char **ptr, const char *data)
447 unsigned int i;
448 DWORD offset;
450 read_dword(ptr, &offset);
451 TRACE("Local buffer name at offset %#x.\n", offset);
453 l->name = copy_name(data + offset);
454 if (!l->name)
456 ERR("Failed to copy name.\n");
457 return E_OUTOFMEMORY;
459 TRACE("Local buffer name: %s.\n", l->name);
461 read_dword(ptr, &l->data_size);
462 TRACE("Local buffer data size: %#x.\n", l->data_size);
464 skip_dword_unknown(ptr, 1);
466 read_dword(ptr, &l->variable_count);
467 TRACE("Local buffer variable count: %#x.\n", l->variable_count);
469 skip_dword_unknown(ptr, 1);
471 read_dword(ptr, &l->annotation_count);
472 for(i = 0; i < l->annotation_count; ++i)
474 parse_fx10_annotation(ptr);
477 l->variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->variable_count * sizeof(*l->variables));
478 if (!l->variables)
480 ERR("Failed to allocate variables memory.\n");
481 return E_OUTOFMEMORY;
484 for (i = 0; i < l->variable_count; ++i)
486 struct d3d10_effect_variable *v = &l->variables[i];
487 HRESULT hr;
489 v->vtbl = &d3d10_effect_variable_vtbl;
491 hr = parse_fx10_variable(v, ptr, data);
492 if (FAILED(hr)) return hr;
495 return S_OK;
498 static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size)
500 const char *ptr = data + e->index_offset;
501 unsigned int i;
502 HRESULT hr;
504 e->local_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_buffer_count * sizeof(*e->local_buffers));
505 if (!e->local_buffers)
507 ERR("Failed to allocate local buffer memory.\n");
508 return E_OUTOFMEMORY;
511 e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques));
512 if (!e->techniques)
514 ERR("Failed to allocate techniques memory\n");
515 return E_OUTOFMEMORY;
518 for (i = 0; i < e->local_buffer_count; ++i)
520 struct d3d10_effect_local_buffer *l = &e->local_buffers[i];
521 l->vtbl = &d3d10_effect_constant_buffer_vtbl;
523 hr = parse_fx10_local_buffer(l, &ptr, data);
524 if (FAILED(hr)) return hr;
527 for (i = 0; i < e->technique_count; ++i)
529 struct d3d10_effect_technique *t = &e->techniques[i];
531 t->vtbl = &d3d10_effect_technique_vtbl;
532 t->effect = e;
534 hr = parse_fx10_technique(t, &ptr, data);
535 if (FAILED(hr)) return hr;
538 return S_OK;
541 static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_size)
543 const char *ptr = data;
544 DWORD unknown;
546 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
547 read_dword(&ptr, &e->version);
548 TRACE("Target: %#x\n", e->version);
550 read_dword(&ptr, &e->local_buffer_count);
551 TRACE("Local buffer count: %u.\n", e->local_buffer_count);
553 read_dword(&ptr, &e->variable_count);
554 TRACE("Variable count: %u\n", e->variable_count);
556 read_dword(&ptr, &e->object_count);
557 TRACE("Object count: %u\n", e->object_count);
559 read_dword(&ptr, &e->sharedbuffers_count);
560 TRACE("Sharedbuffers count: %u\n", e->sharedbuffers_count);
562 /* Number of variables in shared buffers? */
563 read_dword(&ptr, &unknown);
564 FIXME("Unknown 0: %u\n", unknown);
566 read_dword(&ptr, &e->sharedobjects_count);
567 TRACE("Sharedobjects count: %u\n", e->sharedobjects_count);
569 read_dword(&ptr, &e->technique_count);
570 TRACE("Technique count: %u\n", e->technique_count);
572 read_dword(&ptr, &e->index_offset);
573 TRACE("Index offset: %#x\n", e->index_offset);
575 read_dword(&ptr, &unknown);
576 FIXME("Unknown 1: %u\n", unknown);
578 read_dword(&ptr, &e->texture_count);
579 TRACE("Texture count: %u\n", e->texture_count);
581 read_dword(&ptr, &e->dephstencilstate_count);
582 TRACE("Depthstencilstate count: %u\n", e->dephstencilstate_count);
584 read_dword(&ptr, &e->blendstate_count);
585 TRACE("Blendstate count: %u\n", e->blendstate_count);
587 read_dword(&ptr, &e->rasterizerstate_count);
588 TRACE("Rasterizerstate count: %u\n", e->rasterizerstate_count);
590 read_dword(&ptr, &e->samplerstate_count);
591 TRACE("Samplerstate count: %u\n", e->samplerstate_count);
593 read_dword(&ptr, &e->rendertargetview_count);
594 TRACE("Rendertargetview count: %u\n", e->rendertargetview_count);
596 read_dword(&ptr, &e->depthstencilview_count);
597 TRACE("Depthstencilview count: %u\n", e->depthstencilview_count);
599 read_dword(&ptr, &e->shader_call_count);
600 TRACE("Shader call count: %u\n", e->shader_call_count);
602 read_dword(&ptr, &e->shader_compile_count);
603 TRACE("Shader compile count: %u\n", e->shader_compile_count);
605 return parse_fx10_body(e, ptr, data_size - (ptr - data));
608 static HRESULT fx10_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
610 struct d3d10_effect *e = ctx;
611 char tag_str[5];
613 memcpy(tag_str, &tag, 4);
614 tag_str[4] = '\0';
615 TRACE("tag: %s\n", tag_str);
617 TRACE("chunk size: %#x\n", data_size);
619 switch(tag)
621 case TAG_FX10:
622 return parse_fx10(e, data, data_size);
624 default:
625 FIXME("Unhandled chunk %s\n", tag_str);
626 return S_OK;
630 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size)
632 return parse_dxbc(data, data_size, fx10_chunk_handler, This);
635 static void d3d10_effect_object_destroy(struct d3d10_effect_object *o)
637 TRACE("effect object %p.\n", o);
639 switch(o->type)
641 case D3D10_EOT_VERTEXSHADER:
642 case D3D10_EOT_PIXELSHADER:
643 case D3D10_EOT_GEOMETRYSHADER:
644 HeapFree(GetProcessHeap(), 0, ((struct d3d10_effect_shader_variable *)o->data)->input_signature);
645 break;
647 default:
648 break;
650 HeapFree(GetProcessHeap(), 0, o->data);
653 static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
655 ID3D10Device *device = o->pass->technique->effect->device;
657 TRACE("effect object %p, type %#x.\n", o, o->type);
659 switch(o->type)
661 case D3D10_EOT_VERTEXSHADER:
662 ID3D10Device_VSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.vs);
663 return S_OK;
665 case D3D10_EOT_PIXELSHADER:
666 ID3D10Device_PSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.ps);
667 return S_OK;
669 case D3D10_EOT_GEOMETRYSHADER:
670 ID3D10Device_GSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.gs);
671 return S_OK;
673 default:
674 FIXME("Unhandled effect object type %#x.\n", o->type);
675 return E_FAIL;
679 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p)
681 TRACE("pass %p\n", p);
683 HeapFree(GetProcessHeap(), 0, p->name);
684 if (p->objects)
686 unsigned int i;
687 for (i = 0; i < p->object_count; ++i)
689 d3d10_effect_object_destroy(&p->objects[i]);
691 HeapFree(GetProcessHeap(), 0, p->objects);
695 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
697 TRACE("technique %p\n", t);
699 HeapFree(GetProcessHeap(), 0, t->name);
700 if (t->passes)
702 unsigned int i;
703 for (i = 0; i < t->pass_count; ++i)
705 d3d10_effect_pass_destroy(&t->passes[i]);
707 HeapFree(GetProcessHeap(), 0, t->passes);
711 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
713 TRACE("variable %p.\n", v);
715 HeapFree(GetProcessHeap(), 0, v->name);
718 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_local_buffer *l)
720 TRACE("local buffer %p.\n", l);
722 HeapFree(GetProcessHeap(), 0, l->name);
723 if (l->variables)
725 unsigned int i;
726 for (i = 0; i < l->variable_count; ++i)
728 d3d10_effect_variable_destroy(&l->variables[i]);
730 HeapFree(GetProcessHeap(), 0, l->variables);
734 /* IUnknown methods */
736 static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
738 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
740 if (IsEqualGUID(riid, &IID_ID3D10Effect)
741 || IsEqualGUID(riid, &IID_IUnknown))
743 IUnknown_AddRef(iface);
744 *object = iface;
745 return S_OK;
748 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
750 *object = NULL;
751 return E_NOINTERFACE;
754 static ULONG STDMETHODCALLTYPE d3d10_effect_AddRef(ID3D10Effect *iface)
756 struct d3d10_effect *This = (struct d3d10_effect *)iface;
757 ULONG refcount = InterlockedIncrement(&This->refcount);
759 TRACE("%p increasing refcount to %u\n", This, refcount);
761 return refcount;
764 static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
766 struct d3d10_effect *This = (struct d3d10_effect *)iface;
767 ULONG refcount = InterlockedDecrement(&This->refcount);
769 TRACE("%p decreasing refcount to %u\n", This, refcount);
771 if (!refcount)
773 unsigned int i;
775 if (This->techniques)
777 for (i = 0; i < This->technique_count; ++i)
779 d3d10_effect_technique_destroy(&This->techniques[i]);
781 HeapFree(GetProcessHeap(), 0, This->techniques);
784 if (This->local_buffers)
786 for (i = 0; i < This->local_buffer_count; ++i)
788 d3d10_effect_local_buffer_destroy(&This->local_buffers[i]);
790 HeapFree(GetProcessHeap(), 0, This->local_buffers);
793 ID3D10Device_Release(This->device);
794 HeapFree(GetProcessHeap(), 0, This);
797 return refcount;
800 /* ID3D10Effect methods */
802 static BOOL STDMETHODCALLTYPE d3d10_effect_IsValid(ID3D10Effect *iface)
804 FIXME("iface %p stub!\n", iface);
806 return FALSE;
809 static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
811 FIXME("iface %p stub!\n", iface);
813 return FALSE;
816 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
818 struct d3d10_effect *This = (struct d3d10_effect *)iface;
820 TRACE("iface %p, device %p\n", iface, device);
822 ID3D10Device_AddRef(This->device);
823 *device = This->device;
825 return S_OK;
828 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)
830 FIXME("iface %p, desc %p stub!\n", iface, desc);
832 return E_NOTIMPL;
835 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface,
836 UINT index)
838 struct d3d10_effect *This = (struct d3d10_effect *)iface;
839 struct d3d10_effect_local_buffer *l;
841 TRACE("iface %p, index %u\n", iface, index);
843 if (index >= This->local_buffer_count)
845 WARN("Invalid index specified\n");
846 return NULL;
849 l = &This->local_buffers[index];
851 TRACE("Returning buffer %p, \"%s\"\n", l, l->name);
853 return (ID3D10EffectConstantBuffer *)l;
856 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,
857 LPCSTR name)
859 struct d3d10_effect *This = (struct d3d10_effect *)iface;
860 unsigned int i;
862 TRACE("iface %p, name \"%s\"\n", iface, name);
864 for (i = 0; i < This->local_buffer_count; ++i)
866 struct d3d10_effect_local_buffer *l = &This->local_buffers[i];
868 if (!strcmp(l->name, name))
870 TRACE("Returning buffer %p.\n", l);
871 return (ID3D10EffectConstantBuffer *)l;
875 return NULL;
878 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index)
880 FIXME("iface %p, index %u stub!\n", iface, index);
882 return NULL;
885 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name)
887 struct d3d10_effect *This = (struct d3d10_effect *)iface;
888 unsigned int i;
890 TRACE("iface %p, name \"%s\"\n", iface, name);
892 for (i = 0; i < This->local_buffer_count; ++i)
894 struct d3d10_effect_local_buffer *l = &This->local_buffers[i];
895 unsigned int j;
897 for (j = 0; j < l->variable_count; ++j)
899 struct d3d10_effect_variable *v = &l->variables[j];
901 if (!strcmp(v->name, name))
903 TRACE("Returning variable %p.\n", v);
904 return (ID3D10EffectVariable *)v;
909 return NULL;
912 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface,
913 LPCSTR semantic)
915 FIXME("iface %p, semantic \"%s\" stub!\n", iface, semantic);
917 return NULL;
920 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByIndex(ID3D10Effect *iface,
921 UINT index)
923 struct d3d10_effect *This = (struct d3d10_effect *)iface;
924 struct d3d10_effect_technique *t;
926 TRACE("iface %p, index %u\n", iface, index);
928 if (index >= This->technique_count)
930 WARN("Invalid index specified\n");
931 return NULL;
934 t = &This->techniques[index];
936 TRACE("Returning technique %p, \"%s\"\n", t, t->name);
938 return (ID3D10EffectTechnique *)t;
941 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByName(ID3D10Effect *iface,
942 LPCSTR name)
944 struct d3d10_effect *This = (struct d3d10_effect *)iface;
945 unsigned int i;
947 TRACE("iface %p, name \"%s\"\n", iface, name);
949 for (i = 0; i < This->technique_count; ++i)
951 struct d3d10_effect_technique *t = &This->techniques[i];
952 if (!strcmp(t->name, name))
954 TRACE("Returning technique %p\n", t);
955 return (ID3D10EffectTechnique *)t;
959 return NULL;
962 static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
964 FIXME("iface %p stub!\n", iface);
966 return E_NOTIMPL;
969 static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface)
971 FIXME("iface %p stub!\n", iface);
973 return FALSE;
976 const struct ID3D10EffectVtbl d3d10_effect_vtbl =
978 /* IUnknown methods */
979 d3d10_effect_QueryInterface,
980 d3d10_effect_AddRef,
981 d3d10_effect_Release,
982 /* ID3D10Effect methods */
983 d3d10_effect_IsValid,
984 d3d10_effect_IsPool,
985 d3d10_effect_GetDevice,
986 d3d10_effect_GetDesc,
987 d3d10_effect_GetConstantBufferByIndex,
988 d3d10_effect_GetConstantBufferByName,
989 d3d10_effect_GetVariableByIndex,
990 d3d10_effect_GetVariableByName,
991 d3d10_effect_GetVariableBySemantic,
992 d3d10_effect_GetTechniqueByIndex,
993 d3d10_effect_GetTechniqueByName,
994 d3d10_effect_Optimize,
995 d3d10_effect_IsOptimized,
998 /* ID3D10EffectTechnique methods */
1000 static BOOL STDMETHODCALLTYPE d3d10_effect_technique_IsValid(ID3D10EffectTechnique *iface)
1002 FIXME("iface %p stub!\n", iface);
1004 return FALSE;
1007 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_GetDesc(ID3D10EffectTechnique *iface,
1008 D3D10_TECHNIQUE_DESC *desc)
1010 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1012 TRACE("iface %p, desc %p\n", iface, desc);
1014 desc->Name = This->name;
1015 desc->Passes = This->pass_count;
1016 WARN("Annotations not implemented\n");
1017 desc->Annotations = 0;
1019 return S_OK;
1022 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByIndex(
1023 ID3D10EffectTechnique *iface, UINT index)
1025 FIXME("iface %p, index %u stub!\n", iface, index);
1027 return NULL;
1030 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByName(
1031 ID3D10EffectTechnique *iface, LPCSTR name)
1033 FIXME("iface %p, name \"%s\" stub!\n", iface, name);
1035 return NULL;
1038 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique *iface,
1039 UINT index)
1041 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1042 struct d3d10_effect_pass *p;
1044 TRACE("iface %p, index %u\n", iface, index);
1046 if (index >= This->pass_count)
1048 WARN("Invalid index specified\n");
1049 return NULL;
1052 p = &This->passes[index];
1054 TRACE("Returning pass %p, \"%s\"\n", p, p->name);
1056 return (ID3D10EffectPass *)p;
1059 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique *iface,
1060 LPCSTR name)
1062 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
1063 unsigned int i;
1065 TRACE("iface %p, name \"%s\"\n", iface, name);
1067 for (i = 0; i < This->pass_count; ++i)
1069 struct d3d10_effect_pass *p = &This->passes[i];
1070 if (!strcmp(p->name, name))
1072 TRACE("Returning pass %p\n", p);
1073 return (ID3D10EffectPass *)p;
1077 return NULL;
1080 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique *iface,
1081 D3D10_STATE_BLOCK_MASK *mask)
1083 FIXME("iface %p,mask %p stub!\n", iface, mask);
1085 return E_NOTIMPL;
1088 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl =
1090 /* ID3D10EffectTechnique methods */
1091 d3d10_effect_technique_IsValid,
1092 d3d10_effect_technique_GetDesc,
1093 d3d10_effect_technique_GetAnnotationByIndex,
1094 d3d10_effect_technique_GetAnnotationByName,
1095 d3d10_effect_technique_GetPassByIndex,
1096 d3d10_effect_technique_GetPassByName,
1097 d3d10_effect_technique_ComputeStateBlockMask,
1100 /* ID3D10EffectPass methods */
1102 static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface)
1104 FIXME("iface %p stub!\n", iface);
1106 return FALSE;
1109 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface, D3D10_PASS_DESC *desc)
1111 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1112 unsigned int i;
1114 FIXME("iface %p, desc %p partial stub!\n", iface, desc);
1116 memset(desc, 0, sizeof(*desc));
1117 desc->Name = This->name;
1118 for (i = 0; i < This->object_count; ++i)
1120 struct d3d10_effect_object *o = &This->objects[i];
1121 if (o->type == D3D10_EOT_VERTEXSHADER)
1123 struct d3d10_effect_shader_variable *s = o->data;
1124 desc->pIAInputSignature = (BYTE *)s->input_signature;
1125 desc->IAInputSignatureSize = s->input_signature_size;
1126 break;
1130 return S_OK;
1133 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface,
1134 D3D10_PASS_SHADER_DESC *desc)
1136 FIXME("iface %p, desc %p stub!\n", iface, desc);
1138 return E_NOTIMPL;
1141 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface,
1142 D3D10_PASS_SHADER_DESC *desc)
1144 FIXME("iface %p, desc %p stub!\n", iface, desc);
1146 return E_NOTIMPL;
1149 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface,
1150 D3D10_PASS_SHADER_DESC *desc)
1152 FIXME("iface %p, desc %p stub!\n", iface, desc);
1154 return E_NOTIMPL;
1157 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass *iface,
1158 UINT index)
1160 FIXME("iface %p, index %u stub!\n", iface, index);
1162 return NULL;
1165 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass *iface,
1166 LPCSTR name)
1168 FIXME("iface %p, name \"%s\" stub!\n", iface, name);
1170 return NULL;
1173 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
1175 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
1176 HRESULT hr = S_OK;
1177 unsigned int i;
1179 TRACE("iface %p, flags %#x\n", iface, flags);
1181 if (flags) FIXME("Ignoring flags (%#x)\n", flags);
1183 for (i = 0; i < This->object_count; ++i)
1185 hr = d3d10_effect_object_apply(&This->objects[i]);
1186 if (FAILED(hr)) break;
1189 return hr;
1192 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass *iface,
1193 D3D10_STATE_BLOCK_MASK *mask)
1195 FIXME("iface %p, mask %p stub!\n", iface, mask);
1197 return E_NOTIMPL;
1200 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl =
1202 /* ID3D10EffectPass methods */
1203 d3d10_effect_pass_IsValid,
1204 d3d10_effect_pass_GetDesc,
1205 d3d10_effect_pass_GetVertexShaderDesc,
1206 d3d10_effect_pass_GetGeometryShaderDesc,
1207 d3d10_effect_pass_GetPixelShaderDesc,
1208 d3d10_effect_pass_GetAnnotationByIndex,
1209 d3d10_effect_pass_GetAnnotationByName,
1210 d3d10_effect_pass_Apply,
1211 d3d10_effect_pass_ComputeStateBlockMask,
1214 /* ID3D10EffectVariable methods */
1216 static BOOL STDMETHODCALLTYPE d3d10_effect_variable_IsValid(ID3D10EffectVariable *iface)
1218 FIXME("iface %p stub!\n", iface);
1220 return FALSE;
1223 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_variable_GetType(ID3D10EffectVariable *iface)
1225 FIXME("iface %p stub!\n", iface);
1227 return NULL;
1230 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetDesc(ID3D10EffectVariable *iface,
1231 D3D10_EFFECT_VARIABLE_DESC *desc)
1233 FIXME("iface %p, desc %p stub!\n", iface, desc);
1235 return E_NOTIMPL;
1238 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByIndex(
1239 ID3D10EffectVariable *iface, UINT index)
1241 FIXME("iface %p, index %u stub!\n", iface, index);
1243 return NULL;
1246 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName(
1247 ID3D10EffectVariable *iface, LPCSTR name)
1249 FIXME("iface %p, name \"%s\" stub!\n", iface, name);
1251 return NULL;
1254 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex(
1255 ID3D10EffectVariable *iface, UINT index)
1257 FIXME("iface %p, index %u stub!\n", iface, index);
1259 return NULL;
1262 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName(
1263 ID3D10EffectVariable *iface, LPCSTR name)
1265 FIXME("iface %p, name \"%s\" stub!\n", iface, name);
1267 return NULL;
1270 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic(
1271 ID3D10EffectVariable *iface, LPCSTR semantic)
1273 FIXME("iface %p, semantic \"%s\" stub!\n", iface, semantic);
1275 return NULL;
1278 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetElement(
1279 ID3D10EffectVariable *iface, UINT index)
1281 FIXME("iface %p, index %u stub!\n", iface, index);
1283 return NULL;
1286 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_GetParentConstantBuffer(
1287 ID3D10EffectVariable *iface)
1289 FIXME("iface %p stub!\n", iface);
1291 return NULL;
1294 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsScalar(
1295 ID3D10EffectVariable *iface)
1297 FIXME("iface %p stub!\n", iface);
1299 return NULL;
1302 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsVector(
1303 ID3D10EffectVariable *iface)
1305 FIXME("iface %p stub!\n", iface);
1307 return NULL;
1310 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix(
1311 ID3D10EffectVariable *iface)
1313 FIXME("iface %p stub!\n", iface);
1315 return NULL;
1318 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsString(
1319 ID3D10EffectVariable *iface)
1321 FIXME("iface %p stub!\n", iface);
1323 return NULL;
1326 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShaderResource(
1327 ID3D10EffectVariable *iface)
1329 FIXME("iface %p stub!\n", iface);
1331 return NULL;
1334 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRenderTargetView(
1335 ID3D10EffectVariable *iface)
1337 FIXME("iface %p stub!\n", iface);
1339 return NULL;
1342 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencilView(
1343 ID3D10EffectVariable *iface)
1345 FIXME("iface %p stub!\n", iface);
1347 return NULL;
1350 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_AsConstantBuffer(
1351 ID3D10EffectVariable *iface)
1353 FIXME("iface %p stub!\n", iface);
1355 return NULL;
1358 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShader(
1359 ID3D10EffectVariable *iface)
1361 FIXME("iface %p stub!\n", iface);
1363 return NULL;
1366 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsBlend(ID3D10EffectVariable *iface)
1368 FIXME("iface %p stub!\n", iface);
1370 return NULL;
1373 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencil(
1374 ID3D10EffectVariable *iface)
1376 FIXME("iface %p stub!\n", iface);
1378 return NULL;
1381 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRasterizer(
1382 ID3D10EffectVariable *iface)
1384 FIXME("iface %p stub!\n", iface);
1386 return NULL;
1389 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsSampler(
1390 ID3D10EffectVariable *iface)
1392 FIXME("iface %p stub!\n", iface);
1394 return NULL;
1397 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface,
1398 void *data, UINT offset, UINT count)
1400 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
1402 return E_NOTIMPL;
1405 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface,
1406 void *data, UINT offset, UINT count)
1408 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
1410 return E_NOTIMPL;
1413 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl =
1415 /* ID3D10EffectVariable methods */
1416 d3d10_effect_variable_IsValid,
1417 d3d10_effect_variable_GetType,
1418 d3d10_effect_variable_GetDesc,
1419 d3d10_effect_variable_GetAnnotationByIndex,
1420 d3d10_effect_variable_GetAnnotationByName,
1421 d3d10_effect_variable_GetMemberByIndex,
1422 d3d10_effect_variable_GetMemberByName,
1423 d3d10_effect_variable_GetMemberBySemantic,
1424 d3d10_effect_variable_GetElement,
1425 d3d10_effect_variable_GetParentConstantBuffer,
1426 d3d10_effect_variable_AsScalar,
1427 d3d10_effect_variable_AsVector,
1428 d3d10_effect_variable_AsMatrix,
1429 d3d10_effect_variable_AsString,
1430 d3d10_effect_variable_AsShaderResource,
1431 d3d10_effect_variable_AsRenderTargetView,
1432 d3d10_effect_variable_AsDepthStencilView,
1433 d3d10_effect_variable_AsConstantBuffer,
1434 d3d10_effect_variable_AsShader,
1435 d3d10_effect_variable_AsBlend,
1436 d3d10_effect_variable_AsDepthStencil,
1437 d3d10_effect_variable_AsRasterizer,
1438 d3d10_effect_variable_AsSampler,
1439 d3d10_effect_variable_SetRawValue,
1440 d3d10_effect_variable_GetRawValue,
1443 /* ID3D10EffectVariable methods */
1444 static BOOL STDMETHODCALLTYPE d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer *iface)
1446 FIXME("iface %p stub!\n", iface);
1448 return FALSE;
1451 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer *iface)
1453 FIXME("iface %p stub!\n", iface);
1455 return NULL;
1458 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer *iface,
1459 D3D10_EFFECT_VARIABLE_DESC *desc)
1461 FIXME("iface %p, desc %p stub!\n", iface, desc);
1463 return E_NOTIMPL;
1466 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByIndex(
1467 ID3D10EffectConstantBuffer *iface, UINT index)
1469 FIXME("iface %p, index %u stub!\n", iface, index);
1471 return NULL;
1474 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByName(
1475 ID3D10EffectConstantBuffer *iface, LPCSTR name)
1477 FIXME("iface %p, name \"%s\" stub!\n", iface, name);
1479 return NULL;
1482 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByIndex(
1483 ID3D10EffectConstantBuffer *iface, UINT index)
1485 FIXME("iface %p, index %u stub!\n", iface, index);
1487 return NULL;
1490 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByName(
1491 ID3D10EffectConstantBuffer *iface, LPCSTR name)
1493 FIXME("iface %p, name \"%s\" stub!\n", iface, name);
1495 return NULL;
1498 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberBySemantic(
1499 ID3D10EffectConstantBuffer *iface, LPCSTR semantic)
1501 FIXME("iface %p, semantic \"%s\" stub!\n", iface, semantic);
1503 return NULL;
1506 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetElement(
1507 ID3D10EffectConstantBuffer *iface, UINT index)
1509 FIXME("iface %p, index %u stub!\n", iface, index);
1511 return NULL;
1514 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetParentConstantBuffer(
1515 ID3D10EffectConstantBuffer *iface)
1517 FIXME("iface %p stub!\n", iface);
1519 return NULL;
1522 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsScalar(
1523 ID3D10EffectConstantBuffer *iface)
1525 FIXME("iface %p stub!\n", iface);
1527 return NULL;
1530 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsVector(
1531 ID3D10EffectConstantBuffer *iface)
1533 FIXME("iface %p stub!\n", iface);
1535 return NULL;
1538 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsMatrix(
1539 ID3D10EffectConstantBuffer *iface)
1541 FIXME("iface %p stub!\n", iface);
1543 return NULL;
1546 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsString(
1547 ID3D10EffectConstantBuffer *iface)
1549 FIXME("iface %p stub!\n", iface);
1551 return NULL;
1554 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShaderResource(
1555 ID3D10EffectConstantBuffer *iface)
1557 FIXME("iface %p stub!\n", iface);
1559 return NULL;
1562 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRenderTargetView(
1563 ID3D10EffectConstantBuffer *iface)
1565 FIXME("iface %p stub!\n", iface);
1567 return NULL;
1570 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencilView(
1571 ID3D10EffectConstantBuffer *iface)
1573 FIXME("iface %p stub!\n", iface);
1575 return NULL;
1578 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsConstantBuffer(
1579 ID3D10EffectConstantBuffer *iface)
1581 FIXME("iface %p stub!\n", iface);
1583 return NULL;
1586 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShader(
1587 ID3D10EffectConstantBuffer *iface)
1589 FIXME("iface %p stub!\n", iface);
1591 return NULL;
1594 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer *iface)
1596 FIXME("iface %p stub!\n", iface);
1598 return NULL;
1601 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencil(
1602 ID3D10EffectConstantBuffer *iface)
1604 FIXME("iface %p stub!\n", iface);
1606 return NULL;
1609 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRasterizer(
1610 ID3D10EffectConstantBuffer *iface)
1612 FIXME("iface %p stub!\n", iface);
1614 return NULL;
1617 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsSampler(
1618 ID3D10EffectConstantBuffer *iface)
1620 FIXME("iface %p stub!\n", iface);
1622 return NULL;
1625 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer *iface,
1626 void *data, UINT offset, UINT count)
1628 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
1630 return E_NOTIMPL;
1633 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer *iface,
1634 void *data, UINT offset, UINT count)
1636 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
1638 return E_NOTIMPL;
1641 /* ID3D10EffectConstantBuffer methods */
1642 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer *iface,
1643 ID3D10Buffer *buffer)
1645 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
1647 return E_NOTIMPL;
1650 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer *iface,
1651 ID3D10Buffer **buffer)
1653 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
1655 return E_NOTIMPL;
1658 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer *iface,
1659 ID3D10ShaderResourceView *view)
1661 FIXME("iface %p, view %p stub!\n", iface, view);
1663 return E_NOTIMPL;
1666 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer *iface,
1667 ID3D10ShaderResourceView **view)
1669 FIXME("iface %p, view %p stub!\n", iface, view);
1671 return E_NOTIMPL;
1674 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl =
1676 /* ID3D10EffectVariable methods */
1677 d3d10_effect_constant_buffer_IsValid,
1678 d3d10_effect_constant_buffer_GetType,
1679 d3d10_effect_constant_buffer_GetDesc,
1680 d3d10_effect_constant_buffer_GetAnnotationByIndex,
1681 d3d10_effect_constant_buffer_GetAnnotationByName,
1682 d3d10_effect_constant_buffer_GetMemberByIndex,
1683 d3d10_effect_constant_buffer_GetMemberByName,
1684 d3d10_effect_constant_buffer_GetMemberBySemantic,
1685 d3d10_effect_constant_buffer_GetElement,
1686 d3d10_effect_constant_buffer_GetParentConstantBuffer,
1687 d3d10_effect_constant_buffer_AsScalar,
1688 d3d10_effect_constant_buffer_AsVector,
1689 d3d10_effect_constant_buffer_AsMatrix,
1690 d3d10_effect_constant_buffer_AsString,
1691 d3d10_effect_constant_buffer_AsShaderResource,
1692 d3d10_effect_constant_buffer_AsRenderTargetView,
1693 d3d10_effect_constant_buffer_AsDepthStencilView,
1694 d3d10_effect_constant_buffer_AsConstantBuffer,
1695 d3d10_effect_constant_buffer_AsShader,
1696 d3d10_effect_constant_buffer_AsBlend,
1697 d3d10_effect_constant_buffer_AsDepthStencil,
1698 d3d10_effect_constant_buffer_AsRasterizer,
1699 d3d10_effect_constant_buffer_AsSampler,
1700 d3d10_effect_constant_buffer_SetRawValue,
1701 d3d10_effect_constant_buffer_GetRawValue,
1702 /* ID3D10EffectConstantBuffer methods */
1703 d3d10_effect_constant_buffer_SetConstantBuffer,
1704 d3d10_effect_constant_buffer_GetConstantBuffer,
1705 d3d10_effect_constant_buffer_SetTextureBuffer,
1706 d3d10_effect_constant_buffer_GetTextureBuffer,