2 * Copyright 2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/port.h"
23 #include "d3d10_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
27 #define MAKE_TAG(ch0, ch1, ch2, ch3) \
28 ((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \
29 ((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
30 #define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C')
31 #define TAG_FX10 MAKE_TAG('F', 'X', '1', '0')
32 #define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
34 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl;
35 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl;
37 static inline void read_dword(const char **ptr, DWORD *d)
39 memcpy(d, *ptr, sizeof(*d));
43 static inline void skip_dword_unknown(const char **ptr, unsigned int count)
48 FIXME("Skipping %u unknown DWORDs:\n", count);
49 for (i = 0; i < count; ++i)
52 FIXME("\t0x%08x\n", d);
56 static inline void write_dword(char **ptr, DWORD d)
58 memcpy(*ptr, &d, sizeof(d));
62 static inline void write_dword_unknown(char **ptr, DWORD d)
64 FIXME("Writing unknown DWORD 0x%08x\n", d);
68 static inline void read_tag(const char **ptr, DWORD *t, char t_str[5])
75 static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
76 HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx)
78 const char *ptr = data;
86 read_tag(&ptr, &tag, tag_str);
87 TRACE("tag: %s\n", tag_str);
96 skip_dword_unknown(&ptr, 4);
98 skip_dword_unknown(&ptr, 1);
100 read_dword(&ptr, &total_size);
101 TRACE("total size: %#x\n", total_size);
103 read_dword(&ptr, &chunk_count);
104 TRACE("chunk count: %#x\n", chunk_count);
106 for (i = 0; i < chunk_count; ++i)
108 DWORD chunk_tag, chunk_size;
109 const char *chunk_ptr;
112 read_dword(&ptr, &chunk_offset);
113 TRACE("chunk %u at offset %#x\n", i, chunk_offset);
115 chunk_ptr = data + chunk_offset;
117 read_dword(&chunk_ptr, &chunk_tag);
118 read_dword(&chunk_ptr, &chunk_size);
120 hr = chunk_handler(chunk_ptr, chunk_size, chunk_tag, ctx);
121 if (FAILED(hr)) break;
127 static HRESULT parse_fx10_pass_index(struct d3d10_effect_pass *p, const char **ptr)
131 read_dword(ptr, &p->start);
132 TRACE("Pass starts at offset %#x\n", p->start);
134 read_dword(ptr, &p->variable_count);
135 TRACE("Pass has %u variables\n", p->variable_count);
137 skip_dword_unknown(ptr, 1);
139 p->variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->variable_count * sizeof(*p->variables));
142 ERR("Failed to allocate variables memory\n");
143 return E_OUTOFMEMORY;
146 for (i = 0; i < p->variable_count; ++i)
148 struct d3d10_effect_variable *v = &p->variables[i];
152 read_dword(ptr, &v->type);
153 TRACE("Variable %u is of type %#x\n", i, v->type);
155 skip_dword_unknown(ptr, 2);
157 read_dword(ptr, &v->idx_offset);
158 TRACE("Variable %u idx is at offset %#x\n", i, v->idx_offset);
164 static HRESULT parse_fx10_technique_index(struct d3d10_effect_technique *t, const char **ptr)
169 read_dword(ptr, &t->start);
170 TRACE("Technique starts at offset %#x\n", t->start);
172 read_dword(ptr, &t->pass_count);
173 TRACE("Technique has %u passes\n", t->pass_count);
175 skip_dword_unknown(ptr, 1);
177 t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes));
180 ERR("Failed to allocate passes memory\n");
181 return E_OUTOFMEMORY;
184 for (i = 0; i < t->pass_count; ++i)
186 struct d3d10_effect_pass *p = &t->passes[i];
188 p->vtbl = &d3d10_effect_pass_vtbl;
191 hr = parse_fx10_pass_index(p, ptr);
192 if (FAILED(hr)) break;
198 static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
200 struct d3d10_effect_shader_variable *s = ctx;
203 memcpy(tag_str, &tag, 4);
205 TRACE("tag: %s\n", tag_str);
207 TRACE("chunk size: %#x\n", data_size);
213 /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */
214 UINT size = 44 + data_size;
217 s->input_signature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
218 if (!s->input_signature)
220 ERR("Failed to allocate input signature data\n");
221 return E_OUTOFMEMORY;
223 s->input_signature_size = size;
225 ptr = s->input_signature;
227 write_dword(&ptr, TAG_DXBC);
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);
239 write_dword(&ptr, size);
242 write_dword(&ptr, 1);
245 write_dword(&ptr, (ptr - s->input_signature) + 4);
248 write_dword(&ptr, TAG_ISGN);
249 write_dword(&ptr, data_size);
250 memcpy(ptr, data, data_size);
255 FIXME("Unhandled chunk %s\n", tag_str);
262 static HRESULT parse_shader(struct d3d10_effect_variable *v, const char *data)
264 ID3D10Device *device = v->pass->technique->effect->device;
265 struct d3d10_effect_shader_variable *s;
266 const char *ptr = data;
270 v->data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3d10_effect_shader_variable));
273 ERR("Failed to allocate shader variable memory\n");
274 return E_OUTOFMEMORY;
277 if (!ptr) return S_OK;
281 read_dword(&ptr, &dxbc_size);
282 TRACE("dxbc size: %#x\n", dxbc_size);
286 case D3D10_EVT_VERTEXSHADER:
287 hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &s->shader.vs);
288 if (FAILED(hr)) return hr;
291 case D3D10_EVT_PIXELSHADER:
292 hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &s->shader.ps);
293 if (FAILED(hr)) return hr;
295 case D3D10_EVT_GEOMETRYSHADER:
296 hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &s->shader.gs);
297 if (FAILED(hr)) return hr;
301 return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, s);
304 static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char *data)
310 ptr = data + v->idx_offset;
311 read_dword(&ptr, &offset);
313 TRACE("Variable of type %#x starts at offset %#x\n", v->type, offset);
315 /* FIXME: This probably isn't completely correct. */
318 WARN("Skipping variable\n");
328 case D3D10_EVT_VERTEXSHADER:
329 TRACE("Vertex shader\n");
330 hr = parse_shader(v, ptr);
333 case D3D10_EVT_PIXELSHADER:
334 TRACE("Pixel shader\n");
335 hr = parse_shader(v, ptr);
338 case D3D10_EVT_GEOMETRYSHADER:
339 TRACE("Geometry shader\n");
340 hr = parse_shader(v, ptr);
344 FIXME("Unhandled variable type %#x\n", v->type);
352 static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char *data)
359 ptr = data + p->start;
361 name_len = strlen(ptr) + 1;
362 p->name = HeapAlloc(GetProcessHeap(), 0, name_len);
365 ERR("Failed to allocate name memory\n");
366 return E_OUTOFMEMORY;
369 memcpy(p->name, ptr, name_len);
372 TRACE("pass name: %s\n", p->name);
374 for (i = 0; i < p->variable_count; ++i)
376 hr = parse_fx10_variable(&p->variables[i], data);
377 if (FAILED(hr)) break;
383 static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char *data)
390 ptr = data + t->start;
392 name_len = strlen(ptr) + 1;
393 t->name = HeapAlloc(GetProcessHeap(), 0, name_len);
396 ERR("Failed to allocate name memory\n");
397 return E_OUTOFMEMORY;
400 memcpy(t->name, ptr, name_len);
403 TRACE("technique name: %s\n", t->name);
405 for (i = 0; i < t->pass_count; ++i)
407 hr = parse_fx10_pass(&t->passes[i], data);
408 if (FAILED(hr)) break;
414 static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size)
416 const char *ptr = data + e->index_offset;
420 skip_dword_unknown(&ptr, 6);
422 e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques));
425 ERR("Failed to allocate techniques memory\n");
426 return E_OUTOFMEMORY;
429 for (i = 0; i < e->technique_count; ++i)
431 struct d3d10_effect_technique *t = &e->techniques[i];
433 t->vtbl = &d3d10_effect_technique_vtbl;
436 hr = parse_fx10_technique_index(t, &ptr);
437 if (FAILED(hr)) break;
439 hr = parse_fx10_technique(t, data);
440 if (FAILED(hr)) break;
446 static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_size)
448 const char *ptr = data;
452 skip_dword_unknown(&ptr, 2);
454 read_dword(&ptr, &unknown);
455 FIXME("Unknown 0: %u\n", unknown);
456 read_dword(&ptr, &unknown);
457 FIXME("Unknown 1: %u\n", unknown);
458 read_dword(&ptr, &unknown);
459 FIXME("Unknown 2: %u\n", unknown);
460 read_dword(&ptr, &unknown);
461 FIXME("Unknown 3: %u\n", unknown);
462 read_dword(&ptr, &unknown);
463 FIXME("Unknown 4: %u\n", unknown);
465 read_dword(&ptr, &e->technique_count);
466 TRACE("Technique count: %u\n", e->technique_count);
468 read_dword(&ptr, &e->index_offset);
469 TRACE("Index offset: %#x\n", e->index_offset);
471 read_dword(&ptr, &unknown);
472 FIXME("Unknown 5: %u\n", unknown);
473 read_dword(&ptr, &unknown);
474 FIXME("Unknown 6: %u\n", unknown);
475 read_dword(&ptr, &unknown);
476 FIXME("Unknown 7: %u\n", unknown);
478 read_dword(&ptr, &e->blendstate_count);
479 TRACE("Blendstate count: %u\n", e->blendstate_count);
481 read_dword(&ptr, &unknown);
482 FIXME("Unknown 8: %u\n", unknown);
483 read_dword(&ptr, &unknown);
484 FIXME("Unknown 9: %u\n", unknown);
485 read_dword(&ptr, &unknown);
486 FIXME("Unknown 10: %u\n", unknown);
487 read_dword(&ptr, &unknown);
488 FIXME("Unknown 11: %u\n", unknown);
489 read_dword(&ptr, &unknown);
490 FIXME("Unknown 12: %u\n", unknown);
491 read_dword(&ptr, &unknown);
492 FIXME("Unknown 13: %u\n", unknown);
494 return parse_fx10_body(e, ptr, data_size - (ptr - data));
497 static HRESULT fx10_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
499 struct d3d10_effect *e = ctx;
502 memcpy(tag_str, &tag, 4);
504 TRACE("tag: %s\n", tag_str);
506 TRACE("chunk size: %#x\n", data_size);
511 return parse_fx10(e, data, data_size);
514 FIXME("Unhandled chunk %s\n", tag_str);
519 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size)
521 return parse_dxbc(data, data_size, fx10_chunk_handler, This);
524 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
526 TRACE("variable %p\n", v);
530 case D3D10_EVT_VERTEXSHADER:
531 case D3D10_EVT_PIXELSHADER:
532 case D3D10_EVT_GEOMETRYSHADER:
533 HeapFree(GetProcessHeap(), 0, ((struct d3d10_effect_shader_variable *)v->data)->input_signature);
539 HeapFree(GetProcessHeap(), 0, v->data);
542 static HRESULT d3d10_effect_variable_apply(struct d3d10_effect_variable *v)
544 ID3D10Device *device = v->pass->technique->effect->device;
546 TRACE("variable %p, type %#x\n", v, v->type);
550 case D3D10_EVT_VERTEXSHADER:
551 ID3D10Device_VSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.vs);
554 case D3D10_EVT_PIXELSHADER:
555 ID3D10Device_PSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.ps);
558 case D3D10_EVT_GEOMETRYSHADER:
559 ID3D10Device_GSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.gs);
563 FIXME("Unhandled variable type %#x\n", v->type);
568 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p)
570 TRACE("pass %p\n", p);
572 HeapFree(GetProcessHeap(), 0, p->name);
576 for (i = 0; i < p->variable_count; ++i)
578 d3d10_effect_variable_destroy(&p->variables[i]);
580 HeapFree(GetProcessHeap(), 0, p->variables);
584 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
586 TRACE("technique %p\n", t);
588 HeapFree(GetProcessHeap(), 0, t->name);
592 for (i = 0; i < t->pass_count; ++i)
594 d3d10_effect_pass_destroy(&t->passes[i]);
596 HeapFree(GetProcessHeap(), 0, t->passes);
600 /* IUnknown methods */
602 static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
604 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
606 if (IsEqualGUID(riid, &IID_ID3D10Effect)
607 || IsEqualGUID(riid, &IID_IUnknown))
609 IUnknown_AddRef(iface);
614 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
617 return E_NOINTERFACE;
620 static ULONG STDMETHODCALLTYPE d3d10_effect_AddRef(ID3D10Effect *iface)
622 struct d3d10_effect *This = (struct d3d10_effect *)iface;
623 ULONG refcount = InterlockedIncrement(&This->refcount);
625 TRACE("%p increasing refcount to %u\n", This, refcount);
630 static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
632 struct d3d10_effect *This = (struct d3d10_effect *)iface;
633 ULONG refcount = InterlockedDecrement(&This->refcount);
635 TRACE("%p decreasing refcount to %u\n", This, refcount);
639 if (This->techniques)
642 for (i = 0; i < This->technique_count; ++i)
644 d3d10_effect_technique_destroy(&This->techniques[i]);
646 HeapFree(GetProcessHeap(), 0, This->techniques);
648 ID3D10Device_Release(This->device);
649 HeapFree(GetProcessHeap(), 0, This);
655 /* ID3D10Effect methods */
657 static BOOL STDMETHODCALLTYPE d3d10_effect_IsValid(ID3D10Effect *iface)
659 FIXME("iface %p stub!\n", iface);
664 static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
666 FIXME("iface %p stub!\n", iface);
671 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
673 struct d3d10_effect *This = (struct d3d10_effect *)iface;
675 TRACE("iface %p, device %p\n", iface, device);
677 ID3D10Device_AddRef(This->device);
678 *device = This->device;
683 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)
685 FIXME("iface %p, desc %p stub!\n", iface, desc);
690 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface,
693 FIXME("iface %p, index %u stub!\n", iface, index);
698 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,
701 FIXME("iface %p, name \"%s\" stub!\n", iface, name);
706 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index)
708 FIXME("iface %p, index %u stub!\n", iface, index);
713 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name)
715 FIXME("iface %p, name \"%s\" stub!\n", iface, name);
720 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface,
723 FIXME("iface %p, semantic \"%s\" stub!\n", iface, semantic);
728 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByIndex(ID3D10Effect *iface,
731 struct d3d10_effect *This = (struct d3d10_effect *)iface;
732 struct d3d10_effect_technique *t;
734 TRACE("iface %p, index %u\n", iface, index);
736 if (index >= This->technique_count)
738 WARN("Invalid index specified\n");
742 t = &This->techniques[index];
744 TRACE("Returning technique %p, \"%s\"\n", t, t->name);
746 return (ID3D10EffectTechnique *)t;
749 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByName(ID3D10Effect *iface,
752 struct d3d10_effect *This = (struct d3d10_effect *)iface;
755 TRACE("iface %p, name \"%s\"\n", iface, name);
757 for (i = 0; i < This->technique_count; ++i)
759 struct d3d10_effect_technique *t = &This->techniques[i];
760 if (!strcmp(t->name, name))
762 TRACE("Returning technique %p\n", t);
763 return (ID3D10EffectTechnique *)t;
770 static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
772 FIXME("iface %p stub!\n", iface);
777 static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface)
779 FIXME("iface %p stub!\n", iface);
784 const struct ID3D10EffectVtbl d3d10_effect_vtbl =
786 /* IUnknown methods */
787 d3d10_effect_QueryInterface,
789 d3d10_effect_Release,
790 /* ID3D10Effect methods */
791 d3d10_effect_IsValid,
793 d3d10_effect_GetDevice,
794 d3d10_effect_GetDesc,
795 d3d10_effect_GetConstantBufferByIndex,
796 d3d10_effect_GetConstantBufferByName,
797 d3d10_effect_GetVariableByIndex,
798 d3d10_effect_GetVariableByName,
799 d3d10_effect_GetVariableBySemantic,
800 d3d10_effect_GetTechniqueByIndex,
801 d3d10_effect_GetTechniqueByName,
802 d3d10_effect_Optimize,
803 d3d10_effect_IsOptimized,
806 /* ID3D10EffectTechnique methods */
808 static BOOL STDMETHODCALLTYPE d3d10_effect_technique_IsValid(ID3D10EffectTechnique *iface)
810 FIXME("iface %p stub!\n", iface);
815 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_GetDesc(ID3D10EffectTechnique *iface,
816 D3D10_TECHNIQUE_DESC *desc)
818 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
820 TRACE("iface %p, desc %p\n", iface, desc);
822 desc->Name = This->name;
823 desc->Passes = This->pass_count;
824 WARN("Annotations not implemented\n");
825 desc->Annotations = 0;
830 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByIndex(
831 ID3D10EffectTechnique *iface, UINT index)
833 FIXME("iface %p, index %u stub!\n", iface, index);
838 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByName(
839 ID3D10EffectTechnique *iface, LPCSTR name)
841 FIXME("iface %p, name \"%s\" stub!\n", iface, name);
846 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique *iface,
849 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
850 struct d3d10_effect_pass *p;
852 TRACE("iface %p, index %u\n", iface, index);
854 if (index >= This->pass_count)
856 WARN("Invalid index specified\n");
860 p = &This->passes[index];
862 TRACE("Returning pass %p, \"%s\"\n", p, p->name);
864 return (ID3D10EffectPass *)p;
867 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique *iface,
870 struct d3d10_effect_technique *This = (struct d3d10_effect_technique *)iface;
873 TRACE("iface %p, name \"%s\"\n", iface, name);
875 for (i = 0; i < This->pass_count; ++i)
877 struct d3d10_effect_pass *p = &This->passes[i];
878 if (!strcmp(p->name, name))
880 TRACE("Returning pass %p\n", p);
881 return (ID3D10EffectPass *)p;
888 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique *iface,
889 D3D10_STATE_BLOCK_MASK *mask)
891 FIXME("iface %p,mask %p stub!\n", iface, mask);
896 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl =
898 /* ID3D10EffectTechnique methods */
899 d3d10_effect_technique_IsValid,
900 d3d10_effect_technique_GetDesc,
901 d3d10_effect_technique_GetAnnotationByIndex,
902 d3d10_effect_technique_GetAnnotationByName,
903 d3d10_effect_technique_GetPassByIndex,
904 d3d10_effect_technique_GetPassByName,
905 d3d10_effect_technique_ComputeStateBlockMask,
908 /* ID3D10EffectPass methods */
910 static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface)
912 FIXME("iface %p stub!\n", iface);
917 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface, D3D10_PASS_DESC *desc)
919 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
922 FIXME("iface %p, desc %p partial stub!\n", iface, desc);
924 memset(desc, 0, sizeof(*desc));
925 desc->Name = This->name;
926 for (i = 0; i < This->variable_count; ++i)
928 struct d3d10_effect_variable *v = &This->variables[i];
929 if (v->type == D3D10_EVT_VERTEXSHADER)
931 struct d3d10_effect_shader_variable *s = v->data;
932 desc->pIAInputSignature = (BYTE *)s->input_signature;
933 desc->IAInputSignatureSize = s->input_signature_size;
941 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface,
942 D3D10_PASS_SHADER_DESC *desc)
944 FIXME("iface %p, desc %p stub!\n", iface, desc);
949 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface,
950 D3D10_PASS_SHADER_DESC *desc)
952 FIXME("iface %p, desc %p stub!\n", iface, desc);
957 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface,
958 D3D10_PASS_SHADER_DESC *desc)
960 FIXME("iface %p, desc %p stub!\n", iface, desc);
965 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass *iface,
968 FIXME("iface %p, index %u stub!\n", iface, index);
973 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass *iface,
976 FIXME("iface %p, name \"%s\" stub!\n", iface, name);
981 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
983 struct d3d10_effect_pass *This = (struct d3d10_effect_pass *)iface;
987 TRACE("iface %p, flags %#x\n", iface, flags);
989 if (flags) FIXME("Ignoring flags (%#x)\n", flags);
991 for (i = 0; i < This->variable_count; ++i)
993 hr = d3d10_effect_variable_apply(&This->variables[i]);
994 if (FAILED(hr)) break;
1000 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass *iface,
1001 D3D10_STATE_BLOCK_MASK *mask)
1003 FIXME("iface %p, mask %p stub!\n", iface, mask);
1008 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl =
1010 /* ID3D10EffectPass methods */
1011 d3d10_effect_pass_IsValid,
1012 d3d10_effect_pass_GetDesc,
1013 d3d10_effect_pass_GetVertexShaderDesc,
1014 d3d10_effect_pass_GetGeometryShaderDesc,
1015 d3d10_effect_pass_GetPixelShaderDesc,
1016 d3d10_effect_pass_GetAnnotationByIndex,
1017 d3d10_effect_pass_GetAnnotationByName,
1018 d3d10_effect_pass_Apply,
1019 d3d10_effect_pass_ComputeStateBlockMask,