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
;
36 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl
;
37 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl
;
39 /* null objects - needed for invalid calls */
40 static struct d3d10_effect_technique null_technique
= {&d3d10_effect_technique_vtbl
, NULL
, NULL
, 0, 0, NULL
};
41 static struct d3d10_effect_pass null_pass
= {&d3d10_effect_pass_vtbl
, NULL
, NULL
, 0, 0, 0, NULL
};
42 static struct d3d10_effect_local_buffer null_local_buffer
= {&d3d10_effect_constant_buffer_vtbl
, NULL
, 0, 0, 0, NULL
};
43 static struct d3d10_effect_variable null_variable
= {&d3d10_effect_variable_vtbl
, NULL
, 0, 0};
45 static inline void read_dword(const char **ptr
, DWORD
*d
)
47 memcpy(d
, *ptr
, sizeof(*d
));
51 static inline void skip_dword_unknown(const char **ptr
, unsigned int count
)
56 FIXME("Skipping %u unknown DWORDs:\n", count
);
57 for (i
= 0; i
< count
; ++i
)
60 FIXME("\t0x%08x\n", d
);
64 static inline void write_dword(char **ptr
, DWORD d
)
66 memcpy(*ptr
, &d
, sizeof(d
));
70 static inline void write_dword_unknown(char **ptr
, DWORD d
)
72 FIXME("Writing unknown DWORD 0x%08x\n", d
);
76 static inline void read_tag(const char **ptr
, DWORD
*t
, char t_str
[5])
83 static HRESULT
parse_dxbc(const char *data
, SIZE_T data_size
,
84 HRESULT (*chunk_handler
)(const char *data
, DWORD data_size
, DWORD tag
, void *ctx
), void *ctx
)
86 const char *ptr
= data
;
94 read_tag(&ptr
, &tag
, tag_str
);
95 TRACE("tag: %s\n", tag_str
);
104 skip_dword_unknown(&ptr
, 4);
106 skip_dword_unknown(&ptr
, 1);
108 read_dword(&ptr
, &total_size
);
109 TRACE("total size: %#x\n", total_size
);
111 read_dword(&ptr
, &chunk_count
);
112 TRACE("chunk count: %#x\n", chunk_count
);
114 for (i
= 0; i
< chunk_count
; ++i
)
116 DWORD chunk_tag
, chunk_size
;
117 const char *chunk_ptr
;
120 read_dword(&ptr
, &chunk_offset
);
121 TRACE("chunk %u at offset %#x\n", i
, chunk_offset
);
123 chunk_ptr
= data
+ chunk_offset
;
125 read_dword(&chunk_ptr
, &chunk_tag
);
126 read_dword(&chunk_ptr
, &chunk_size
);
128 hr
= chunk_handler(chunk_ptr
, chunk_size
, chunk_tag
, ctx
);
129 if (FAILED(hr
)) break;
135 static char *copy_name(const char *ptr
)
140 name_len
= strlen(ptr
) + 1;
141 name
= HeapAlloc(GetProcessHeap(), 0, name_len
);
144 ERR("Failed to allocate name memory.\n");
148 memcpy(name
, ptr
, name_len
);
153 static HRESULT
shader_chunk_handler(const char *data
, DWORD data_size
, DWORD tag
, void *ctx
)
155 struct d3d10_effect_shader_variable
*s
= ctx
;
158 memcpy(tag_str
, &tag
, 4);
160 TRACE("tag: %s\n", tag_str
);
162 TRACE("chunk size: %#x\n", data_size
);
168 /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */
169 UINT size
= 44 + data_size
;
172 s
->input_signature
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, size
);
173 if (!s
->input_signature
)
175 ERR("Failed to allocate input signature data\n");
176 return E_OUTOFMEMORY
;
178 s
->input_signature_size
= size
;
180 ptr
= s
->input_signature
;
182 write_dword(&ptr
, TAG_DXBC
);
185 write_dword_unknown(&ptr
, 0);
186 write_dword_unknown(&ptr
, 0);
187 write_dword_unknown(&ptr
, 0);
188 write_dword_unknown(&ptr
, 0);
190 /* seems to be always 1 */
191 write_dword_unknown(&ptr
, 1);
194 write_dword(&ptr
, size
);
197 write_dword(&ptr
, 1);
200 write_dword(&ptr
, (ptr
- s
->input_signature
) + 4);
203 write_dword(&ptr
, TAG_ISGN
);
204 write_dword(&ptr
, data_size
);
205 memcpy(ptr
, data
, data_size
);
210 FIXME("Unhandled chunk %s\n", tag_str
);
217 static HRESULT
parse_shader(struct d3d10_effect_object
*o
, const char *data
)
219 ID3D10Device
*device
= o
->pass
->technique
->effect
->device
;
220 struct d3d10_effect_shader_variable
*s
;
221 const char *ptr
= data
;
225 o
->data
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(struct d3d10_effect_shader_variable
));
228 ERR("Failed to allocate shader variable memory\n");
229 return E_OUTOFMEMORY
;
232 if (!ptr
) return S_OK
;
236 read_dword(&ptr
, &dxbc_size
);
237 TRACE("dxbc size: %#x\n", dxbc_size
);
241 case D3D10_EOT_VERTEXSHADER
:
242 hr
= ID3D10Device_CreateVertexShader(device
, ptr
, dxbc_size
, &s
->shader
.vs
);
243 if (FAILED(hr
)) return hr
;
246 case D3D10_EOT_PIXELSHADER
:
247 hr
= ID3D10Device_CreatePixelShader(device
, ptr
, dxbc_size
, &s
->shader
.ps
);
248 if (FAILED(hr
)) return hr
;
250 case D3D10_EOT_GEOMETRYSHADER
:
251 hr
= ID3D10Device_CreateGeometryShader(device
, ptr
, dxbc_size
, &s
->shader
.gs
);
252 if (FAILED(hr
)) return hr
;
256 return parse_dxbc(ptr
, dxbc_size
, shader_chunk_handler
, s
);
259 static void parse_fx10_annotation(const char **ptr
)
261 skip_dword_unknown(ptr
, 3);
264 static HRESULT
parse_fx10_object(struct d3d10_effect_object
*o
, const char **ptr
, const char *data
)
266 const char *data_ptr
;
270 read_dword(ptr
, &o
->type
);
271 TRACE("Effect object is of type %#x.\n", o
->type
);
273 skip_dword_unknown(ptr
, 2);
275 read_dword(ptr
, &offset
);
276 TRACE("Effect object idx is at offset %#x.\n", offset
);
278 data_ptr
= data
+ offset
;
279 read_dword(&data_ptr
, &offset
);
281 TRACE("Effect object starts at offset %#x.\n", offset
);
283 /* FIXME: This probably isn't completely correct. */
286 WARN("Skipping effect object.\n");
291 data_ptr
= data
+ offset
;
296 case D3D10_EOT_VERTEXSHADER
:
297 TRACE("Vertex shader\n");
298 hr
= parse_shader(o
, data_ptr
);
301 case D3D10_EOT_PIXELSHADER
:
302 TRACE("Pixel shader\n");
303 hr
= parse_shader(o
, data_ptr
);
306 case D3D10_EOT_GEOMETRYSHADER
:
307 TRACE("Geometry shader\n");
308 hr
= parse_shader(o
, data_ptr
);
312 FIXME("Unhandled object type %#x\n", o
->type
);
320 static HRESULT
parse_fx10_pass(struct d3d10_effect_pass
*p
, const char **ptr
, const char *data
)
326 read_dword(ptr
, &offset
);
327 TRACE("Pass name at offset %#x.\n", offset
);
329 p
->name
= copy_name(data
+ offset
);
332 ERR("Failed to copy name.\n");
333 return E_OUTOFMEMORY
;
335 TRACE("Pass name: %s.\n", p
->name
);
337 read_dword(ptr
, &p
->object_count
);
338 TRACE("Pass has %u effect objects.\n", p
->object_count
);
340 read_dword(ptr
, &p
->annotation_count
);
341 for(i
= 0; i
< p
->annotation_count
; ++i
)
343 parse_fx10_annotation(ptr
);
346 p
->objects
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, p
->object_count
* sizeof(*p
->objects
));
349 ERR("Failed to allocate effect objects memory.\n");
350 return E_OUTOFMEMORY
;
353 for (i
= 0; i
< p
->object_count
; ++i
)
355 struct d3d10_effect_object
*o
= &p
->objects
[i
];
359 hr
= parse_fx10_object(o
, ptr
, data
);
360 if (FAILED(hr
)) return hr
;
366 static HRESULT
parse_fx10_technique(struct d3d10_effect_technique
*t
, const char **ptr
, const char *data
)
371 read_dword(ptr
, &offset
);
372 TRACE("Technique name at offset %#x.\n", offset
);
374 t
->name
= copy_name(data
+ offset
);
377 ERR("Failed to copy name.\n");
378 return E_OUTOFMEMORY
;
380 TRACE("Technique name: %s.\n", t
->name
);
382 read_dword(ptr
, &t
->pass_count
);
383 TRACE("Technique has %u passes\n", t
->pass_count
);
385 read_dword(ptr
, &t
->annotation_count
);
386 for(i
= 0; i
< t
->annotation_count
; ++i
)
388 parse_fx10_annotation(ptr
);
391 t
->passes
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, t
->pass_count
* sizeof(*t
->passes
));
394 ERR("Failed to allocate passes memory\n");
395 return E_OUTOFMEMORY
;
398 for (i
= 0; i
< t
->pass_count
; ++i
)
400 struct d3d10_effect_pass
*p
= &t
->passes
[i
];
403 p
->vtbl
= &d3d10_effect_pass_vtbl
;
406 hr
= parse_fx10_pass(p
, ptr
, data
);
407 if (FAILED(hr
)) return hr
;
413 static HRESULT
parse_fx10_variable(struct d3d10_effect_variable
*v
, const char **ptr
, const char *data
)
418 read_dword(ptr
, &offset
);
419 TRACE("Variable name at offset %#x.\n", offset
);
421 v
->name
= copy_name(data
+ offset
);
424 ERR("Failed to copy name.\n");
425 return E_OUTOFMEMORY
;
427 TRACE("Variable name: %s.\n", v
->name
);
429 read_dword(ptr
, &offset
);
430 TRACE("Variable type info at offset %#x.\n", offset
);
432 skip_dword_unknown(ptr
, 1);
434 read_dword(ptr
, &v
->buffer_offset
);
435 TRACE("Variable offset in buffer: %#x.\n", v
->buffer_offset
);
437 skip_dword_unknown(ptr
, 1);
439 read_dword(ptr
, &v
->flag
);
440 TRACE("Variable flag: %#x.\n", v
->flag
);
442 read_dword(ptr
, &v
->annotation_count
);
443 for(i
= 0; i
< v
->annotation_count
; ++i
)
445 parse_fx10_annotation(ptr
);
451 static HRESULT
parse_fx10_local_buffer(struct d3d10_effect_local_buffer
*l
, const char **ptr
, const char *data
)
456 read_dword(ptr
, &offset
);
457 TRACE("Local buffer name at offset %#x.\n", offset
);
459 l
->name
= copy_name(data
+ offset
);
462 ERR("Failed to copy name.\n");
463 return E_OUTOFMEMORY
;
465 TRACE("Local buffer name: %s.\n", l
->name
);
467 read_dword(ptr
, &l
->data_size
);
468 TRACE("Local buffer data size: %#x.\n", l
->data_size
);
470 skip_dword_unknown(ptr
, 1);
472 read_dword(ptr
, &l
->variable_count
);
473 TRACE("Local buffer variable count: %#x.\n", l
->variable_count
);
475 skip_dword_unknown(ptr
, 1);
477 read_dword(ptr
, &l
->annotation_count
);
478 for(i
= 0; i
< l
->annotation_count
; ++i
)
480 parse_fx10_annotation(ptr
);
483 l
->variables
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, l
->variable_count
* sizeof(*l
->variables
));
486 ERR("Failed to allocate variables memory.\n");
487 return E_OUTOFMEMORY
;
490 for (i
= 0; i
< l
->variable_count
; ++i
)
492 struct d3d10_effect_variable
*v
= &l
->variables
[i
];
495 v
->vtbl
= &d3d10_effect_variable_vtbl
;
497 hr
= parse_fx10_variable(v
, ptr
, data
);
498 if (FAILED(hr
)) return hr
;
504 static HRESULT
parse_fx10_body(struct d3d10_effect
*e
, const char *data
, DWORD data_size
)
506 const char *ptr
= data
+ e
->index_offset
;
510 e
->local_buffers
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->local_buffer_count
* sizeof(*e
->local_buffers
));
511 if (!e
->local_buffers
)
513 ERR("Failed to allocate local buffer memory.\n");
514 return E_OUTOFMEMORY
;
517 e
->techniques
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->technique_count
* sizeof(*e
->techniques
));
520 ERR("Failed to allocate techniques memory\n");
521 return E_OUTOFMEMORY
;
524 for (i
= 0; i
< e
->local_buffer_count
; ++i
)
526 struct d3d10_effect_local_buffer
*l
= &e
->local_buffers
[i
];
527 l
->vtbl
= &d3d10_effect_constant_buffer_vtbl
;
529 hr
= parse_fx10_local_buffer(l
, &ptr
, data
);
530 if (FAILED(hr
)) return hr
;
533 for (i
= 0; i
< e
->technique_count
; ++i
)
535 struct d3d10_effect_technique
*t
= &e
->techniques
[i
];
537 t
->vtbl
= &d3d10_effect_technique_vtbl
;
540 hr
= parse_fx10_technique(t
, &ptr
, data
);
541 if (FAILED(hr
)) return hr
;
547 static HRESULT
parse_fx10(struct d3d10_effect
*e
, const char *data
, DWORD data_size
)
549 const char *ptr
= data
;
552 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
553 read_dword(&ptr
, &e
->version
);
554 TRACE("Target: %#x\n", e
->version
);
556 read_dword(&ptr
, &e
->local_buffer_count
);
557 TRACE("Local buffer count: %u.\n", e
->local_buffer_count
);
559 read_dword(&ptr
, &e
->variable_count
);
560 TRACE("Variable count: %u\n", e
->variable_count
);
562 read_dword(&ptr
, &e
->object_count
);
563 TRACE("Object count: %u\n", e
->object_count
);
565 read_dword(&ptr
, &e
->sharedbuffers_count
);
566 TRACE("Sharedbuffers count: %u\n", e
->sharedbuffers_count
);
568 /* Number of variables in shared buffers? */
569 read_dword(&ptr
, &unknown
);
570 FIXME("Unknown 0: %u\n", unknown
);
572 read_dword(&ptr
, &e
->sharedobjects_count
);
573 TRACE("Sharedobjects count: %u\n", e
->sharedobjects_count
);
575 read_dword(&ptr
, &e
->technique_count
);
576 TRACE("Technique count: %u\n", e
->technique_count
);
578 read_dword(&ptr
, &e
->index_offset
);
579 TRACE("Index offset: %#x\n", e
->index_offset
);
581 read_dword(&ptr
, &unknown
);
582 FIXME("Unknown 1: %u\n", unknown
);
584 read_dword(&ptr
, &e
->texture_count
);
585 TRACE("Texture count: %u\n", e
->texture_count
);
587 read_dword(&ptr
, &e
->dephstencilstate_count
);
588 TRACE("Depthstencilstate count: %u\n", e
->dephstencilstate_count
);
590 read_dword(&ptr
, &e
->blendstate_count
);
591 TRACE("Blendstate count: %u\n", e
->blendstate_count
);
593 read_dword(&ptr
, &e
->rasterizerstate_count
);
594 TRACE("Rasterizerstate count: %u\n", e
->rasterizerstate_count
);
596 read_dword(&ptr
, &e
->samplerstate_count
);
597 TRACE("Samplerstate count: %u\n", e
->samplerstate_count
);
599 read_dword(&ptr
, &e
->rendertargetview_count
);
600 TRACE("Rendertargetview count: %u\n", e
->rendertargetview_count
);
602 read_dword(&ptr
, &e
->depthstencilview_count
);
603 TRACE("Depthstencilview count: %u\n", e
->depthstencilview_count
);
605 read_dword(&ptr
, &e
->shader_call_count
);
606 TRACE("Shader call count: %u\n", e
->shader_call_count
);
608 read_dword(&ptr
, &e
->shader_compile_count
);
609 TRACE("Shader compile count: %u\n", e
->shader_compile_count
);
611 return parse_fx10_body(e
, ptr
, data_size
- (ptr
- data
));
614 static HRESULT
fx10_chunk_handler(const char *data
, DWORD data_size
, DWORD tag
, void *ctx
)
616 struct d3d10_effect
*e
= ctx
;
619 memcpy(tag_str
, &tag
, 4);
621 TRACE("tag: %s\n", tag_str
);
623 TRACE("chunk size: %#x\n", data_size
);
628 return parse_fx10(e
, data
, data_size
);
631 FIXME("Unhandled chunk %s\n", tag_str
);
636 HRESULT
d3d10_effect_parse(struct d3d10_effect
*This
, const void *data
, SIZE_T data_size
)
638 return parse_dxbc(data
, data_size
, fx10_chunk_handler
, This
);
641 static void d3d10_effect_object_destroy(struct d3d10_effect_object
*o
)
643 TRACE("effect object %p.\n", o
);
647 case D3D10_EOT_VERTEXSHADER
:
648 case D3D10_EOT_PIXELSHADER
:
649 case D3D10_EOT_GEOMETRYSHADER
:
650 HeapFree(GetProcessHeap(), 0, ((struct d3d10_effect_shader_variable
*)o
->data
)->input_signature
);
656 HeapFree(GetProcessHeap(), 0, o
->data
);
659 static HRESULT
d3d10_effect_object_apply(struct d3d10_effect_object
*o
)
661 ID3D10Device
*device
= o
->pass
->technique
->effect
->device
;
663 TRACE("effect object %p, type %#x.\n", o
, o
->type
);
667 case D3D10_EOT_VERTEXSHADER
:
668 ID3D10Device_VSSetShader(device
, ((struct d3d10_effect_shader_variable
*)o
->data
)->shader
.vs
);
671 case D3D10_EOT_PIXELSHADER
:
672 ID3D10Device_PSSetShader(device
, ((struct d3d10_effect_shader_variable
*)o
->data
)->shader
.ps
);
675 case D3D10_EOT_GEOMETRYSHADER
:
676 ID3D10Device_GSSetShader(device
, ((struct d3d10_effect_shader_variable
*)o
->data
)->shader
.gs
);
680 FIXME("Unhandled effect object type %#x.\n", o
->type
);
685 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass
*p
)
687 TRACE("pass %p\n", p
);
689 HeapFree(GetProcessHeap(), 0, p
->name
);
693 for (i
= 0; i
< p
->object_count
; ++i
)
695 d3d10_effect_object_destroy(&p
->objects
[i
]);
697 HeapFree(GetProcessHeap(), 0, p
->objects
);
701 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique
*t
)
703 TRACE("technique %p\n", t
);
705 HeapFree(GetProcessHeap(), 0, t
->name
);
709 for (i
= 0; i
< t
->pass_count
; ++i
)
711 d3d10_effect_pass_destroy(&t
->passes
[i
]);
713 HeapFree(GetProcessHeap(), 0, t
->passes
);
717 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable
*v
)
719 TRACE("variable %p.\n", v
);
721 HeapFree(GetProcessHeap(), 0, v
->name
);
724 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_local_buffer
*l
)
726 TRACE("local buffer %p.\n", l
);
728 HeapFree(GetProcessHeap(), 0, l
->name
);
732 for (i
= 0; i
< l
->variable_count
; ++i
)
734 d3d10_effect_variable_destroy(&l
->variables
[i
]);
736 HeapFree(GetProcessHeap(), 0, l
->variables
);
740 /* IUnknown methods */
742 static HRESULT STDMETHODCALLTYPE
d3d10_effect_QueryInterface(ID3D10Effect
*iface
, REFIID riid
, void **object
)
744 TRACE("iface %p, riid %s, object %p\n", iface
, debugstr_guid(riid
), object
);
746 if (IsEqualGUID(riid
, &IID_ID3D10Effect
)
747 || IsEqualGUID(riid
, &IID_IUnknown
))
749 IUnknown_AddRef(iface
);
754 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid
));
757 return E_NOINTERFACE
;
760 static ULONG STDMETHODCALLTYPE
d3d10_effect_AddRef(ID3D10Effect
*iface
)
762 struct d3d10_effect
*This
= (struct d3d10_effect
*)iface
;
763 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
765 TRACE("%p increasing refcount to %u\n", This
, refcount
);
770 static ULONG STDMETHODCALLTYPE
d3d10_effect_Release(ID3D10Effect
*iface
)
772 struct d3d10_effect
*This
= (struct d3d10_effect
*)iface
;
773 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
775 TRACE("%p decreasing refcount to %u\n", This
, refcount
);
781 if (This
->techniques
)
783 for (i
= 0; i
< This
->technique_count
; ++i
)
785 d3d10_effect_technique_destroy(&This
->techniques
[i
]);
787 HeapFree(GetProcessHeap(), 0, This
->techniques
);
790 if (This
->local_buffers
)
792 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
794 d3d10_effect_local_buffer_destroy(&This
->local_buffers
[i
]);
796 HeapFree(GetProcessHeap(), 0, This
->local_buffers
);
799 ID3D10Device_Release(This
->device
);
800 HeapFree(GetProcessHeap(), 0, This
);
806 /* ID3D10Effect methods */
808 static BOOL STDMETHODCALLTYPE
d3d10_effect_IsValid(ID3D10Effect
*iface
)
810 FIXME("iface %p stub!\n", iface
);
815 static BOOL STDMETHODCALLTYPE
d3d10_effect_IsPool(ID3D10Effect
*iface
)
817 FIXME("iface %p stub!\n", iface
);
822 static HRESULT STDMETHODCALLTYPE
d3d10_effect_GetDevice(ID3D10Effect
*iface
, ID3D10Device
**device
)
824 struct d3d10_effect
*This
= (struct d3d10_effect
*)iface
;
826 TRACE("iface %p, device %p\n", iface
, device
);
828 ID3D10Device_AddRef(This
->device
);
829 *device
= This
->device
;
834 static HRESULT STDMETHODCALLTYPE
d3d10_effect_GetDesc(ID3D10Effect
*iface
, D3D10_EFFECT_DESC
*desc
)
836 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
841 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_GetConstantBufferByIndex(ID3D10Effect
*iface
,
844 struct d3d10_effect
*This
= (struct d3d10_effect
*)iface
;
845 struct d3d10_effect_local_buffer
*l
;
847 TRACE("iface %p, index %u\n", iface
, index
);
849 if (index
>= This
->local_buffer_count
)
851 WARN("Invalid index specified\n");
852 return (ID3D10EffectConstantBuffer
*)&null_local_buffer
;
855 l
= &This
->local_buffers
[index
];
857 TRACE("Returning buffer %p, \"%s\"\n", l
, l
->name
);
859 return (ID3D10EffectConstantBuffer
*)l
;
862 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_GetConstantBufferByName(ID3D10Effect
*iface
,
865 struct d3d10_effect
*This
= (struct d3d10_effect
*)iface
;
868 TRACE("iface %p, name \"%s\"\n", iface
, name
);
870 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
872 struct d3d10_effect_local_buffer
*l
= &This
->local_buffers
[i
];
874 if (!strcmp(l
->name
, name
))
876 TRACE("Returning buffer %p.\n", l
);
877 return (ID3D10EffectConstantBuffer
*)l
;
881 WARN("Invalid name specified\n");
883 return (ID3D10EffectConstantBuffer
*)&null_local_buffer
;
886 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_GetVariableByIndex(ID3D10Effect
*iface
, UINT index
)
888 FIXME("iface %p, index %u stub!\n", iface
, index
);
893 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_GetVariableByName(ID3D10Effect
*iface
, LPCSTR name
)
895 struct d3d10_effect
*This
= (struct d3d10_effect
*)iface
;
898 TRACE("iface %p, name \"%s\"\n", iface
, name
);
900 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
902 struct d3d10_effect_local_buffer
*l
= &This
->local_buffers
[i
];
905 for (j
= 0; j
< l
->variable_count
; ++j
)
907 struct d3d10_effect_variable
*v
= &l
->variables
[j
];
909 if (!strcmp(v
->name
, name
))
911 TRACE("Returning variable %p.\n", v
);
912 return (ID3D10EffectVariable
*)v
;
917 WARN("Invalid name specified\n");
919 return (ID3D10EffectVariable
*)&null_variable
;
922 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_GetVariableBySemantic(ID3D10Effect
*iface
,
925 FIXME("iface %p, semantic \"%s\" stub!\n", iface
, semantic
);
930 static struct ID3D10EffectTechnique
* STDMETHODCALLTYPE
d3d10_effect_GetTechniqueByIndex(ID3D10Effect
*iface
,
933 struct d3d10_effect
*This
= (struct d3d10_effect
*)iface
;
934 struct d3d10_effect_technique
*t
;
936 TRACE("iface %p, index %u\n", iface
, index
);
938 if (index
>= This
->technique_count
)
940 WARN("Invalid index specified\n");
941 return (ID3D10EffectTechnique
*)&null_technique
;
944 t
= &This
->techniques
[index
];
946 TRACE("Returning technique %p, \"%s\"\n", t
, t
->name
);
948 return (ID3D10EffectTechnique
*)t
;
951 static struct ID3D10EffectTechnique
* STDMETHODCALLTYPE
d3d10_effect_GetTechniqueByName(ID3D10Effect
*iface
,
954 struct d3d10_effect
*This
= (struct d3d10_effect
*)iface
;
957 TRACE("iface %p, name \"%s\"\n", iface
, name
);
959 for (i
= 0; i
< This
->technique_count
; ++i
)
961 struct d3d10_effect_technique
*t
= &This
->techniques
[i
];
962 if (!strcmp(t
->name
, name
))
964 TRACE("Returning technique %p\n", t
);
965 return (ID3D10EffectTechnique
*)t
;
969 WARN("Invalid name specified\n");
971 return (ID3D10EffectTechnique
*)&null_technique
;
974 static HRESULT STDMETHODCALLTYPE
d3d10_effect_Optimize(ID3D10Effect
*iface
)
976 FIXME("iface %p stub!\n", iface
);
981 static BOOL STDMETHODCALLTYPE
d3d10_effect_IsOptimized(ID3D10Effect
*iface
)
983 FIXME("iface %p stub!\n", iface
);
988 const struct ID3D10EffectVtbl d3d10_effect_vtbl
=
990 /* IUnknown methods */
991 d3d10_effect_QueryInterface
,
993 d3d10_effect_Release
,
994 /* ID3D10Effect methods */
995 d3d10_effect_IsValid
,
997 d3d10_effect_GetDevice
,
998 d3d10_effect_GetDesc
,
999 d3d10_effect_GetConstantBufferByIndex
,
1000 d3d10_effect_GetConstantBufferByName
,
1001 d3d10_effect_GetVariableByIndex
,
1002 d3d10_effect_GetVariableByName
,
1003 d3d10_effect_GetVariableBySemantic
,
1004 d3d10_effect_GetTechniqueByIndex
,
1005 d3d10_effect_GetTechniqueByName
,
1006 d3d10_effect_Optimize
,
1007 d3d10_effect_IsOptimized
,
1010 /* ID3D10EffectTechnique methods */
1012 static BOOL STDMETHODCALLTYPE
d3d10_effect_technique_IsValid(ID3D10EffectTechnique
*iface
)
1014 FIXME("iface %p stub!\n", iface
);
1019 static HRESULT STDMETHODCALLTYPE
d3d10_effect_technique_GetDesc(ID3D10EffectTechnique
*iface
,
1020 D3D10_TECHNIQUE_DESC
*desc
)
1022 struct d3d10_effect_technique
*This
= (struct d3d10_effect_technique
*)iface
;
1024 TRACE("iface %p, desc %p\n", iface
, desc
);
1026 if(This
== &null_technique
)
1028 WARN("Null technique specified\n");
1034 WARN("Invalid argument specified\n");
1035 return E_INVALIDARG
;
1038 desc
->Name
= This
->name
;
1039 desc
->Passes
= This
->pass_count
;
1040 WARN("Annotations not implemented\n");
1041 desc
->Annotations
= 0;
1046 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_technique_GetAnnotationByIndex(
1047 ID3D10EffectTechnique
*iface
, UINT index
)
1049 FIXME("iface %p, index %u stub!\n", iface
, index
);
1054 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_technique_GetAnnotationByName(
1055 ID3D10EffectTechnique
*iface
, LPCSTR name
)
1057 FIXME("iface %p, name \"%s\" stub!\n", iface
, name
);
1062 static struct ID3D10EffectPass
* STDMETHODCALLTYPE
d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique
*iface
,
1065 struct d3d10_effect_technique
*This
= (struct d3d10_effect_technique
*)iface
;
1066 struct d3d10_effect_pass
*p
;
1068 TRACE("iface %p, index %u\n", iface
, index
);
1070 if (index
>= This
->pass_count
)
1072 WARN("Invalid index specified\n");
1073 return (ID3D10EffectPass
*)&null_pass
;
1076 p
= &This
->passes
[index
];
1078 TRACE("Returning pass %p, \"%s\"\n", p
, p
->name
);
1080 return (ID3D10EffectPass
*)p
;
1083 static struct ID3D10EffectPass
* STDMETHODCALLTYPE
d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique
*iface
,
1086 struct d3d10_effect_technique
*This
= (struct d3d10_effect_technique
*)iface
;
1089 TRACE("iface %p, name \"%s\"\n", iface
, name
);
1091 for (i
= 0; i
< This
->pass_count
; ++i
)
1093 struct d3d10_effect_pass
*p
= &This
->passes
[i
];
1094 if (!strcmp(p
->name
, name
))
1096 TRACE("Returning pass %p\n", p
);
1097 return (ID3D10EffectPass
*)p
;
1101 WARN("Invalid name specified\n");
1103 return (ID3D10EffectPass
*)&null_pass
;
1106 static HRESULT STDMETHODCALLTYPE
d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique
*iface
,
1107 D3D10_STATE_BLOCK_MASK
*mask
)
1109 FIXME("iface %p,mask %p stub!\n", iface
, mask
);
1114 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl
=
1116 /* ID3D10EffectTechnique methods */
1117 d3d10_effect_technique_IsValid
,
1118 d3d10_effect_technique_GetDesc
,
1119 d3d10_effect_technique_GetAnnotationByIndex
,
1120 d3d10_effect_technique_GetAnnotationByName
,
1121 d3d10_effect_technique_GetPassByIndex
,
1122 d3d10_effect_technique_GetPassByName
,
1123 d3d10_effect_technique_ComputeStateBlockMask
,
1126 /* ID3D10EffectPass methods */
1128 static BOOL STDMETHODCALLTYPE
d3d10_effect_pass_IsValid(ID3D10EffectPass
*iface
)
1130 FIXME("iface %p stub!\n", iface
);
1135 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetDesc(ID3D10EffectPass
*iface
, D3D10_PASS_DESC
*desc
)
1137 struct d3d10_effect_pass
*This
= (struct d3d10_effect_pass
*)iface
;
1140 FIXME("iface %p, desc %p partial stub!\n", iface
, desc
);
1142 if(This
== &null_pass
)
1144 WARN("Null pass specified\n");
1150 WARN("Invalid argument specified\n");
1151 return E_INVALIDARG
;
1154 memset(desc
, 0, sizeof(*desc
));
1155 desc
->Name
= This
->name
;
1156 for (i
= 0; i
< This
->object_count
; ++i
)
1158 struct d3d10_effect_object
*o
= &This
->objects
[i
];
1159 if (o
->type
== D3D10_EOT_VERTEXSHADER
)
1161 struct d3d10_effect_shader_variable
*s
= o
->data
;
1162 desc
->pIAInputSignature
= (BYTE
*)s
->input_signature
;
1163 desc
->IAInputSignatureSize
= s
->input_signature_size
;
1171 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass
*iface
,
1172 D3D10_PASS_SHADER_DESC
*desc
)
1174 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
1179 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass
*iface
,
1180 D3D10_PASS_SHADER_DESC
*desc
)
1182 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
1187 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass
*iface
,
1188 D3D10_PASS_SHADER_DESC
*desc
)
1190 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
1195 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass
*iface
,
1198 FIXME("iface %p, index %u stub!\n", iface
, index
);
1203 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass
*iface
,
1206 FIXME("iface %p, name \"%s\" stub!\n", iface
, name
);
1211 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_Apply(ID3D10EffectPass
*iface
, UINT flags
)
1213 struct d3d10_effect_pass
*This
= (struct d3d10_effect_pass
*)iface
;
1217 TRACE("iface %p, flags %#x\n", iface
, flags
);
1219 if (flags
) FIXME("Ignoring flags (%#x)\n", flags
);
1221 for (i
= 0; i
< This
->object_count
; ++i
)
1223 hr
= d3d10_effect_object_apply(&This
->objects
[i
]);
1224 if (FAILED(hr
)) break;
1230 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass
*iface
,
1231 D3D10_STATE_BLOCK_MASK
*mask
)
1233 FIXME("iface %p, mask %p stub!\n", iface
, mask
);
1238 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl
=
1240 /* ID3D10EffectPass methods */
1241 d3d10_effect_pass_IsValid
,
1242 d3d10_effect_pass_GetDesc
,
1243 d3d10_effect_pass_GetVertexShaderDesc
,
1244 d3d10_effect_pass_GetGeometryShaderDesc
,
1245 d3d10_effect_pass_GetPixelShaderDesc
,
1246 d3d10_effect_pass_GetAnnotationByIndex
,
1247 d3d10_effect_pass_GetAnnotationByName
,
1248 d3d10_effect_pass_Apply
,
1249 d3d10_effect_pass_ComputeStateBlockMask
,
1252 /* ID3D10EffectVariable methods */
1254 static BOOL STDMETHODCALLTYPE
d3d10_effect_variable_IsValid(ID3D10EffectVariable
*iface
)
1256 FIXME("iface %p stub!\n", iface
);
1261 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_variable_GetType(ID3D10EffectVariable
*iface
)
1263 FIXME("iface %p stub!\n", iface
);
1268 static HRESULT STDMETHODCALLTYPE
d3d10_effect_variable_GetDesc(ID3D10EffectVariable
*iface
,
1269 D3D10_EFFECT_VARIABLE_DESC
*desc
)
1271 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
1276 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetAnnotationByIndex(
1277 ID3D10EffectVariable
*iface
, UINT index
)
1279 FIXME("iface %p, index %u stub!\n", iface
, index
);
1284 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetAnnotationByName(
1285 ID3D10EffectVariable
*iface
, LPCSTR name
)
1287 FIXME("iface %p, name \"%s\" stub!\n", iface
, name
);
1292 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetMemberByIndex(
1293 ID3D10EffectVariable
*iface
, UINT index
)
1295 FIXME("iface %p, index %u stub!\n", iface
, index
);
1300 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetMemberByName(
1301 ID3D10EffectVariable
*iface
, LPCSTR name
)
1303 FIXME("iface %p, name \"%s\" stub!\n", iface
, name
);
1308 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetMemberBySemantic(
1309 ID3D10EffectVariable
*iface
, LPCSTR semantic
)
1311 FIXME("iface %p, semantic \"%s\" stub!\n", iface
, semantic
);
1316 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetElement(
1317 ID3D10EffectVariable
*iface
, UINT index
)
1319 FIXME("iface %p, index %u stub!\n", iface
, index
);
1324 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_variable_GetParentConstantBuffer(
1325 ID3D10EffectVariable
*iface
)
1327 FIXME("iface %p stub!\n", iface
);
1332 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsScalar(
1333 ID3D10EffectVariable
*iface
)
1335 FIXME("iface %p stub!\n", iface
);
1340 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsVector(
1341 ID3D10EffectVariable
*iface
)
1343 FIXME("iface %p stub!\n", iface
);
1348 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsMatrix(
1349 ID3D10EffectVariable
*iface
)
1351 FIXME("iface %p stub!\n", iface
);
1356 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsString(
1357 ID3D10EffectVariable
*iface
)
1359 FIXME("iface %p stub!\n", iface
);
1364 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsShaderResource(
1365 ID3D10EffectVariable
*iface
)
1367 FIXME("iface %p stub!\n", iface
);
1372 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsRenderTargetView(
1373 ID3D10EffectVariable
*iface
)
1375 FIXME("iface %p stub!\n", iface
);
1380 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsDepthStencilView(
1381 ID3D10EffectVariable
*iface
)
1383 FIXME("iface %p stub!\n", iface
);
1388 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_variable_AsConstantBuffer(
1389 ID3D10EffectVariable
*iface
)
1391 FIXME("iface %p stub!\n", iface
);
1396 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsShader(
1397 ID3D10EffectVariable
*iface
)
1399 FIXME("iface %p stub!\n", iface
);
1404 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsBlend(ID3D10EffectVariable
*iface
)
1406 FIXME("iface %p stub!\n", iface
);
1411 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsDepthStencil(
1412 ID3D10EffectVariable
*iface
)
1414 FIXME("iface %p stub!\n", iface
);
1419 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsRasterizer(
1420 ID3D10EffectVariable
*iface
)
1422 FIXME("iface %p stub!\n", iface
);
1427 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsSampler(
1428 ID3D10EffectVariable
*iface
)
1430 FIXME("iface %p stub!\n", iface
);
1435 static HRESULT STDMETHODCALLTYPE
d3d10_effect_variable_SetRawValue(ID3D10EffectVariable
*iface
,
1436 void *data
, UINT offset
, UINT count
)
1438 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
1443 static HRESULT STDMETHODCALLTYPE
d3d10_effect_variable_GetRawValue(ID3D10EffectVariable
*iface
,
1444 void *data
, UINT offset
, UINT count
)
1446 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
1451 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl
=
1453 /* ID3D10EffectVariable methods */
1454 d3d10_effect_variable_IsValid
,
1455 d3d10_effect_variable_GetType
,
1456 d3d10_effect_variable_GetDesc
,
1457 d3d10_effect_variable_GetAnnotationByIndex
,
1458 d3d10_effect_variable_GetAnnotationByName
,
1459 d3d10_effect_variable_GetMemberByIndex
,
1460 d3d10_effect_variable_GetMemberByName
,
1461 d3d10_effect_variable_GetMemberBySemantic
,
1462 d3d10_effect_variable_GetElement
,
1463 d3d10_effect_variable_GetParentConstantBuffer
,
1464 d3d10_effect_variable_AsScalar
,
1465 d3d10_effect_variable_AsVector
,
1466 d3d10_effect_variable_AsMatrix
,
1467 d3d10_effect_variable_AsString
,
1468 d3d10_effect_variable_AsShaderResource
,
1469 d3d10_effect_variable_AsRenderTargetView
,
1470 d3d10_effect_variable_AsDepthStencilView
,
1471 d3d10_effect_variable_AsConstantBuffer
,
1472 d3d10_effect_variable_AsShader
,
1473 d3d10_effect_variable_AsBlend
,
1474 d3d10_effect_variable_AsDepthStencil
,
1475 d3d10_effect_variable_AsRasterizer
,
1476 d3d10_effect_variable_AsSampler
,
1477 d3d10_effect_variable_SetRawValue
,
1478 d3d10_effect_variable_GetRawValue
,
1481 /* ID3D10EffectVariable methods */
1482 static BOOL STDMETHODCALLTYPE
d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer
*iface
)
1484 FIXME("iface %p stub!\n", iface
);
1489 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer
*iface
)
1491 FIXME("iface %p stub!\n", iface
);
1496 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer
*iface
,
1497 D3D10_EFFECT_VARIABLE_DESC
*desc
)
1499 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
1504 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetAnnotationByIndex(
1505 ID3D10EffectConstantBuffer
*iface
, UINT index
)
1507 FIXME("iface %p, index %u stub!\n", iface
, index
);
1512 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetAnnotationByName(
1513 ID3D10EffectConstantBuffer
*iface
, LPCSTR name
)
1515 FIXME("iface %p, name \"%s\" stub!\n", iface
, name
);
1520 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetMemberByIndex(
1521 ID3D10EffectConstantBuffer
*iface
, UINT index
)
1523 FIXME("iface %p, index %u stub!\n", iface
, index
);
1528 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetMemberByName(
1529 ID3D10EffectConstantBuffer
*iface
, LPCSTR name
)
1531 FIXME("iface %p, name \"%s\" stub!\n", iface
, name
);
1536 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetMemberBySemantic(
1537 ID3D10EffectConstantBuffer
*iface
, LPCSTR semantic
)
1539 FIXME("iface %p, semantic \"%s\" stub!\n", iface
, semantic
);
1544 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetElement(
1545 ID3D10EffectConstantBuffer
*iface
, UINT index
)
1547 FIXME("iface %p, index %u stub!\n", iface
, index
);
1552 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetParentConstantBuffer(
1553 ID3D10EffectConstantBuffer
*iface
)
1555 FIXME("iface %p stub!\n", iface
);
1560 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsScalar(
1561 ID3D10EffectConstantBuffer
*iface
)
1563 FIXME("iface %p stub!\n", iface
);
1568 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsVector(
1569 ID3D10EffectConstantBuffer
*iface
)
1571 FIXME("iface %p stub!\n", iface
);
1576 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsMatrix(
1577 ID3D10EffectConstantBuffer
*iface
)
1579 FIXME("iface %p stub!\n", iface
);
1584 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsString(
1585 ID3D10EffectConstantBuffer
*iface
)
1587 FIXME("iface %p stub!\n", iface
);
1592 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsShaderResource(
1593 ID3D10EffectConstantBuffer
*iface
)
1595 FIXME("iface %p stub!\n", iface
);
1600 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsRenderTargetView(
1601 ID3D10EffectConstantBuffer
*iface
)
1603 FIXME("iface %p stub!\n", iface
);
1608 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsDepthStencilView(
1609 ID3D10EffectConstantBuffer
*iface
)
1611 FIXME("iface %p stub!\n", iface
);
1616 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsConstantBuffer(
1617 ID3D10EffectConstantBuffer
*iface
)
1619 FIXME("iface %p stub!\n", iface
);
1624 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsShader(
1625 ID3D10EffectConstantBuffer
*iface
)
1627 FIXME("iface %p stub!\n", iface
);
1632 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer
*iface
)
1634 FIXME("iface %p stub!\n", iface
);
1639 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsDepthStencil(
1640 ID3D10EffectConstantBuffer
*iface
)
1642 FIXME("iface %p stub!\n", iface
);
1647 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsRasterizer(
1648 ID3D10EffectConstantBuffer
*iface
)
1650 FIXME("iface %p stub!\n", iface
);
1655 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsSampler(
1656 ID3D10EffectConstantBuffer
*iface
)
1658 FIXME("iface %p stub!\n", iface
);
1663 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer
*iface
,
1664 void *data
, UINT offset
, UINT count
)
1666 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
1671 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer
*iface
,
1672 void *data
, UINT offset
, UINT count
)
1674 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
1679 /* ID3D10EffectConstantBuffer methods */
1680 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer
*iface
,
1681 ID3D10Buffer
*buffer
)
1683 FIXME("iface %p, buffer %p stub!\n", iface
, buffer
);
1688 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer
*iface
,
1689 ID3D10Buffer
**buffer
)
1691 FIXME("iface %p, buffer %p stub!\n", iface
, buffer
);
1696 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer
*iface
,
1697 ID3D10ShaderResourceView
*view
)
1699 FIXME("iface %p, view %p stub!\n", iface
, view
);
1704 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer
*iface
,
1705 ID3D10ShaderResourceView
**view
)
1707 FIXME("iface %p, view %p stub!\n", iface
, view
);
1712 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl
=
1714 /* ID3D10EffectVariable methods */
1715 d3d10_effect_constant_buffer_IsValid
,
1716 d3d10_effect_constant_buffer_GetType
,
1717 d3d10_effect_constant_buffer_GetDesc
,
1718 d3d10_effect_constant_buffer_GetAnnotationByIndex
,
1719 d3d10_effect_constant_buffer_GetAnnotationByName
,
1720 d3d10_effect_constant_buffer_GetMemberByIndex
,
1721 d3d10_effect_constant_buffer_GetMemberByName
,
1722 d3d10_effect_constant_buffer_GetMemberBySemantic
,
1723 d3d10_effect_constant_buffer_GetElement
,
1724 d3d10_effect_constant_buffer_GetParentConstantBuffer
,
1725 d3d10_effect_constant_buffer_AsScalar
,
1726 d3d10_effect_constant_buffer_AsVector
,
1727 d3d10_effect_constant_buffer_AsMatrix
,
1728 d3d10_effect_constant_buffer_AsString
,
1729 d3d10_effect_constant_buffer_AsShaderResource
,
1730 d3d10_effect_constant_buffer_AsRenderTargetView
,
1731 d3d10_effect_constant_buffer_AsDepthStencilView
,
1732 d3d10_effect_constant_buffer_AsConstantBuffer
,
1733 d3d10_effect_constant_buffer_AsShader
,
1734 d3d10_effect_constant_buffer_AsBlend
,
1735 d3d10_effect_constant_buffer_AsDepthStencil
,
1736 d3d10_effect_constant_buffer_AsRasterizer
,
1737 d3d10_effect_constant_buffer_AsSampler
,
1738 d3d10_effect_constant_buffer_SetRawValue
,
1739 d3d10_effect_constant_buffer_GetRawValue
,
1740 /* ID3D10EffectConstantBuffer methods */
1741 d3d10_effect_constant_buffer_SetConstantBuffer
,
1742 d3d10_effect_constant_buffer_GetConstantBuffer
,
1743 d3d10_effect_constant_buffer_SetTextureBuffer
,
1744 d3d10_effect_constant_buffer_GetTextureBuffer
,