ReactOS 0.4.17-dev-923-g4c9a150
effect.c
Go to the documentation of this file.
1/*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
3 * Copyright 2009 Rico Schüller
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 *
19 */
20
21#include "d3d10_private.h"
22#include <vkd3d_shader.h>
23
24#include <float.h>
25#include <stdint.h>
26
28
29#define MAKE_TAG(ch0, ch1, ch2, ch3) \
30 ((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \
31 ((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
32#define TAG_FX10 MAKE_TAG('F', 'X', '1', '0')
33#define TAG_FXLC MAKE_TAG('F', 'X', 'L', 'C')
34#define TAG_CLI4 MAKE_TAG('C', 'L', 'I', '4')
35#define TAG_CTAB MAKE_TAG('C', 'T', 'A', 'B')
36
38{
40}
41
42const struct ID3D10EffectPoolVtbl d3d10_effect_pool_vtbl;
44{
45 if (!iface || iface->lpVtbl != &d3d10_effect_pool_vtbl)
46 return NULL;
48}
49
50static const struct ID3D10EffectVtbl d3d10_effect_pool_effect_vtbl;
52
53static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl;
54static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl;
55static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl;
56static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl;
57static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl;
58static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl;
59static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl;
60static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl;
61static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl;
62static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl;
63static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl;
64static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl;
65static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl;
66static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl;
67static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl;
68static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl;
69static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl;
70
71/* null objects - needed for invalid calls */
75static struct d3d10_effect_variable null_local_buffer = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl},
79static struct d3d10_effect_variable null_scalar_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl},
81static struct d3d10_effect_variable null_vector_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl},
83static struct d3d10_effect_variable null_matrix_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl},
85static struct d3d10_effect_variable null_string_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl},
91static struct d3d10_effect_variable null_shader_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
93static struct d3d10_effect_variable null_blend_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl},
97static struct d3d10_effect_variable null_rasterizer_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl},
99static struct d3d10_effect_variable null_sampler_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl},
101
103
105{
106 .ID3D10EffectVariable_iface.lpVtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl,
108 .type = &null_type,
109 .u.resource.srv = null_srvs,
110};
111
112/* anonymous_shader_type and anonymous_shader */
113static char anonymous_name[] = "$Anonymous";
114static char anonymous_vertexshader_name[] = "vertexshader";
115static char anonymous_pixelshader_name[] = "pixelshader";
116static char anonymous_geometryshader_name[] = "geometryshader";
123static struct d3d10_effect_variable anonymous_vs = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
125static struct d3d10_effect_variable anonymous_ps = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
127static struct d3d10_effect_variable anonymous_gs = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
129
131 const char *data, size_t data_size, uint32_t offset);
132
134{
136}
137
139{
141}
142
144 unsigned int index)
145{
146 if (!v->type->element_count) return v;
147 return &v->elements[index];
148}
149
151 unsigned int index, const struct d3d10_effect_var_array *array)
152{
154
155 if (v->u.state.index + index >= array->count)
156 {
157 WARN("Invalid index %u.\n", index);
158 return NULL;
159 }
160
161 return array->v[v->u.state.index + index];
162}
163
165{
172};
173
175{
176 switch (v->type->basetype)
177 {
179 case D3D10_SVT_BLEND: return D3D10_C_BLEND;
182 default: return D3D10_C_NONE;
183 }
184}
185
187{
188 unsigned int comp_count : 16;
189 unsigned int reserved : 4;
190 unsigned int opcode : 11;
191 unsigned int scalar : 1;
192};
193
194typedef void (*pres_op_func)(float **args, unsigned int n, const struct preshader_instr *instr);
195
196static void pres_mov(float **args, unsigned int n, const struct preshader_instr *instr)
197{
198 float *retval = args[1];
199 unsigned int i;
200
201 for (i = 0; i < instr->comp_count; ++i)
202 retval[i] = args[0][i];
203}
204
205static void pres_neg(float **args, unsigned int n, const struct preshader_instr *instr)
206{
207 float *retval = args[1];
208 unsigned int i;
209
210 for (i = 0; i < instr->comp_count; ++i)
211 retval[i] = -args[0][i];
212}
213
214static void pres_rcp(float **args, unsigned int n, const struct preshader_instr *instr)
215{
216 float *retval = args[1];
217 unsigned int i;
218
219 for (i = 0; i < instr->comp_count; ++i)
220 retval[i] = 1.0f / args[0][i];
221}
222
223static void pres_frc(float **args, unsigned int n, const struct preshader_instr *instr)
224{
225 float *retval = args[1];
226 unsigned int i;
227
228 for (i = 0; i < instr->comp_count; ++i)
229 retval[i] = args[0][i] - floor(args[0][i]);
230}
231
232static void pres_exp(float **args, unsigned int n, const struct preshader_instr *instr)
233{
234 float *retval = args[1];
235 unsigned int i;
236
237 for (i = 0; i < instr->comp_count; ++i)
238 retval[i] = exp2f(args[0][i]);
239}
240
241static void pres_log(float **args, unsigned int n, const struct preshader_instr *instr)
242{
243 float *retval = args[1];
244 unsigned int i;
245
246 for (i = 0; i < instr->comp_count; ++i)
247 retval[i] = (args[0][i] == 0.0f ? 0.0f : log2f(fabsf(args[0][i])));
248}
249
250static void pres_rsq(float **args, unsigned int n, const struct preshader_instr *instr)
251{
252 float *retval = args[1];
253 unsigned int i;
254
255 for (i = 0; i < instr->comp_count; ++i)
256 retval[i] = 1.0f / sqrtf(args[0][i]);
257}
258
259static void pres_sin(float **args, unsigned int n, const struct preshader_instr *instr)
260{
261 float *retval = args[1];
262 unsigned int i;
263
264 for (i = 0; i < instr->comp_count; ++i)
265 retval[i] = sin(args[0][i]);
266}
267
268static void pres_cos(float **args, unsigned int n, const struct preshader_instr *instr)
269{
270 float *retval = args[1];
271 unsigned int i;
272
273 for (i = 0; i < instr->comp_count; ++i)
274 retval[i] = cos(args[0][i]);
275}
276
277static void pres_asin(float **args, unsigned int n, const struct preshader_instr *instr)
278{
279 float *retval = args[1];
280 unsigned int i;
281
282 for (i = 0; i < instr->comp_count; ++i)
283 retval[i] = asinf(args[0][i]);
284}
285
286static void pres_acos(float **args, unsigned int n, const struct preshader_instr *instr)
287{
288 float *retval = args[1];
289 unsigned int i;
290
291 for (i = 0; i < instr->comp_count; ++i)
292 retval[i] = acosf(args[0][i]);
293}
294
295static void pres_atan(float **args, unsigned int n, const struct preshader_instr *instr)
296{
297 float *retval = args[1];
298 unsigned int i;
299
300 for (i = 0; i < instr->comp_count; ++i)
301 retval[i] = atanf(args[0][i]);
302}
303
304static void pres_sqrt(float **args, unsigned int n, const struct preshader_instr *instr)
305{
306 float *retval = args[1];
307 unsigned int i;
308
309 for (i = 0; i < instr->comp_count; ++i)
310 retval[i] = sqrtf(args[0][i]);
311}
312
313static void pres_ineg(float **args, unsigned int n, const struct preshader_instr *instr)
314{
315 int *arg1 = (int *)args[0];
316 float *retval = args[1];
317 unsigned int i;
318
319 for (i = 0; i < instr->comp_count; ++i)
320 {
321 int v = -arg1[i];
322 retval[i] = *(float *)&v;
323 }
324}
325
326static void pres_not(float **args, unsigned int n, const struct preshader_instr *instr)
327{
328 int *arg1 = (int *)args[0];
329 float *retval = args[1];
330 unsigned int i;
331
332 for (i = 0; i < instr->comp_count; ++i)
333 {
334 int v = ~arg1[0];
335 retval[i] = *(float *)&v;
336 }
337}
338
339static void pres_itof(float **args, unsigned int n, const struct preshader_instr *instr)
340{
341 float *retval = args[1];
342 unsigned int i;
343
344 for (i = 0; i < instr->comp_count; ++i)
345 retval[i] = *(int *)&args[0][i];
346}
347
348static void pres_utof(float **args, unsigned int n, const struct preshader_instr *instr)
349{
350 float *retval = args[1];
351 unsigned int i;
352
353 for (i = 0; i < instr->comp_count; ++i)
354 retval[i] = *(unsigned int *)&args[0][i];
355}
356
357static void pres_ftou(float **args, unsigned int n, const struct preshader_instr *instr)
358{
359 float *retval = args[1];
360 unsigned int i;
361
362 for (i = 0; i < instr->comp_count; ++i)
363 {
364 unsigned int u = args[0][i];
365 retval[i] = *(float *)&u;
366 }
367}
368
369static void pres_ftob(float **args, unsigned int n, const struct preshader_instr *instr)
370{
371 float *retval = args[1];
372 unsigned int i;
373
374 for (i = 0; i < instr->comp_count; ++i)
375 {
376 unsigned int u = args[0][i] == 0.0f ? 0 : ~0u;
377 retval[i] = *(float *)&u;
378 }
379}
380
381/* Only first source component is used. */
382static void pres_floor(float **args, unsigned int n, const struct preshader_instr *instr)
383{
384 float value = floorf(args[0][0]);
385 float *retval = args[1];
386 unsigned int i;
387
388 for (i = 0; i < instr->comp_count; ++i)
389 retval[i] = value;
390}
391
392/* Only first source component is used. */
393static void pres_ceil(float **args, unsigned int n, const struct preshader_instr *instr)
394{
395 float value = ceilf(args[0][0]);
396 float *retval = args[1];
397 unsigned int i;
398
399 for (i = 0; i < instr->comp_count; ++i)
400 retval[i] = value;
401}
402
403static void pres_min(float **args, unsigned int n, const struct preshader_instr *instr)
404{
405 float *retval = args[2];
406 unsigned int i;
407
408 for (i = 0; i < instr->comp_count; ++i)
409 retval[i] = min(args[0][instr->scalar ? 0 : i], args[1][i]);
410}
411
412static void pres_max(float **args, unsigned int n, const struct preshader_instr *instr)
413{
414 float *retval = args[2];
415 unsigned int i;
416
417 for (i = 0; i < instr->comp_count; ++i)
418 retval[i] = max(args[0][instr->scalar ? 0 : i], args[1][i]);
419}
420
421static void pres_add(float **args, unsigned int n, const struct preshader_instr *instr)
422{
423 float *retval = args[2];
424 unsigned int i;
425
426 for (i = 0; i < instr->comp_count; ++i)
427 retval[i] = args[0][instr->scalar ? 0 : i] + args[1][i];
428}
429
430static void pres_mul(float **args, unsigned int n, const struct preshader_instr *instr)
431{
432 float *retval = args[2];
433 unsigned int i;
434
435 for (i = 0; i < instr->comp_count; ++i)
436 retval[i] = args[0][instr->scalar ? 0 : i] * args[1][i];
437}
438
439static void pres_atan2(float **args, unsigned int n, const struct preshader_instr *instr)
440{
441 float *retval = args[2];
442 unsigned int i;
443
444 for (i = 0; i < instr->comp_count; ++i)
445 retval[i] = atan2f(args[0][instr->scalar ? 0 : i], args[1][i]);
446}
447
448static void pres_div(float **args, unsigned int n, const struct preshader_instr *instr)
449{
450 float *retval = args[2];
451 unsigned int i;
452
453 for (i = 0; i < instr->comp_count; ++i)
454 retval[i] = args[0][instr->scalar ? 0 : i] / args[1][i];
455}
456
457static void pres_iadd(float **args, unsigned int n, const struct preshader_instr *instr)
458{
459 int *arg1 = (int *)args[0];
460 int *arg2 = (int *)args[1];
461 float *retval = args[2];
462 unsigned int i;
463
464 for (i = 0; i < instr->comp_count; ++i)
465 {
466 int v = arg1[instr->scalar ? 0 : i] + arg2[i];
467 retval[i] = *(float *)&v;
468 }
469}
470
471static void pres_imul(float **args, unsigned int n, const struct preshader_instr *instr)
472{
473 int *arg1 = (int *)args[0];
474 int *arg2 = (int *)args[1];
475 float *retval = args[2];
476 unsigned int i;
477
478 for (i = 0; i < instr->comp_count; ++i)
479 {
480 int v = arg1[instr->scalar ? 0 : i] * arg2[i];
481 retval[i] = *(float *)&v;
482 }
483}
484
485static void pres_bilt(float **args, unsigned int n, const struct preshader_instr *instr)
486{
487 int *arg1 = (int *)args[0];
488 int *arg2 = (int *)args[1];
489 float *retval = args[2];
490 unsigned int i;
491
492 for (i = 0; i < instr->comp_count; ++i)
493 {
494 unsigned int v = arg1[instr->scalar ? 0 : i] < arg2[i] ? ~0u : 0;
495 retval[i] = *(float *)&v;
496 }
497}
498
499static void pres_bige(float **args, unsigned int n, const struct preshader_instr *instr)
500{
501 int *arg1 = (int *)args[0];
502 int *arg2 = (int *)args[1];
503 float *retval = args[2];
504 unsigned int i;
505
506 for (i = 0; i < instr->comp_count; ++i)
507 {
508 unsigned int v = arg1[instr->scalar ? 0 : i] >= arg2[i] ? ~0u : 0;
509 retval[i] = *(float *)&v;
510 }
511}
512
513static void pres_bieq(float **args, unsigned int n, const struct preshader_instr *instr)
514{
515 int *arg1 = (int *)args[0];
516 int *arg2 = (int *)args[1];
517 float *retval = args[2];
518 unsigned int i;
519
520 for (i = 0; i < instr->comp_count; ++i)
521 {
522 unsigned int v = arg1[instr->scalar ? 0 : i] == arg2[i] ? ~0u : 0;
523 retval[i] = *(float *)&v;
524 }
525}
526
527static void pres_bine(float **args, unsigned int n, const struct preshader_instr *instr)
528{
529 int *arg1 = (int *)args[0];
530 int *arg2 = (int *)args[1];
531 float *retval = args[2];
532 unsigned int i;
533
534 for (i = 0; i < instr->comp_count; ++i)
535 {
536 unsigned int v = arg1[instr->scalar ? 0 : i] != arg2[i] ? ~0u : 0;
537 retval[i] = *(float *)&v;
538 }
539}
540
541static void pres_buge(float **args, unsigned int n, const struct preshader_instr *instr)
542{
543 unsigned int *arg1 = (unsigned int *)args[0];
544 unsigned int *arg2 = (unsigned int *)args[1];
545 float *retval = args[2];
546 unsigned int i;
547
548 for (i = 0; i < instr->comp_count; ++i)
549 {
550 unsigned int v = arg1[instr->scalar ? 0 : i] >= arg2[i] ? ~0u : 0;
551 retval[i] = *(float *)&v;
552 }
553}
554
555static void pres_bult(float **args, unsigned int n, const struct preshader_instr *instr)
556{
557 unsigned int *arg1 = (unsigned int *)args[0];
558 unsigned int *arg2 = (unsigned int *)args[1];
559 float *retval = args[2];
560 unsigned int i;
561
562 for (i = 0; i < instr->comp_count; ++i)
563 {
564 unsigned int v = arg1[instr->scalar ? 0 : i] < arg2[i] ? ~0u : 0;
565 retval[i] = *(float *)&v;
566 }
567}
568
569static void pres_udiv(float **args, unsigned int n, const struct preshader_instr *instr)
570{
571 unsigned int *arg1 = (unsigned int *)args[0];
572 unsigned int *arg2 = (unsigned int *)args[1];
573 float *retval = args[2];
574 unsigned int i;
575
576 for (i = 0; i < instr->comp_count; ++i)
577 {
578 unsigned int v = arg2[i] ? arg1[instr->scalar ? 0 : i] / arg2[i] : UINT_MAX;
579 retval[i] = *(float *)&v;
580 }
581}
582
583static void pres_imin(float **args, unsigned int n, const struct preshader_instr *instr)
584{
585 int *arg1 = (int *)args[0], *arg2 = (int *)args[1];
586 float *retval = args[2];
587 unsigned int i;
588
589 for (i = 0; i < instr->comp_count; ++i)
590 {
591 int v = min(arg1[instr->scalar ? 0 : i], arg2[i]);
592 retval[i] = *(float *)&v;
593 }
594}
595
596static void pres_imax(float **args, unsigned int n, const struct preshader_instr *instr)
597{
598 int *arg1 = (int *)args[0], *arg2 = (int *)args[1];
599 float *retval = args[2];
600 unsigned int i;
601
602 for (i = 0; i < instr->comp_count; ++i)
603 {
604 int v = max(arg1[instr->scalar ? 0 : i], arg2[i]);
605 retval[i] = *(float *)&v;
606 }
607}
608
609static void pres_umin(float **args, unsigned int n, const struct preshader_instr *instr)
610{
611 unsigned int *arg1 = (unsigned int *)args[0], *arg2 = (unsigned int *)args[1];
612 float *retval = args[2];
613 unsigned int i;
614
615 for (i = 0; i < instr->comp_count; ++i)
616 {
617 unsigned int v = min(arg1[instr->scalar ? 0 : i], arg2[i]);
618 retval[i] = *(float *)&v;
619 }
620}
621
622static void pres_umax(float **args, unsigned int n, const struct preshader_instr *instr)
623{
624 unsigned int *arg1 = (unsigned int *)args[0], *arg2 = (unsigned int *)args[1];
625 float *retval = args[2];
626 unsigned int i;
627
628 for (i = 0; i < instr->comp_count; ++i)
629 {
630 unsigned int v = max(arg1[instr->scalar ? 0 : i], arg2[i]);
631 retval[i] = *(float *)&v;
632 }
633}
634
635static void pres_and(float **args, unsigned int n, const struct preshader_instr *instr)
636{
637 unsigned int *arg1 = (unsigned int *)args[0];
638 unsigned int *arg2 = (unsigned int *)args[1];
639 float *retval = args[2];
640 unsigned int i;
641
642 for (i = 0; i < instr->comp_count; ++i)
643 {
644 unsigned int v = arg1[instr->scalar ? 0 : i] & arg2[i];
645 retval[i] = *(float *)&v;
646 }
647}
648
649static void pres_or(float **args, unsigned int n, const struct preshader_instr *instr)
650{
651 unsigned int *arg1 = (unsigned int *)args[0];
652 unsigned int *arg2 = (unsigned int *)args[1];
653 float *retval = args[2];
654 unsigned int i;
655
656 for (i = 0; i < instr->comp_count; ++i)
657 {
658 unsigned int v = arg1[0] | arg2[0];
659 retval[i] = *(float *)&v;
660 }
661}
662
663static void pres_xor(float **args, unsigned int n, const struct preshader_instr *instr)
664{
665 unsigned int *arg1 = (unsigned int *)args[0];
666 unsigned int *arg2 = (unsigned int *)args[1];
667 float *retval = args[2];
668 unsigned int i;
669
670 for (i = 0; i < instr->comp_count; ++i)
671 {
672 unsigned int v = arg1[instr->scalar ? 0 : i] ^ arg2[i];
673 retval[i] = *(float *)&v;
674 }
675}
676
677static void pres_ishl(float **args, unsigned int n, const struct preshader_instr *instr)
678{
679 int *arg1 = (int *)args[0], *arg2 = (int *)args[1];
680 float *retval = args[2];
681 unsigned int i;
682
683 for (i = 0; i < instr->comp_count; ++i)
684 {
685 unsigned int v = arg1[instr->scalar ? 0 : i] << (arg2[i] % 32);
686 retval[i] = *(float *)&v;
687 }
688}
689
690static void pres_ishr(float **args, unsigned int n, const struct preshader_instr *instr)
691{
692 int *arg1 = (int *)args[0], *arg2 = (int *)args[1];
693 float *retval = args[2];
694 unsigned int i;
695
696 for (i = 0; i < instr->comp_count; ++i)
697 {
698 unsigned int v = arg1[instr->scalar ? 0 : i] >> (arg2[i] % 32);
699 retval[i] = *(float *)&v;
700 }
701}
702
703static void pres_ushr(float **args, unsigned int n, const struct preshader_instr *instr)
704{
705 unsigned int *arg1 = (unsigned int *)args[0];
706 unsigned int *arg2 = (unsigned int *)args[1];
707 float *retval = args[2];
708 unsigned int i;
709
710 for (i = 0; i < instr->comp_count; ++i)
711 {
712 unsigned int v = arg1[instr->scalar ? 0 : i] >> (arg2[i] % 32);
713 retval[i] = *(float *)&v;
714 }
715}
716
717static void pres_movc(float **args, unsigned int n, const struct preshader_instr *instr)
718{
719 float *arg1 = args[0], *arg2 = args[1], *arg3 = args[2];
720 float *retval = args[3];
721 unsigned int i;
722
723 for (i = 0; i < instr->comp_count; ++i)
724 retval[i] = arg1[i] ? arg2[i] : arg3[i];
725}
726
727static void pres_dot(float **args, unsigned int n, const struct preshader_instr *instr)
728{
729 float *retval = args[2];
730 unsigned int i;
731
732 *retval = 0.0f;
733 for (i = 0; i < instr->comp_count; ++i)
734 *retval += args[0][instr->scalar ? 0 : i] * args[1][i];
735}
736
737static void pres_dotswiz(float **args, unsigned int n, const struct preshader_instr *instr)
738{
739 float *retval = args[--n];
740 unsigned int i;
741
742 *retval = 0.0f;
743
744 if (n != 6 && n != 8 && instr->comp_count == 1)
745 {
746 WARN("Unexpected argument count %u, or component count %u.\n", n, instr->comp_count);
747 return;
748 }
749
750 for (i = 0; i < n / 2; ++i)
751 *retval += args[i][0] * args[i + n / 2][0];
752}
753
755{
757 char name[16];
759};
760
761static const struct preshader_op_info preshader_ops[] =
762{
763 { 0x100, "mov", pres_mov },
764 { 0x101, "neg", pres_neg },
765 { 0x103, "rcp", pres_rcp },
766 { 0x104, "frc", pres_frc },
767 { 0x105, "exp", pres_exp },
768 { 0x106, "log", pres_log },
769 { 0x107, "rsq", pres_rsq },
770 { 0x108, "sin", pres_sin },
771 { 0x109, "cos", pres_cos },
772 { 0x10a, "asin", pres_asin },
773 { 0x10b, "acos", pres_acos },
774 { 0x10c, "atan", pres_atan },
775 { 0x112, "sqrt", pres_sqrt },
776 { 0x120, "ineg", pres_ineg },
777 { 0x121, "not", pres_not },
778 { 0x130, "itof", pres_itof },
779 { 0x131, "utof", pres_utof },
780 { 0x133, "ftou", pres_ftou },
781 { 0x137, "ftob", pres_ftob },
782 { 0x139, "floor",pres_floor},
783 { 0x13a, "ceil", pres_ceil },
784 { 0x200, "min", pres_min },
785 { 0x201, "max", pres_max },
786 { 0x204, "add", pres_add },
787 { 0x205, "mul", pres_mul },
788 { 0x206, "atan2",pres_atan2},
789 { 0x208, "div", pres_div },
790 { 0x210, "bilt", pres_bilt },
791 { 0x211, "bige", pres_bige },
792 { 0x212, "bieq", pres_bieq },
793 { 0x213, "bine", pres_bine },
794 { 0x214, "buge", pres_buge },
795 { 0x215, "bult", pres_bult },
796 { 0x216, "iadd", pres_iadd },
797 { 0x219, "imul", pres_imul },
798 { 0x21a, "udiv", pres_udiv },
799 { 0x21d, "imin", pres_imin },
800 { 0x21e, "imax", pres_imax },
801 { 0x21f, "umin", pres_umin },
802 { 0x220, "umax", pres_umax },
803 { 0x230, "and", pres_and },
804 { 0x231, "or", pres_or },
805 { 0x233, "xor", pres_xor },
806 { 0x234, "ishl", pres_ishl },
807 { 0x235, "ishr", pres_ishr },
808 { 0x236, "ushr", pres_ushr },
809 { 0x301, "movc", pres_movc },
810 { 0x500, "dot", pres_dot },
811 { 0x70e, "d3ds_dotswiz", pres_dotswiz },
812};
813
814static int __cdecl preshader_op_compare(const void *a, const void *b)
815{
816 int opcode = *(int *)a;
817 const struct preshader_op_info *op_info = b;
818 return opcode - op_info->opcode;
819}
820
822{
825}
826
828{
830 unsigned int offset;
831 unsigned int length;
832};
833
835{
836 union
837 {
838 float *f;
840 };
841 unsigned int count;
842};
843
845{
851};
852
854{
857
859 unsigned int vars_count;
860};
861
863{
867};
868
870{
871 unsigned int id;
872 unsigned int idx;
873 unsigned int operation;
874 union
875 {
876 struct
877 {
879 unsigned int offset;
881 struct
882 {
883 struct d3d10_effect_variable *v;
886 struct
887 {
890 };
891};
892
894{
895 if (!(table->f = calloc(count, sizeof(*table->f))))
896 return E_OUTOFMEMORY;
897 table->count = count;
898 return S_OK;
899}
900
902{
903 unsigned int i;
904
905 for (i = 0; i < ARRAY_SIZE(p->reg_tables); ++i)
906 free(p->reg_tables[i].f);
907 if (p->code)
908 ID3D10Blob_Release(p->code);
909 free(p->vars);
910 memset(p, 0, sizeof(*p));
911}
912
914 enum d3d10_reg_table_type regt, unsigned int offset)
915{
916 switch (regt)
917 {
922 return p->reg_tables[regt].f + offset;
923 default:
924 return NULL;
925 }
926}
927
929{
930 unsigned int i, j, regt, offset, instr_count, arg_count;
931 const DWORD *ip = ID3D10Blob_GetBufferPointer(p->code);
932 struct preshader_instr ins;
933 float *dst, *args[9];
934
936 memset(dst, 0, sizeof(float) * p->reg_tables[D3D10_REG_TABLE_RESULT].count);
937
938 /* Update constant buffer */
940 for (i = 0; i < p->vars_count; ++i)
941 {
942 struct d3d10_ctab_var *v = &p->vars[i];
943 memcpy(dst + v->offset, v->v->buffer->u.buffer.local_buffer + v->v->buffer_offset,
944 v->length * sizeof(*dst));
945 }
946
947 instr_count = *ip++;
948
949 for (i = 0; i < instr_count; ++i)
950 {
951 *(DWORD *)&ins = *ip++;
952 arg_count = 1 + *ip++;
953
954 if (arg_count > ARRAY_SIZE(args))
955 {
956 FIXME("Unexpected argument count %u.\n", arg_count);
957 return E_FAIL;
958 }
959
960 /* Arguments are followed by the return value. */
961 for (j = 0; j < arg_count; ++j)
962 {
963 ip++; /* TODO: argument register flags are currently ignored */
964 regt = *ip++;
965 offset = *ip++;
966
968 }
969
970 d3d10_effect_get_op_info(ins.opcode)->func(args, arg_count, &ins);
971 }
972
973 return S_OK;
974}
975
977{
978 unsigned int i;
979
980 for (i = 0; i < d->count; ++i)
981 {
982 struct d3d10_effect_prop_dependency *dep = &d->entries[i];
983 switch (dep->operation)
984 {
987 break;
990 break;
991 }
992 }
993 free(d->entries);
994 memset(d, 0, sizeof(*d));
995}
996
998{
999 const char *name;
1006};
1007
1009{
1010 { "Pass.RasterizerState", D3D10_SVT_RASTERIZER, 1, 1, D3D10_C_PASS, FIELD_OFFSET(struct d3d10_effect_pass, rasterizer) },
1011 { "Pass.DepthStencilState", D3D10_SVT_DEPTHSTENCIL, 1, 1, D3D10_C_PASS, FIELD_OFFSET(struct d3d10_effect_pass, depth_stencil) },
1012 { "Pass.BlendState", D3D10_SVT_BLEND, 1, 1, D3D10_C_PASS, FIELD_OFFSET(struct d3d10_effect_pass, blend) },
1013 { "Pass.RenderTargets", D3D10_SVT_RENDERTARGETVIEW, 1, 8, D3D10_C_PASS, ~0u },
1014 { "Pass.DepthStencilView", D3D10_SVT_DEPTHSTENCILVIEW, 1, 1, D3D10_C_PASS, ~0u },
1015 { "Pass.Unknown5", D3D10_SVT_VOID, 0, 0, D3D10_C_PASS, ~0u },
1016 { "Pass.VertexShader", D3D10_SVT_VERTEXSHADER, 1, 1, D3D10_C_PASS, FIELD_OFFSET(struct d3d10_effect_pass, vs.shader),
1017 FIELD_OFFSET(struct d3d10_effect_pass, vs.index) },
1018 { "Pass.PixelShader", D3D10_SVT_PIXELSHADER, 1, 1, D3D10_C_PASS, FIELD_OFFSET(struct d3d10_effect_pass, ps.shader),
1019 FIELD_OFFSET(struct d3d10_effect_pass, ps.index) },
1020 { "Pass.GeometryShader", D3D10_SVT_GEOMETRYSHADER, 1, 1, D3D10_C_PASS, FIELD_OFFSET(struct d3d10_effect_pass, gs.shader),
1021 FIELD_OFFSET(struct d3d10_effect_pass, gs.index) },
1022 { "Pass.StencilRef", D3D10_SVT_UINT, 1, 1, D3D10_C_PASS, FIELD_OFFSET(struct d3d10_effect_pass, stencil_ref) },
1023 { "Pass.BlendFactor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_PASS, FIELD_OFFSET(struct d3d10_effect_pass, blend_factor) },
1024 { "Pass.SampleMask", D3D10_SVT_UINT, 1, 1, D3D10_C_PASS, FIELD_OFFSET(struct d3d10_effect_pass, sample_mask) },
1025
1026 { "RasterizerState.FillMode", D3D10_SVT_INT, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, FillMode) },
1027 { "RasterizerState.CullMode", D3D10_SVT_INT, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, CullMode) },
1028 { "RasterizerState.FrontCounterClockwise", D3D10_SVT_BOOL, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, FrontCounterClockwise) },
1029 { "RasterizerState.DepthBias", D3D10_SVT_INT, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthBias) },
1030 { "RasterizerState.DepthBiasClamp", D3D10_SVT_FLOAT, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthBiasClamp) },
1031 { "RasterizerState.SlopeScaledDepthBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, SlopeScaledDepthBias) },
1032 { "RasterizerState.DepthClipEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthClipEnable) },
1033 { "RasterizerState.ScissorEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, ScissorEnable) },
1034 { "RasterizerState.MultisampleEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, MultisampleEnable) },
1035 { "RasterizerState.AntialiasedLineEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, AntialiasedLineEnable) },
1036
1037 { "DepthStencilState.DepthEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthEnable) },
1038 { "DepthStencilState.DepthWriteMask", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthWriteMask) },
1039 { "DepthStencilState.DepthFunc", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthFunc) },
1040 { "DepthStencilState.StencilEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilEnable) },
1041 { "DepthStencilState.StencilReadMask", D3D10_SVT_UINT8, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilReadMask) },
1042 { "DepthStencilState.StencilWriteMask", D3D10_SVT_UINT8, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilWriteMask) },
1043 { "DepthStencilState.FrontFaceStencilFail", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilFailOp) },
1044 { "DepthStencilState.FrontFaceStencilDepthFail", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilDepthFailOp)},
1045 { "DepthStencilState.FrontFaceStencilPass", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilPassOp) },
1046 { "DepthStencilState.FrontFaceStencilFunc", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilFunc) },
1047 { "DepthStencilState.BackFaceStencilFail", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilFailOp) },
1048 { "DepthStencilState.BackFaceStencilDepthFail", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilDepthFailOp) },
1049 { "DepthStencilState.BackFaceStencilPass", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilPassOp) },
1050 { "DepthStencilState.BackFaceStencilFunc", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilFunc) },
1051
1052 { "BlendState.AlphaToCoverageEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, AlphaToCoverageEnable) },
1053 { "BlendState.BlendEnable", D3D10_SVT_BOOL, 1, 8, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendEnable) },
1054 { "BlendState.SrcBlend", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, SrcBlend) },
1055 { "BlendState.DestBlend", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, DestBlend) },
1056 { "BlendState.BlendOp", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendOp) },
1057 { "BlendState.SrcBlendAlpha", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, SrcBlendAlpha) },
1058 { "BlendState.DestBlendAlpha", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, DestBlendAlpha) },
1059 { "BlendState.BlendOpAlpha", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendOpAlpha) },
1060 { "BlendState.RenderTargetWriteMask", D3D10_SVT_UINT8, 1, 8, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, RenderTargetWriteMask) },
1061
1062 { "SamplerState.Filter", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.Filter) },
1063 { "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressU) },
1064 { "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressV) },
1065 { "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressW) },
1066 { "SamplerState.MipLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MipLODBias) },
1067 { "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxAnisotropy) },
1068 { "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.ComparisonFunc) },
1069 { "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.BorderColor) },
1070 { "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MinLOD) },
1071 { "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxLOD) },
1072 { "SamplerState.Texture", D3D10_SVT_TEXTURE, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, texture) },
1073};
1074
1076{
1079 FALSE,
1080 0,
1081 0.0f,
1082 0.0f,
1083 TRUE,
1084 FALSE,
1085 FALSE,
1086 FALSE,
1087};
1088
1090{
1091 TRUE,
1094 FALSE,
1099};
1100
1102{
1103 FALSE,
1111 {0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf},
1112};
1113
1115{
1120 0.0f,
1121 16,
1123 {0.0f, 0.0f, 0.0f, 0.0f},
1124 0.0f,
1125 FLT_MAX,
1126};
1127
1129{
1132 const void *default_state;
1133};
1134
1136{
1141};
1142
1143#define WINE_D3D10_TO_STR(x) case x: return #x
1144
1146{
1147 switch (c)
1148 {
1155 default:
1156 FIXME("Unrecognised D3D10_SHADER_VARIABLE_CLASS %#x.\n", c);
1157 return "unrecognised";
1158 }
1159}
1160
1162{
1163 switch (t)
1164 {
1194 default:
1195 FIXME("Unrecognised D3D10_SHADER_VARIABLE_TYPE %#x.\n", t);
1196 return "unrecognised";
1197 }
1198}
1199
1200#undef WINE_D3D10_TO_STR
1201
1203 void *data, unsigned int offset, unsigned int count)
1204{
1205 BOOL is_buffer;
1206
1207 is_buffer = v->type->basetype == D3D10_SVT_CBUFFER || v->type->basetype == D3D10_SVT_TBUFFER;
1208
1209 if (v->type->type_class == D3D10_SVC_OBJECT && !is_buffer)
1210 {
1211 WARN("Not supported on object variables of type %s.\n",
1212 debug_d3d10_shader_variable_type(v->type->basetype));
1213 return D3DERR_INVALIDCALL;
1214 }
1215
1216 if (!is_buffer)
1217 {
1218 offset += v->buffer_offset;
1219 v = v->buffer;
1220 }
1221
1222 memcpy(data, v->u.buffer.local_buffer + offset, count);
1223
1224 return S_OK;
1225}
1226
1228 float *out_data, unsigned int out_idx)
1229{
1230 switch (in_type)
1231 {
1232 case D3D10_SVT_FLOAT:
1233 out_data[out_idx] = *(float *)&value;
1234 return TRUE;
1235
1236 case D3D10_SVT_INT:
1237 out_data[out_idx] = (INT)value;
1238 return TRUE;
1239
1240 case D3D10_SVT_UINT:
1241 out_data[out_idx] = value;
1242 return TRUE;
1243
1244 default:
1245 FIXME("Unhandled in_type %#x.\n", in_type);
1246 return FALSE;
1247 }
1248}
1249
1251 int *out_data, unsigned int out_idx)
1252{
1253 switch (in_type)
1254 {
1255 case D3D10_SVT_FLOAT:
1256 out_data[out_idx] = *(float *)&value;
1257 return TRUE;
1258
1259 case D3D10_SVT_INT:
1260 case D3D10_SVT_UINT:
1261 case D3D10_SVT_BOOL:
1262 out_data[out_idx] = value;
1263 return TRUE;
1264
1265 default:
1266 FIXME("Unhandled in_type %#x.\n", in_type);
1267 return FALSE;
1268 }
1269}
1270
1272 INT8 *out_data, unsigned int out_idx)
1273{
1274 switch (in_type)
1275 {
1276 case D3D10_SVT_INT:
1277 case D3D10_SVT_UINT:
1278 out_data[out_idx] = value;
1279 return TRUE;
1280
1281 default:
1282 FIXME("Unhandled in_type %#x.\n", in_type);
1283 return FALSE;
1284 }
1285}
1286
1288 D3D_SHADER_VARIABLE_TYPE out_type, void *out_data, unsigned int out_idx)
1289{
1290 switch (out_type)
1291 {
1292 case D3D10_SVT_FLOAT:
1293 return read_float_value(value, in_type, out_data, out_idx);
1294 case D3D10_SVT_INT:
1295 case D3D10_SVT_UINT:
1296 case D3D10_SVT_BOOL:
1297 return read_int32_value(value, in_type, out_data, out_idx);
1298 case D3D10_SVT_UINT8:
1299 return read_int8_value(value, in_type, out_data, out_idx);
1300 default:
1301 FIXME("Unsupported property type %u.\n", out_type);
1302 return FALSE;
1303 }
1304}
1305
1307 void *container)
1308{
1311 unsigned int i, j, count, variable_idx;
1312 struct d3d10_effect_variable *v;
1313 struct d3d10_reg_table *table;
1314 unsigned int *dst_index;
1316 HRESULT hr;
1317 void *dst;
1318
1319 for (i = 0; i < deps->count; ++i)
1320 {
1321 d = &deps->entries[i];
1322
1324
1325 dst = (char *)container + property_info->offset;
1326 dst_index = (unsigned int *)((char *)container + property_info->index_offset);
1327
1328 switch (d->operation)
1329 {
1330 case D3D10_EOO_VAR:
1332
1333 v = d->var.v;
1334
1335 count = v->type->type_class == D3D10_SVC_VECTOR ? 4 : 1;
1336
1337 for (j = 0; j < count; ++j)
1338 {
1339 d3d10_effect_variable_get_raw_value(v, &value, d->var.offset + j * sizeof(value), sizeof(value));
1340 d3d10_effect_read_numeric_value(value, v->type->basetype, property_info->type, dst, j);
1341 }
1342
1343 break;
1344
1346
1347 v = d->index_expr.v;
1348
1349 if (FAILED(hr = d3d10_effect_preshader_eval(&d->index_expr.index)))
1350 {
1351 WARN("Failed to evaluate index expression, hr %#lx.\n", hr);
1352 return;
1353 }
1354
1355 variable_idx = *d->index_expr.index.reg_tables[D3D10_REG_TABLE_RESULT].dword;
1356
1357 if (variable_idx >= v->type->element_count)
1358 {
1359 WARN("Expression evaluated to invalid index value %u, array %s of size %u.\n",
1360 variable_idx, debugstr_a(v->name), v->type->element_count);
1361 variable_idx = 0;
1362 }
1363
1364 /* Ignoring destination index here, there are no object typed array properties. */
1365 switch (property_info->type)
1366 {
1370 *(void **)dst = v;
1371 *dst_index = variable_idx;
1372 break;
1373 default:
1374 *(void **)dst = &v->elements[variable_idx];
1375 }
1376 break;
1377
1379
1380 if ((property_info->type != D3D10_SVT_UINT)
1381 && (property_info->type != D3D10_SVT_FLOAT)
1382 && (property_info->type != D3D10_SVT_BOOL))
1383 {
1384 FIXME("Unimplemented for property %s.\n", property_info->name);
1385 return;
1386 }
1387
1388 if (FAILED(hr = d3d10_effect_preshader_eval(&d->value_expr.value)))
1389 {
1390 WARN("Failed to evaluate value expression, hr %#lx.\n", hr);
1391 return;
1392 }
1393
1394 table = &d->value_expr.value.reg_tables[D3D10_REG_TABLE_RESULT];
1395
1396 if (property_info->size != table->count)
1397 {
1398 WARN("Unexpected value expression output size %u, property size %u.\n",
1399 table->count, property_info->size);
1400 return;
1401 }
1402
1403 memcpy(dst, table->f, property_info->size * sizeof(float));
1404
1405 break;
1406
1407 default:
1408 FIXME("Unsupported property update for %u.\n", d->operation);
1409 }
1410 }
1411}
1412
1413static BOOL d3d_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
1414{
1415 SIZE_T max_capacity, new_capacity;
1416 void *new_elements;
1417
1418 if (count <= *capacity)
1419 return TRUE;
1420
1421 max_capacity = ~(SIZE_T)0 / size;
1422 if (count > max_capacity)
1423 return FALSE;
1424
1425 new_capacity = max(1, *capacity);
1426 while (new_capacity < count && new_capacity <= max_capacity / 2)
1427 new_capacity *= 2;
1428 if (new_capacity < count)
1429 new_capacity = count;
1430
1431 if (!(new_elements = realloc(*elements, new_capacity * size)))
1432 return FALSE;
1433
1434 *elements = new_elements;
1435 *capacity = new_capacity;
1436 return TRUE;
1437}
1438
1439static BOOL require_space(size_t offset, size_t count, size_t size, size_t data_size)
1440{
1441 return !count || (data_size - offset) / count >= size;
1442}
1443
1444static BOOL fx10_get_string(const char *data, size_t data_size, uint32_t offset, const char **s, size_t *l)
1445{
1446 size_t len, max_len;
1447
1448 if (offset >= data_size)
1449 {
1450 WARN("Invalid offset %#x (data size %#Ix).\n", offset, data_size);
1451 return FALSE;
1452 }
1453
1454 max_len = data_size - offset;
1455 if (!(len = strnlen(data + offset, max_len)))
1456 {
1457 *s = NULL;
1458 *l = 0;
1459 return TRUE;
1460 }
1461
1462 if (len == max_len)
1463 return FALSE;
1464
1465 *s = data + offset;
1466 *l = ++len;
1467
1468 return TRUE;
1469}
1470
1471static BOOL fx10_copy_string(const char *data, size_t data_size, DWORD offset, char **s)
1472{
1473 const char *p;
1474 size_t len;
1475
1476 if (!fx10_get_string(data, data_size, offset, &p, &len))
1477 return FALSE;
1478
1479 if (!p)
1480 {
1481 *s = NULL;
1482 return TRUE;
1483 }
1484
1485 if (!(*s = malloc(len)))
1486 {
1487 ERR("Failed to allocate string memory.\n");
1488 return FALSE;
1489 }
1490
1491 memcpy(*s, p, len);
1492
1493 return TRUE;
1494}
1495
1496static BOOL copy_name(const char *ptr, char **name)
1497{
1498 if (!ptr || !*ptr) return TRUE;
1499
1500 if (!(*name = strdup(ptr)))
1501 {
1502 ERR("Failed to allocate name memory.\n");
1503 return FALSE;
1504 }
1505
1506 return TRUE;
1507}
1508
1510 const char *name)
1511{
1512 unsigned int i;
1513
1514 for (i = 0; i < effect->local_buffer_count; ++i)
1515 {
1516 struct d3d10_effect_variable *l = &effect->local_buffers[i];
1517 if (l->name && !strcmp(l->name, name))
1518 return l;
1519 }
1520
1521 return effect->pool ? d3d10_effect_get_buffer_by_name(effect->pool, name) : NULL;
1522}
1523
1525 const struct d3d10_effect *effect, const char *name)
1526{
1527 struct d3d10_effect_variable *v;
1528 unsigned int i, j;
1529
1530 for (i = 0; i < effect->local_buffer_count; ++i)
1531 {
1532 for (j = 0; j < effect->local_buffers[i].type->member_count; ++j)
1533 {
1534 v = &effect->local_buffers[i].members[j];
1535 if (v->name && !strcmp(v->name, name))
1536 return v;
1537 }
1538 }
1539
1540 for (i = 0; i < effect->object_count; ++i)
1541 {
1542 struct d3d10_effect_variable *v = &effect->object_variables[i];
1543 if (v->name && !strcmp(v->name, name))
1544 return v;
1545 }
1546
1547 return effect->pool ? d3d10_effect_get_variable_by_name(effect->pool, name) : NULL;
1548}
1549
1551{
1552 struct d3d10_effect_shader_variable *sv = &v->u.shader;
1556 unsigned int i;
1557
1558 sv->reflection->lpVtbl->GetDesc(sv->reflection, &desc);
1559 sv->resource_count = desc.BoundResources;
1560
1561 if (!(sv->resources = calloc(sv->resource_count, sizeof(*sv->resources))))
1562 {
1563 ERR("Failed to allocate shader resource binding information memory.\n");
1564 return E_OUTOFMEMORY;
1565 }
1566
1567 for (i = 0; i < desc.BoundResources; ++i)
1568 {
1569 sv->reflection->lpVtbl->GetResourceBindingDesc(sv->reflection, i, &bind_desc);
1570 sr = &sv->resources[i];
1571
1572 sr->in_type = bind_desc.Type;
1573 sr->bind_point = bind_desc.BindPoint;
1574 sr->bind_count = bind_desc.BindCount;
1575
1576 switch (bind_desc.Type)
1577 {
1578 case D3D10_SIT_CBUFFER:
1579 case D3D10_SIT_TBUFFER:
1580 if (sr->bind_count != 1)
1581 {
1582 WARN("Unexpected bind count %u for a buffer %s.\n", bind_desc.BindCount,
1583 debugstr_a(bind_desc.Name));
1584 return E_UNEXPECTED;
1585 }
1586 sr->variable = d3d10_effect_get_buffer_by_name(v->effect, bind_desc.Name);
1587 break;
1588
1589 case D3D10_SIT_SAMPLER:
1590 case D3D10_SIT_TEXTURE:
1591 sr->variable = d3d10_effect_get_variable_by_name(v->effect, bind_desc.Name);
1592 break;
1593
1594 default:
1595 break;
1596 }
1597
1598 if (!sr->variable)
1599 {
1600 WARN("Failed to find shader resource.\n");
1601 return E_FAIL;
1602 }
1603 }
1604
1605 return S_OK;
1606}
1607
1609{
1613 unsigned int stride;
1614 char *decl;
1615};
1616
1618{
1619 free(so_decl->entries);
1620 free(so_decl->decl);
1621 memset(so_decl, 0, sizeof(*so_decl));
1622}
1623
1625 struct d3d10_effect_so_decl *so_decl)
1626{
1627 static const char * xyzw = "xyzw";
1628 static const char * rgba = "rgba";
1629 char *p, *ptr, *end, *next, *mask, *m, *slot;
1631 unsigned int len;
1632
1633 memset(so_decl, 0, sizeof(*so_decl));
1634
1635 if (!(so_decl->decl = strdup(decl)))
1636 return E_OUTOFMEMORY;
1637
1638 p = so_decl->decl;
1639
1640 while (p && *p)
1641 {
1642 memset(&e, 0, sizeof(e));
1643
1644 end = strchr(p, ';');
1645 next = end ? end + 1 : p + strlen(p);
1646
1647 len = next - p;
1648 if (end) len--;
1649
1650 /* Remove leading and trailing spaces. */
1651 while (len && isspace(*p)) { len--; p++; }
1652 while (len && isspace(p[len - 1])) len--;
1653
1654 p[len] = 0;
1655
1656 /* Output slot */
1657 if ((slot = strchr(p, ':')))
1658 {
1659 *slot = 0;
1660
1661 ptr = p;
1662 while (*ptr)
1663 {
1664 if (!isdigit(*ptr))
1665 {
1666 WARN("Invalid output slot %s.\n", debugstr_a(p));
1667 goto failed;
1668 }
1669 ptr++;
1670 }
1671
1672 e.OutputSlot = atoi(p);
1673 p = slot + 1;
1674 }
1675
1676 /* Mask */
1677 if ((mask = strchr(p, '.')))
1678 {
1679 *mask = 0; mask++;
1680
1681 if ((m = strstr(xyzw, mask)))
1682 e.StartComponent = m - xyzw;
1683 else if ((m = strstr(rgba, mask)))
1684 e.StartComponent = m - rgba;
1685 else
1686 {
1687 WARN("Invalid component mask %s.\n", debugstr_a(mask));
1688 goto failed;
1689 }
1690
1691 e.ComponentCount = strlen(mask);
1692 }
1693 else
1694 {
1695 e.StartComponent = 0;
1696 e.ComponentCount = 4;
1697 }
1698
1699 /* Semantic index and name */
1700 len = strlen(p);
1701 while (isdigit(p[len - 1]))
1702 len--;
1703
1704 if (p[len])
1705 {
1706 e.SemanticIndex = atoi(&p[len]);
1707 p[len] = 0;
1708 }
1709
1710 e.SemanticName = stricmp(p, "$SKIP") ? p : NULL;
1711
1712 if (!d3d_array_reserve((void **)&so_decl->entries, &so_decl->capacity, so_decl->count + 1,
1713 sizeof(*so_decl->entries)))
1714 goto failed;
1715
1716 so_decl->entries[so_decl->count++] = e;
1717
1718 if (e.OutputSlot == 0)
1719 so_decl->stride += e.ComponentCount * sizeof(float);
1720
1721 p = next;
1722 }
1723
1724 return S_OK;
1725
1726failed:
1728
1729 return E_FAIL;
1730}
1731
1732static HRESULT parse_fx10_shader(const char *data, size_t data_size, uint32_t offset, struct d3d10_effect_variable *v)
1733{
1734 ID3D10Device *device = v->effect->device;
1735 uint32_t dxbc_size;
1736 const char *ptr;
1737 HRESULT hr;
1738
1739 if (v->effect->shaders.current >= v->effect->shaders.count)
1740 {
1741 WARN("Invalid effect? Used shader current(%u) >= used shader count(%u)\n",
1742 v->effect->shaders.current, v->effect->shaders.count);
1743 return E_FAIL;
1744 }
1745
1746 v->effect->shaders.v[v->effect->shaders.current++] = v;
1747
1748 if (offset >= data_size || !require_space(offset, 1, sizeof(dxbc_size), data_size))
1749 {
1750 WARN("Invalid offset %#x (data size %#Ix).\n", offset, data_size);
1751 return E_FAIL;
1752 }
1753
1754 ptr = data + offset;
1755 dxbc_size = read_u32(&ptr);
1756 TRACE("DXBC size: %#x.\n", dxbc_size);
1757
1758 if (!require_space(ptr - data, 1, dxbc_size, data_size))
1759 {
1760 WARN("Invalid dxbc size %#x (data size %#Ix, offset %#x).\n", offset, data_size, offset);
1761 return E_FAIL;
1762 }
1763
1764 if (!dxbc_size)
1765 return S_OK;
1766
1767 if (FAILED(hr = D3D10ReflectShader(ptr, dxbc_size, &v->u.shader.reflection)))
1768 return hr;
1769
1770 D3DGetInputSignatureBlob(ptr, dxbc_size, &v->u.shader.input_signature);
1771
1772 if (FAILED(hr = D3DCreateBlob(dxbc_size, &v->u.shader.bytecode)))
1773 return hr;
1774
1775 memcpy(ID3D10Blob_GetBufferPointer(v->u.shader.bytecode), ptr, dxbc_size);
1776
1778 return hr;
1779
1780 switch (v->type->basetype)
1781 {
1783 hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &v->u.shader.shader.vs);
1784 break;
1785
1787 hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &v->u.shader.shader.ps);
1788 break;
1789
1791 if (v->u.shader.stream_output_declaration)
1792 {
1793 struct d3d10_effect_so_decl so_decl;
1794
1795 if (FAILED(hr = d3d10_effect_parse_stream_output_declaration(v->u.shader.stream_output_declaration, &so_decl)))
1796 {
1797 WARN("Failed to parse stream output declaration, hr %#lx.\n", hr);
1798 break;
1799 }
1800
1801 hr = ID3D10Device_CreateGeometryShaderWithStreamOutput(device, ptr, dxbc_size,
1802 so_decl.entries, so_decl.count, so_decl.stride, &v->u.shader.shader.gs);
1803
1805 }
1806 else
1807 hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &v->u.shader.shader.gs);
1808 break;
1809
1810 default:
1811 ERR("This should not happen!\n");
1812 return E_FAIL;
1813 }
1814
1815 return hr;
1816}
1817
1819{
1820 switch (c)
1821 {
1822 case 1: return D3D10_SVC_SCALAR;
1823 case 2: return D3D10_SVC_VECTOR;
1824 case 3: if (is_column_major) return D3D10_SVC_MATRIX_COLUMNS;
1825 else return D3D10_SVC_MATRIX_ROWS;
1826 default:
1827 FIXME("Unknown variable class %#x.\n", c);
1828 return 0;
1829 }
1830}
1831
1833 uint32_t *flags)
1834{
1835 *flags = 0;
1836
1837 if(is_object)
1838 {
1839 switch (t)
1840 {
1841 case 1: return D3D10_SVT_STRING;
1842 case 2: return D3D10_SVT_BLEND;
1843 case 3: return D3D10_SVT_DEPTHSTENCIL;
1844 case 4: return D3D10_SVT_RASTERIZER;
1845 case 5: return D3D10_SVT_PIXELSHADER;
1846 case 6: return D3D10_SVT_VERTEXSHADER;
1847 case 7: return D3D10_SVT_GEOMETRYSHADER;
1848 case 8:
1851
1852 case 9: return D3D10_SVT_TEXTURE;
1853 case 10: return D3D10_SVT_TEXTURE1D;
1854 case 11: return D3D10_SVT_TEXTURE1DARRAY;
1855 case 12: return D3D10_SVT_TEXTURE2D;
1856 case 13: return D3D10_SVT_TEXTURE2DARRAY;
1857 case 14: return D3D10_SVT_TEXTURE2DMS;
1858 case 15: return D3D10_SVT_TEXTURE2DMSARRAY;
1859 case 16: return D3D10_SVT_TEXTURE3D;
1860 case 17: return D3D10_SVT_TEXTURECUBE;
1861
1862 case 19: return D3D10_SVT_RENDERTARGETVIEW;
1863 case 20: return D3D10_SVT_DEPTHSTENCILVIEW;
1864 case 21: return D3D10_SVT_SAMPLER;
1865 case 22: return D3D10_SVT_BUFFER;
1866 default:
1867 FIXME("Unknown variable type %#x.\n", t);
1868 return D3D10_SVT_VOID;
1869 }
1870 }
1871 else
1872 {
1873 switch (t)
1874 {
1875 case 1: return D3D10_SVT_FLOAT;
1876 case 2: return D3D10_SVT_INT;
1877 case 3: return D3D10_SVT_UINT;
1878 case 4: return D3D10_SVT_BOOL;
1879 default:
1880 FIXME("Unknown variable type %#x.\n", t);
1881 return D3D10_SVT_VOID;
1882 }
1883 }
1884}
1885
1887{
1894};
1895
1896static HRESULT parse_fx10_type(const char *data, size_t data_size, uint32_t offset, struct d3d10_effect_type *t)
1897{
1898 uint32_t typeinfo, type_flags, type_kind;
1899 union
1900 {
1901 struct numeric_type type;
1902 uint32_t data;
1903 } numeric;
1904
1905 const char *ptr;
1906 unsigned int i;
1907
1908 if (offset >= data_size || !require_space(offset, 6, sizeof(DWORD), data_size))
1909 {
1910 WARN("Invalid offset %#x (data size %#Ix).\n", offset, data_size);
1911 return E_FAIL;
1912 }
1913
1914 ptr = data + offset;
1915 offset = read_u32(&ptr);
1916 TRACE("Type name at offset %#x.\n", offset);
1917
1918 if (!fx10_copy_string(data, data_size, offset, &t->name))
1919 {
1920 ERR("Failed to copy name.\n");
1921 return E_OUTOFMEMORY;
1922 }
1923 TRACE("Type name: %s.\n", debugstr_a(t->name));
1924
1926 TRACE("Kind: %u.\n", type_kind);
1927
1928 t->element_count = read_u32(&ptr);
1929 TRACE("Element count: %u.\n", t->element_count);
1930
1931 t->size_unpacked = read_u32(&ptr);
1932 TRACE("Unpacked size: %#x.\n", t->size_unpacked);
1933
1934 t->stride = read_u32(&ptr);
1935 TRACE("Stride: %#x.\n", t->stride);
1936
1937 t->size_packed = read_u32(&ptr);
1938 TRACE("Packed size %#x.\n", t->size_packed);
1939
1940 switch (type_kind)
1941 {
1942 case 1:
1943 TRACE("Type is numeric.\n");
1944
1945 if (!require_space(ptr - data, 1, sizeof(numeric), data_size))
1946 {
1947 WARN("Invalid offset %#x (data size %#Ix).\n", offset, data_size);
1948 return E_FAIL;
1949 }
1950
1951 numeric.data = read_u32(&ptr);
1952 t->member_count = 0;
1953 t->column_count = numeric.type.columns;
1954 t->row_count = numeric.type.rows;
1955 t->basetype = d3d10_variable_type(numeric.type.base_type, FALSE, &type_flags);
1956 t->type_class = d3d10_variable_class(numeric.type.type_class, numeric.type.column_major);
1957
1958 TRACE("Type description: %#x.\n", numeric.data);
1959 TRACE("\tcolumns: %u.\n", t->column_count);
1960 TRACE("\trows: %u.\n", t->row_count);
1961 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
1962 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
1963 TRACE("\tunknown bits: %#x.\n", numeric.type.unknown);
1964 break;
1965
1966 case 2:
1967 TRACE("Type is an object.\n");
1968
1969 if (!require_space(ptr - data, 1, sizeof(typeinfo), data_size))
1970 {
1971 WARN("Invalid offset %#x (data size %#Ix).\n", offset, data_size);
1972 return E_FAIL;
1973 }
1974
1975 typeinfo = read_u32(&ptr);
1976 t->member_count = 0;
1977 t->column_count = 0;
1978 t->row_count = 0;
1979 t->basetype = d3d10_variable_type(typeinfo, TRUE, &type_flags);
1980 t->type_class = D3D10_SVC_OBJECT;
1981 t->flags = type_flags;
1982
1983 TRACE("Type description: %#x.\n", typeinfo);
1984 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
1985 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
1986 TRACE("\tflags: %#x.\n", t->flags);
1987 break;
1988
1989 case 3:
1990 TRACE("Type is a structure.\n");
1991
1992 if (!require_space(ptr - data, 1, sizeof(t->member_count), data_size))
1993 {
1994 WARN("Invalid offset %#x (data size %#Ix).\n", offset, data_size);
1995 return E_FAIL;
1996 }
1997
1998 t->member_count = read_u32(&ptr);
1999 TRACE("Member count: %u.\n", t->member_count);
2000
2001 t->column_count = 0;
2002 t->row_count = 0;
2003 t->basetype = 0;
2004 t->type_class = D3D10_SVC_STRUCT;
2005
2006 if (!(t->members = calloc(t->member_count, sizeof(*t->members))))
2007 {
2008 ERR("Failed to allocate members memory.\n");
2009 return E_OUTOFMEMORY;
2010 }
2011
2012 if (!require_space(ptr - data, t->member_count, 4 * sizeof(DWORD), data_size))
2013 {
2014 WARN("Invalid member count %#x (data size %#Ix, offset %#x).\n",
2015 t->member_count, data_size, offset);
2016 return E_FAIL;
2017 }
2018
2019 for (i = 0; i < t->member_count; ++i)
2020 {
2021 struct d3d10_effect_type_member *typem = &t->members[i];
2022
2023 offset = read_u32(&ptr);
2024 TRACE("Member name at offset %#x.\n", offset);
2025
2026 if (!fx10_copy_string(data, data_size, offset, &typem->name))
2027 {
2028 ERR("Failed to copy name.\n");
2029 return E_OUTOFMEMORY;
2030 }
2031 TRACE("Member name: %s.\n", debugstr_a(typem->name));
2032
2033 offset = read_u32(&ptr);
2034 TRACE("Member semantic at offset %#x.\n", offset);
2035
2036 if (!fx10_copy_string(data, data_size, offset, &typem->semantic))
2037 {
2038 ERR("Failed to copy semantic.\n");
2039 return E_OUTOFMEMORY;
2040 }
2041 TRACE("Member semantic: %s.\n", debugstr_a(typem->semantic));
2042
2043 typem->buffer_offset = read_u32(&ptr);
2044 TRACE("Member offset in struct: %#x.\n", typem->buffer_offset);
2045
2046 offset = read_u32(&ptr);
2047 TRACE("Member type info at offset %#x.\n", offset);
2048
2049 if (!(typem->type = get_fx10_type(t->effect, data, data_size, offset)))
2050 {
2051 ERR("Failed to get variable type.\n");
2052 return E_FAIL;
2053 }
2054 }
2055 break;
2056
2057 default:
2058 FIXME("Unhandled type kind %#x.\n", type_kind);
2059 return E_FAIL;
2060 }
2061
2062 if (t->element_count)
2063 {
2064 TRACE("Elementtype for type at offset: %#lx\n", t->id);
2065
2066 /* allocate elementtype - we need only one, because all elements have the same type */
2067 if (!(t->elementtype = calloc(1, sizeof(*t->elementtype))))
2068 {
2069 ERR("Failed to allocate members memory.\n");
2070 return E_OUTOFMEMORY;
2071 }
2072
2073 /* create a copy of the original type with some minor changes */
2074 t->elementtype->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
2075 t->elementtype->effect = t->effect;
2076
2077 if (!copy_name(t->name, &t->elementtype->name))
2078 {
2079 ERR("Failed to copy name.\n");
2080 return E_OUTOFMEMORY;
2081 }
2082 TRACE("\tType name: %s.\n", debugstr_a(t->elementtype->name));
2083
2084 t->elementtype->element_count = 0;
2085 TRACE("\tElement count: %u.\n", t->elementtype->element_count);
2086
2087 /*
2088 * Not sure if this calculation is 100% correct, but a test
2089 * shows that these values work.
2090 */
2091 t->elementtype->size_unpacked = t->size_packed / t->element_count;
2092 TRACE("\tUnpacked size: %#x.\n", t->elementtype->size_unpacked);
2093
2094 t->elementtype->stride = t->stride;
2095 TRACE("\tStride: %#x.\n", t->elementtype->stride);
2096
2097 t->elementtype->size_packed = t->size_packed / t->element_count;
2098 TRACE("\tPacked size: %#x.\n", t->elementtype->size_packed);
2099
2100 t->elementtype->member_count = t->member_count;
2101 TRACE("\tMember count: %u.\n", t->elementtype->member_count);
2102
2103 t->elementtype->column_count = t->column_count;
2104 TRACE("\tColumns: %u.\n", t->elementtype->column_count);
2105
2106 t->elementtype->row_count = t->row_count;
2107 TRACE("\tRows: %u.\n", t->elementtype->row_count);
2108
2109 t->elementtype->basetype = t->basetype;
2110 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(t->elementtype->basetype));
2111
2112 t->elementtype->type_class = t->type_class;
2113 TRACE("\tClass: %s.\n", debug_d3d10_shader_variable_class(t->elementtype->type_class));
2114
2115 t->elementtype->members = t->members;
2116 }
2117
2118 return S_OK;
2119}
2120
2121static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data,
2122 size_t data_size, uint32_t offset)
2123{
2124 struct d3d10_effect_type *type;
2125 struct wine_rb_entry *entry;
2126 HRESULT hr;
2127
2128 entry = wine_rb_get(&effect->types, &offset);
2129 if (entry)
2130 {
2131 TRACE("Returning existing type.\n");
2133 }
2134
2135 if (!(type = calloc(1, sizeof(*type))))
2136 {
2137 ERR("Failed to allocate type memory.\n");
2138 return NULL;
2139 }
2140
2141 type->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
2142 type->id = offset;
2143 type->effect = effect;
2144 if (FAILED(hr = parse_fx10_type(data, data_size, offset, type)))
2145 {
2146 ERR("Failed to parse type info, hr %#lx.\n", hr);
2147 free(type);
2148 return NULL;
2149 }
2150
2151 if (wine_rb_put(&effect->types, &offset, &type->entry) == -1)
2152 {
2153 ERR("Failed to insert type entry.\n");
2154 free(type);
2155 return NULL;
2156 }
2157
2158 return type;
2159}
2160
2162{
2163 const ID3D10EffectVariableVtbl **vtbl = &v->ID3D10EffectVariable_iface.lpVtbl;
2164
2165 switch (v->type->type_class)
2166 {
2167 case D3D10_SVC_SCALAR:
2168 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl;
2169 break;
2170
2171 case D3D10_SVC_VECTOR:
2172 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl;
2173 break;
2174
2177 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl;
2178 break;
2179
2180 case D3D10_SVC_STRUCT:
2182 break;
2183
2184 case D3D10_SVC_OBJECT:
2185 switch(v->type->basetype)
2186 {
2187 case D3D10_SVT_STRING:
2188 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl;
2189 break;
2190
2191 case D3D10_SVT_TEXTURE:
2200 case D3D10_SVT_BUFFER: /* Either resource or constant buffer. */
2201 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl;
2202 break;
2203
2205 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl;
2206 break;
2207
2209 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl;
2210 break;
2211
2213 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl;
2214 break;
2215
2219 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl;
2220 break;
2221
2222 case D3D10_SVT_BLEND:
2223 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl;
2224 break;
2225
2227 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl;
2228 break;
2229
2230 case D3D10_SVT_SAMPLER:
2231 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl;
2232 break;
2233
2234 default:
2235 FIXME("Unhandled basetype %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
2237 break;
2238 }
2239 break;
2240
2241 default:
2242 FIXME("Unhandled type class %s.\n", debug_d3d10_shader_variable_class(v->type->type_class));
2244 break;
2245 }
2246}
2247
2249{
2250 unsigned int i;
2251 HRESULT hr;
2252
2253 if (v->type->member_count)
2254 {
2255 if (!(v->members = calloc(v->type->member_count, sizeof(*v->members))))
2256 {
2257 ERR("Failed to allocate members memory.\n");
2258 return E_OUTOFMEMORY;
2259 }
2260
2261 for (i = 0; i < v->type->member_count; ++i)
2262 {
2263 struct d3d10_effect_variable *var = &v->members[i];
2264 struct d3d10_effect_type_member *typem = &v->type->members[i];
2265
2266 var->buffer = v->buffer;
2267 var->effect = v->effect;
2268 var->type = typem->type;
2270
2271 if (!copy_name(typem->name, &var->name))
2272 {
2273 ERR("Failed to copy name.\n");
2274 return E_OUTOFMEMORY;
2275 }
2276 TRACE("Variable name: %s.\n", debugstr_a(var->name));
2277
2278 if (!copy_name(typem->semantic, &var->semantic))
2279 {
2280 ERR("Failed to copy name.\n");
2281 return E_OUTOFMEMORY;
2282 }
2283 TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
2284
2285 var->buffer_offset = v->buffer_offset + typem->buffer_offset;
2286 TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
2287
2289 if (FAILED(hr)) return hr;
2290 }
2291 }
2292
2293 if (v->type->element_count)
2294 {
2295 unsigned int bufferoffset = v->buffer_offset;
2296
2297 if (!(v->elements = calloc(v->type->element_count, sizeof(*v->elements))))
2298 {
2299 ERR("Failed to allocate elements memory.\n");
2300 return E_OUTOFMEMORY;
2301 }
2302
2303 for (i = 0; i < v->type->element_count; ++i)
2304 {
2305 struct d3d10_effect_variable *var = &v->elements[i];
2306
2307 var->buffer = v->buffer;
2308 var->effect = v->effect;
2309 var->type = v->type->elementtype;
2311
2312 if (!copy_name(v->name, &var->name))
2313 {
2314 ERR("Failed to copy name.\n");
2315 return E_OUTOFMEMORY;
2316 }
2317 TRACE("Variable name: %s.\n", debugstr_a(var->name));
2318
2319 if (!copy_name(v->semantic, &var->semantic))
2320 {
2321 ERR("Failed to copy name.\n");
2322 return E_OUTOFMEMORY;
2323 }
2324 TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
2325
2326 if (i != 0)
2327 {
2328 bufferoffset += v->type->stride;
2329 }
2330 var->buffer_offset = bufferoffset;
2331 TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
2332
2334 if (FAILED(hr)) return hr;
2335 }
2336 }
2337
2338 return S_OK;
2339}
2340
2342 const char **ptr, struct d3d10_effect_variable *v)
2343{
2345
2346 offset = read_u32(ptr);
2347 TRACE("Variable name at offset %#x.\n", offset);
2348
2349 if (!fx10_copy_string(data, data_size, offset, &v->name))
2350 {
2351 ERR("Failed to copy name.\n");
2352 return E_OUTOFMEMORY;
2353 }
2354 TRACE("Variable name: %s.\n", debugstr_a(v->name));
2355
2356 offset = read_u32(ptr);
2357 TRACE("Variable type info at offset %#x.\n", offset);
2358
2359 if (!(v->type = get_fx10_type(v->effect, data, data_size, offset)))
2360 {
2361 ERR("Failed to get variable type.\n");
2362 return E_FAIL;
2363 }
2365
2366 v->explicit_bind_point = ~0u;
2367
2368 if (v->effect->flags & D3D10_EFFECT_IS_POOL)
2370
2372}
2373
2374static HRESULT parse_fx10_annotation(const char *data, size_t data_size,
2375 const char **ptr, struct d3d10_effect_variable *a)
2376{
2378 HRESULT hr;
2379
2381 return hr;
2382
2383 offset = read_u32(ptr);
2384 TRACE("Annotation value is at offset %#x.\n", offset);
2385
2386 switch (a->type->basetype)
2387 {
2388 case D3D10_SVT_STRING:
2389 if (!fx10_copy_string(data, data_size, offset, (char **)&a->u.buffer.local_buffer))
2390 {
2391 ERR("Failed to copy name.\n");
2392 return E_OUTOFMEMORY;
2393 }
2394 break;
2395
2396 default:
2397 FIXME("Unhandled object type %#x.\n", a->type->basetype);
2398 }
2399
2400 /* mark the variable as annotation */
2402
2403 return S_OK;
2404}
2405
2406static HRESULT parse_fx10_annotations(const char *data, size_t data_size, const char **ptr,
2408{
2409 unsigned int i;
2410 HRESULT hr;
2411
2412 if (!(annotations->elements = calloc(annotations->count, sizeof(*annotations->elements))))
2413 {
2414 ERR("Failed to allocate annotations memory.\n");
2415 return E_OUTOFMEMORY;
2416 }
2417
2418 for (i = 0; i < annotations->count; ++i)
2419 {
2420 struct d3d10_effect_variable *a = &annotations->elements[i];
2421
2422 a->effect = effect;
2423 a->buffer = &null_local_buffer;
2424
2426 return hr;
2427 }
2428
2429 return hr;
2430}
2431
2434{
2435 struct d3d10_effect_variable *v = &s->shader;
2436 struct d3d10_effect_type *t = &s->type;
2437 const char *name = NULL;
2438
2439 switch (basetype)
2440 {
2442 name = "vertexshader";
2443 break;
2444
2446 name = "pixelshader";
2447 break;
2448
2450 name = "geometryshader";
2451 break;
2452
2453 default:
2454 WARN("Unhandled shader type %#x.\n", basetype);
2455 return E_FAIL;
2456 }
2457 t->basetype = basetype;
2458
2459 if (!copy_name(name, &t->name))
2460 {
2461 ERR("Failed to copy name.\n");
2462 return E_OUTOFMEMORY;
2463 }
2464 TRACE("Type name: %s.\n", debugstr_a(t->name));
2465
2466 t->type_class = D3D10_SVC_OBJECT;
2467
2468 t->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
2469
2470 v->type = t;
2471 v->effect = e;
2472 v->u.shader.isinline = 1;
2474
2475 if (!copy_name("$Anonymous", &v->name))
2476 {
2477 ERR("Failed to copy semantic.\n");
2478 return E_OUTOFMEMORY;
2479 }
2480 TRACE("Variable name: %s.\n", debugstr_a(v->name));
2481
2482 return S_OK;
2483}
2484
2486{
2487 unsigned int i;
2488
2490 {
2491 if (d3d10_effect_state_storage_info[i].id == id)
2493 }
2494
2495 return NULL;
2496}
2497
2498static BOOL read_value_list(const char *data, size_t data_size, uint32_t offset,
2499 D3D_SHADER_VARIABLE_TYPE out_type, unsigned int out_base, unsigned int out_size,
2500 void *out_data)
2501{
2502 uint32_t t, value, count, type_flags;
2504 const char *ptr;
2505 unsigned int i;
2506
2507 if (offset >= data_size || !require_space(offset, 1, sizeof(count), data_size))
2508 {
2509 WARN("Invalid offset %#x (data size %#Ix).\n", offset, data_size);
2510 return FALSE;
2511 }
2512
2513 ptr = data + offset;
2514 count = read_u32(&ptr);
2515 if (count != out_size)
2516 return FALSE;
2517
2518 if (!require_space(ptr - data, count, 2 * sizeof(DWORD), data_size))
2519 {
2520 WARN("Invalid value count %#x (offset %#x, data size %#Ix).\n", count, offset, data_size);
2521 return FALSE;
2522 }
2523
2524 TRACE("%u values:\n", count);
2525 for (i = 0; i < count; ++i)
2526 {
2527 unsigned int out_idx = out_base * out_size + i;
2528
2529 t = read_u32(&ptr);
2530 value = read_u32(&ptr);
2531
2532 in_type = d3d10_variable_type(t, FALSE, &type_flags);
2533 TRACE("\t%s: %#x.\n", debug_d3d10_shader_variable_type(in_type), value);
2534
2535 switch (out_type)
2536 {
2537 case D3D10_SVT_FLOAT:
2538 case D3D10_SVT_INT:
2539 case D3D10_SVT_UINT:
2540 case D3D10_SVT_UINT8:
2541 case D3D10_SVT_BOOL:
2542 if (!d3d10_effect_read_numeric_value(value, in_type, out_type, out_data, out_idx))
2543 return FALSE;
2544 break;
2545
2547 *(void **)out_data = &anonymous_vs;
2548 break;
2549
2551 *(void **)out_data = &anonymous_ps;
2552 break;
2553
2555 *(void **)out_data = &anonymous_gs;
2556 break;
2557
2558 case D3D10_SVT_TEXTURE:
2559 *(void **)out_data = &null_shader_resource_variable;
2560 break;
2561
2563 *(void **)out_data = &null_depth_stencil_variable;
2564 break;
2565
2566 case D3D10_SVT_BLEND:
2567 *(void **)out_data = &null_blend_variable;
2568 break;
2569
2570 default:
2571 FIXME("Unhandled out_type %#x.\n", out_type);
2572 return FALSE;
2573 }
2574 }
2575
2576 return TRUE;
2577}
2578
2580{
2581 switch (property_info->type)
2582 {
2585 case D3D10_SVT_BLEND:
2591 case D3D10_SVT_TEXTURE:
2592 return TRUE;
2593 default:
2594 return FALSE;
2595 }
2596}
2597
2599 const struct d3d10_effect_variable *v)
2600{
2601 if (property_info->type == v->type->basetype) return TRUE;
2602
2603 switch (v->type->basetype)
2604 {
2613 if (property_info->type == D3D10_SVT_TEXTURE) return TRUE;
2614 /* fallthrough */
2615 default:
2616 return FALSE;
2617 }
2618}
2619
2621 unsigned int *offset, const char **ptr, unsigned int data_size)
2622{
2623 const struct preshader_op_info *op_info;
2624 unsigned int i, param_count, size;
2625 struct preshader_instr ins;
2626 uint32_t input_count;
2627
2628 if (!require_space(*offset, 2, sizeof(uint32_t), data_size))
2629 {
2630 WARN("Malformed FXLC table, size %u.\n", data_size);
2631 return E_FAIL;
2632 }
2633
2634 *(uint32_t *)&ins = read_u32(ptr);
2635 input_count = read_u32(ptr);
2636 *offset += 2 * sizeof(uint32_t);
2637
2639 {
2640 FIXME("Unrecognized opcode %#x.\n", ins.opcode);
2641 return E_FAIL;
2642 }
2643
2644 TRACE("Opcode %#x (%s) (%u,%u), input count %u.\n", ins.opcode, op_info->name,
2645 ins.comp_count, ins.scalar, input_count);
2646
2647 /* Inputs + one output */
2648 param_count = input_count + 1;
2649
2650 if (!require_space(*offset, 3 * param_count, sizeof(uint32_t), data_size))
2651 {
2652 WARN("Malformed FXLC table, opcode %#x.\n", ins.opcode);
2653 return E_FAIL;
2654 }
2655 *offset += 3 * param_count * sizeof(uint32_t);
2656
2657 for (i = 0; i < param_count; ++i)
2658 {
2659 uint32_t flags, regt, param_offset;
2660
2661 flags = read_u32(ptr);
2662 if (flags)
2663 {
2664 FIXME("Argument flags are not supported %#x.\n", flags);
2665 return E_UNEXPECTED;
2666 }
2667
2668 regt = read_u32(ptr);
2669 param_offset = read_u32(ptr);
2670
2671 switch (regt)
2672 {
2674 case D3D10_REG_TABLE_CB:
2677 size = param_offset + (ins.scalar && i == 0 ? 1 : ins.comp_count);
2678 context->table_sizes[regt] = max(context->table_sizes[regt], size);
2679 break;
2680 default:
2681 FIXME("Unexpected register table index %u.\n", regt);
2682 break;
2683 }
2684 }
2685
2686 return S_OK;
2687}
2688
2689static HRESULT parse_fx10_fxlc(void *ctx, const char *data, unsigned int data_size)
2690{
2692 struct d3d10_effect_preshader *p = context->preshader;
2693 unsigned int i, offset = 4;
2694 uint32_t ins_count;
2695 const char *ptr;
2696 HRESULT hr;
2697
2698 if (data_size % sizeof(uint32_t))
2699 {
2700 WARN("FXLC size misaligned %u.\n", data_size);
2701 return E_FAIL;
2702 }
2703
2704 if (FAILED(hr = D3DCreateBlob(data_size, &p->code)))
2705 return hr;
2706 memcpy(ID3D10Blob_GetBufferPointer(p->code), data, data_size);
2707
2708 ptr = data;
2709 ins_count = read_u32(&ptr);
2710 TRACE("%u instructions.\n", ins_count);
2711
2712 for (i = 0; i < ins_count; ++i)
2713 {
2714 if (FAILED(hr = parse_fx10_preshader_instr(context, &offset, &ptr, data_size)))
2715 {
2716 WARN("Failed to parse instruction %u.\n", i);
2717 return hr;
2718 }
2719 }
2720
2722 context->table_sizes[D3D10_REG_TABLE_RESULT]))) return hr;
2724 context->table_sizes[D3D10_REG_TABLE_TEMP]))) return hr;
2725
2726 return S_OK;
2727}
2728
2729static HRESULT parse_fx10_cli4(void *ctx, const char *data, unsigned int data_size)
2730{
2732 struct d3d10_effect_preshader *p = context->preshader;
2733 struct d3d10_reg_table *table = &p->reg_tables[D3D10_REG_TABLE_CONSTANTS];
2734 const char *ptr = data;
2736 HRESULT hr;
2737
2738 if (data_size < sizeof(DWORD))
2739 {
2740 WARN("Invalid CLI4 chunk size %u.\n", data_size);
2741 return E_FAIL;
2742 }
2743
2744 count = read_u32(&ptr);
2745
2746 TRACE("%u literal constants.\n", count);
2747
2748 if (!require_space(4, count, sizeof(float), data_size))
2749 {
2750 WARN("Invalid constant table size %u.\n", data_size);
2751 return E_FAIL;
2752 }
2753
2755 return hr;
2756
2757 memcpy(table->f, ptr, table->count * sizeof(*table->f));
2758
2759 return S_OK;
2760}
2761
2762static HRESULT parse_fx10_ctab(void *ctx, const char *data, unsigned int data_size)
2763{
2765 struct d3d10_effect_preshader *p = context->preshader;
2766 struct ctab_header
2767 {
2768 uint32_t size;
2769 uint32_t creator;
2772 uint32_t constantinfo;
2775 } header;
2776 struct ctab_const_info
2777 {
2778 uint32_t name;
2779 WORD register_set;
2780 WORD register_index;
2781 WORD register_count;
2782 WORD reserved;
2784 uint32_t default_value;
2785 } *info;
2786 unsigned int i, cb_reg_count = 0;
2787 const char *ptr = data;
2788 const char *name;
2789 size_t name_len;
2790 HRESULT hr;
2791
2792 if (data_size < sizeof(header))
2793 {
2794 WARN("Invalid constant table size %u.\n", data_size);
2795 return E_FAIL;
2796 }
2797
2798 header.size = read_u32(&ptr);
2799 header.creator = read_u32(&ptr);
2800 header.version = read_u32(&ptr);
2801 header.constants = read_u32(&ptr);
2802 header.constantinfo = read_u32(&ptr);
2803 header.flags = read_u32(&ptr);
2804 header.target = read_u32(&ptr);
2805
2806 if (!require_space(header.constantinfo, header.constants, sizeof(*info), data_size))
2807 {
2808 WARN("Invalid constant info section offset %#x.\n", header.constantinfo);
2809 return E_FAIL;
2810 }
2811
2812 p->vars_count = header.constants;
2813
2814 TRACE("Variable count %u.\n", p->vars_count);
2815
2816 if (!(p->vars = calloc(p->vars_count, sizeof(*p->vars))))
2817 return E_OUTOFMEMORY;
2818
2819 info = (struct ctab_const_info *)(data + header.constantinfo);
2820 for (i = 0; i < p->vars_count; ++i, ++info)
2821 {
2822 if (!fx10_get_string(data, data_size, info->name, &name, &name_len))
2823 return E_FAIL;
2824
2825 if (!(p->vars[i].v = d3d10_effect_get_variable_by_name(context->effect, name)))
2826 {
2827 WARN("Couldn't find variable %s.\n", debugstr_a(name));
2828 return E_FAIL;
2829 }
2830
2831 /* 4 components per register */
2832 p->vars[i].offset = info->register_index * 4;
2833 p->vars[i].length = info->register_count * 4;
2834
2835 cb_reg_count = max(cb_reg_count, info->register_index + info->register_count);
2836 }
2837
2838 /* Allocate contiguous "constant buffer" for all referenced variables. */
2839 if (FAILED(hr = d3d10_reg_table_allocate(&p->reg_tables[D3D10_REG_TABLE_CB], cb_reg_count * 4)))
2840 {
2841 WARN("Failed to allocate variables buffer.\n");
2842 return hr;
2843 }
2844
2845 return S_OK;
2846}
2847
2850{
2851 const char *data = section->data.code;
2852 size_t data_size = section->data.size;
2853 uint32_t tag = section->tag;
2854
2855 TRACE("Chunk tag: %s, size: %Iu.\n", debugstr_fourcc(tag), data_size);
2856
2857 switch (tag)
2858 {
2859 case TAG_FXLC:
2860 return parse_fx10_fxlc(ctx, data, data_size);
2861
2862 case TAG_CLI4:
2863 return parse_fx10_cli4(ctx, data, data_size);
2864
2865 case TAG_CTAB:
2866 return parse_fx10_ctab(ctx, data, data_size);
2867
2868 default:
2869 FIXME("Unhandled chunk %s.\n", debugstr_fourcc(tag));
2870 return S_OK;
2871 }
2872}
2873
2874static HRESULT parse_fx10_preshader(const char *data, size_t data_size,
2875 struct d3d10_effect *effect, struct d3d10_effect_preshader *preshader)
2876{
2877 const struct vkd3d_shader_code dxbc = {.code = data, .size = data_size};
2880 struct vkd3d_shader_dxbc_desc dxbc_desc;
2881 HRESULT hr = S_OK;
2882 unsigned int i;
2883 int ret;
2884
2885 memset(preshader, 0, sizeof(*preshader));
2886 memset(&context, 0, sizeof(context));
2887 context.preshader = preshader;
2888 context.effect = effect;
2889
2890 if ((ret = vkd3d_shader_parse_dxbc(&dxbc, 0, &dxbc_desc, NULL)) < 0)
2891 {
2892 WARN("Failed to parse DXBC, ret %d.\n", ret);
2893 return E_FAIL;
2894 }
2895
2896 for (i = 0; i < dxbc_desc.section_count; ++i)
2897 {
2898 section = &dxbc_desc.sections[i];
2900 break;
2901 }
2902
2903 vkd3d_shader_free_dxbc(&dxbc_desc);
2904
2905 /* Constant buffer and literal constants are preallocated, validate here that expression
2906 has no invalid accesses for those. */
2907
2908 if (context.table_sizes[D3D10_REG_TABLE_CONSTANTS] >
2909 preshader->reg_tables[D3D10_REG_TABLE_CONSTANTS].count)
2910 {
2911 WARN("Expression references out of bounds literal constant.\n");
2912 return E_FAIL;
2913 }
2914
2915 if (context.table_sizes[D3D10_REG_TABLE_CB] > preshader->reg_tables[D3D10_REG_TABLE_CB].count)
2916 {
2917 WARN("Expression references out of bounds variable.\n");
2918 return E_FAIL;
2919 }
2920
2921 return hr;
2922}
2923
2925 const struct d3d10_effect_prop_dependency *dep)
2926{
2927 if (!d3d_array_reserve((void **)&d->entries, &d->capacity, d->count + 1, sizeof(*d->entries)))
2928 return E_OUTOFMEMORY;
2929
2930 d->entries[d->count++] = *dep;
2931
2932 return S_OK;
2933}
2934
2935static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size,
2937 struct d3d10_effect *effect, void *container, struct d3d10_effect_prop_dependencies *d)
2938{
2939 uint32_t id, idx, variable_idx, operation, value_offset, sodecl_offset;
2943 uint32_t code_offset, blob_size;
2944 const char *data_ptr, *name;
2945 unsigned int *dst_index;
2946 size_t name_len;
2947 HRESULT hr;
2948 void *dst;
2949
2950 id = read_u32(ptr);
2951 idx = read_u32(ptr);
2953 value_offset = read_u32(ptr);
2954
2955 if (id >= ARRAY_SIZE(property_infos))
2956 {
2957 FIXME("Unknown property id %#x.\n", id);
2958 return E_FAIL;
2959 }
2961
2962 TRACE("Property %s[%#x] = value list @ offset %#x.\n", property_info->name, idx, value_offset);
2963
2964 if (property_info->container_type != container_type)
2965 {
2966 ERR("Invalid container type %#x for property %#x.\n", container_type, id);
2967 return E_FAIL;
2968 }
2969
2970 if (idx >= property_info->count)
2971 {
2972 ERR("Invalid index %#x for property %#x.\n", idx, id);
2973 return E_FAIL;
2974 }
2975
2976 if (property_info->offset == ~0u)
2977 {
2978 ERR("Unsupported property %#x.\n", id);
2979 return E_NOTIMPL;
2980 }
2981
2982 dst = (char *)container + property_info->offset;
2983 dst_index = (unsigned int *)((char *)container + property_info->index_offset);
2984
2985 switch (operation)
2986 {
2987 case D3D10_EOO_CONST:
2988
2989 /* Constant values output directly to backing store. */
2990 if (!read_value_list(data, data_size, value_offset, property_info->type, idx,
2991 property_info->size, dst))
2992 {
2993 ERR("Failed to read values for property %#x.\n", id);
2994 return E_FAIL;
2995 }
2996 break;
2997
2998 case D3D10_EOO_VAR:
2999
3000 /* Variable. */
3001 if (!fx10_get_string(data, data_size, value_offset, &name, &name_len))
3002 {
3003 WARN("Failed to get variable name.\n");
3004 return E_FAIL;
3005 }
3006 TRACE("Variable name %s.\n", debugstr_a(name));
3007
3009 {
3010 WARN("Couldn't find variable %s.\n", debugstr_a(name));
3011 return E_FAIL;
3012 }
3013
3015 {
3016 if (variable->type->element_count)
3017 {
3018 WARN("Unexpected array variable value %s.\n", debugstr_a(name));
3019 return E_FAIL;
3020 }
3021
3023 {
3024 WARN("Object type mismatch. Variable type %#x, property type %#x.\n",
3025 variable->type->basetype, property_info->type);
3026 return E_FAIL;
3027 }
3028
3029 ((void **)dst)[idx] = variable;
3030 }
3031 else
3032 {
3033 if (property_info->size * sizeof(float) > variable->type->size_unpacked)
3034 {
3035 WARN("Mismatching variable size %u, property size %u.\n",
3036 variable->type->size_unpacked, property_info->size);
3037 return E_FAIL;
3038 }
3039
3040 dep.id = id;
3041 dep.idx = idx;
3042 dep.operation = operation;
3043 dep.var.v = variable;
3044 dep.var.offset = 0;
3045
3046 return d3d10_effect_add_prop_dependency(d, &dep);
3047 }
3048
3049 break;
3050
3052
3053 /* Array variable, constant index. */
3054 if (value_offset >= data_size || !require_space(value_offset, 2, sizeof(DWORD), data_size))
3055 {
3056 WARN("Invalid offset %#x (data size %#Ix).\n", value_offset, data_size);
3057 return E_FAIL;
3058 }
3059 data_ptr = data + value_offset;
3060 value_offset = read_u32(&data_ptr);
3061 variable_idx = read_u32(&data_ptr);
3062
3063 if (!fx10_get_string(data, data_size, value_offset, &name, &name_len))
3064 {
3065 WARN("Failed to get variable name.\n");
3066 return E_FAIL;
3067 }
3068
3069 TRACE("Variable name %s[%s%u].\n", debugstr_a(name), is_object_property(property_info) ?
3070 "" : "offset ", variable_idx);
3071
3073 {
3074 WARN("Couldn't find variable %s.\n", debugstr_a(name));
3075 return E_FAIL;
3076 }
3077
3079 {
3080 if (!variable->type->element_count || variable_idx >= variable->type->element_count)
3081 {
3082 WARN("Invalid array size %u.\n", variable->type->element_count);
3083 return E_FAIL;
3084 }
3085
3087 {
3088 WARN("Object type mismatch. Variable type %#x, property type %#x.\n",
3089 variable->type->basetype, property_info->type);
3090 return E_FAIL;
3091 }
3092
3093 /* Shader variables are special, they are referenced via array, with index stored separately. */
3094 switch (property_info->type)
3095 {
3099 ((void **)dst)[idx] = variable;
3100 *dst_index = variable_idx;
3101 break;
3102 default:
3103 ((void **)dst)[idx] = &variable->elements[variable_idx];
3104 }
3105 }
3106 else
3107 {
3108 unsigned int offset = variable_idx * sizeof(float);
3109
3110 if (offset >= variable->type->size_unpacked ||
3111 variable->type->size_unpacked - offset < property_info->size * sizeof(float))
3112 {
3113 WARN("Invalid numeric variable data offset %u.\n", variable_idx);
3114 return E_FAIL;
3115 }
3116
3117 dep.id = id;
3118 dep.idx = idx;
3119 dep.operation = operation;
3120 dep.var.v = variable;
3121 dep.var.offset = offset;
3122
3123 return d3d10_effect_add_prop_dependency(d, &dep);
3124 }
3125
3126 break;
3127
3129
3130 /* Variable, and an expression for its index. */
3131 if (value_offset >= data_size || !require_space(value_offset, 2, sizeof(DWORD), data_size))
3132 {
3133 WARN("Invalid offset %#x (data size %#Ix).\n", value_offset, data_size);
3134 return E_FAIL;
3135 }
3136
3137 data_ptr = data + value_offset;
3138 value_offset = read_u32(&data_ptr);
3139 code_offset = read_u32(&data_ptr);
3140
3141 if (!fx10_get_string(data, data_size, value_offset, &name, &name_len))
3142 {
3143 WARN("Failed to get variable name.\n");
3144 return E_FAIL;
3145 }
3146
3147 TRACE("Variable name %s[<expr>].\n", debugstr_a(name));
3148
3150 {
3151 WARN("Couldn't find variable %s.\n", debugstr_a(name));
3152 return E_FAIL;
3153 }
3154
3155 if (!variable->type->element_count)
3156 {
3157 WARN("Expected array variable.\n");
3158 return E_FAIL;
3159 }
3160
3162 {
3163 WARN("Expected object type property used with indexed expression.\n");
3164 return E_FAIL;
3165 }
3166
3167 if (code_offset >= data_size || !require_space(code_offset, 1, sizeof(DWORD), data_size))
3168 {
3169 WARN("Invalid offset %#x (data size %#Ix).\n", value_offset, data_size);
3170 return E_FAIL;
3171 }
3172
3173 data_ptr = data + code_offset;
3174 blob_size = read_u32(&data_ptr);
3175
3176 if (!require_space(code_offset, 1, sizeof(uint32_t) + blob_size, data_size))
3177 {
3178 WARN("Invalid offset %#x (data size %#Ix).\n", code_offset, data_size);
3179 return E_FAIL;
3180 }
3181
3182 dep.id = id;
3183 dep.idx = idx;
3184 dep.operation = operation;
3185 dep.index_expr.v = variable;
3186 if (FAILED(hr = parse_fx10_preshader(data_ptr, blob_size, effect, &dep.index_expr.index)))
3187 {
3188 WARN("Failed to parse preshader, hr %#lx.\n", hr);
3189 return hr;
3190 }
3191
3192 return d3d10_effect_add_prop_dependency(d, &dep);
3193
3195
3196 if (value_offset >= data_size || !require_space(value_offset, 1, sizeof(uint32_t), data_size))
3197 {
3198 WARN("Invalid offset %#x (data size %#Ix).\n", value_offset, data_size);
3199 return E_FAIL;
3200 }
3201
3202 data_ptr = data + value_offset;
3203 blob_size = read_u32(&data_ptr);
3204
3205 if (!require_space(value_offset, 1, sizeof(uint32_t) + blob_size, data_size))
3206 {
3207 WARN("Invalid offset %#x (data size %#Ix).\n", value_offset, data_size);
3208 return E_FAIL;
3209 }
3210
3211 dep.id = id;
3212 dep.idx = idx;
3213 dep.operation = operation;
3214 if (FAILED(hr = parse_fx10_preshader(data_ptr, blob_size, effect, &dep.value_expr.value)))
3215 {
3216 WARN("Failed to parse preshader, hr %#lx.\n", hr);
3217 return hr;
3218 }
3219
3220 return d3d10_effect_add_prop_dependency(d, &dep);
3221
3223
3224 /* Anonymous shader */
3225 if (effect->anonymous_shader_current >= effect->anonymous_shader_count)
3226 {
3227 ERR("Anonymous shader count is wrong!\n");
3228 return E_FAIL;
3229 }
3230
3231 if (value_offset >= data_size || !require_space(value_offset, 2, sizeof(DWORD), data_size))
3232 {
3233 WARN("Invalid offset %#x (data size %#Ix).\n", value_offset, data_size);
3234 return E_FAIL;
3235 }
3236 data_ptr = data + value_offset;
3237 value_offset = read_u32(&data_ptr);
3238 sodecl_offset = read_u32(&data_ptr);
3239
3240 TRACE("Effect object starts at offset %#x.\n", value_offset);
3241
3243 &effect->anonymous_shaders[effect->anonymous_shader_current])))
3244 return hr;
3245
3246 variable = &effect->anonymous_shaders[effect->anonymous_shader_current].shader;
3247 ++effect->anonymous_shader_current;
3248
3249 if (sodecl_offset)
3250 {
3251 TRACE("Anonymous shader stream output declaration at offset %#x.\n", sodecl_offset);
3252 if (!fx10_copy_string(data, data_size, sodecl_offset,
3253 &variable->u.shader.stream_output_declaration))
3254 {
3255 ERR("Failed to copy stream output declaration.\n");
3256 return E_FAIL;
3257 }
3258
3259 TRACE("Stream output declaration: %s.\n", debugstr_a(variable->u.shader.stream_output_declaration));
3260 }
3261
3262 switch (property_info->type)
3263 {
3267 if (FAILED(hr = parse_fx10_shader(data, data_size, value_offset, variable)))
3268 return hr;
3269 break;
3270
3271 default:
3272 WARN("Unexpected shader type %#x.\n", property_info->type);
3273 return E_FAIL;
3274 }
3275
3276 ((void **)dst)[idx] = variable;
3277
3278 break;
3279
3280 default:
3281 FIXME("Unhandled operation %#x.\n", operation);
3282 return E_FAIL;
3283 }
3284
3285 return S_OK;
3286}
3287
3288static HRESULT parse_fx10_pass(const char *data, size_t data_size,
3289 const char **ptr, struct d3d10_effect_pass *p)
3290{
3292 unsigned int i;
3293 HRESULT hr;
3294
3295 offset = read_u32(ptr);
3296 TRACE("Pass name at offset %#x.\n", offset);
3297
3298 if (!fx10_copy_string(data, data_size, offset, &p->name))
3299 {
3300 ERR("Failed to copy name.\n");
3301 return E_OUTOFMEMORY;
3302 }
3303 TRACE("Pass name: %s.\n", debugstr_a(p->name));
3304
3306 TRACE("Pass has %u effect objects.\n", object_count);
3307
3308 p->annotations.count = read_u32(ptr);
3309 TRACE("Pass has %u annotations.\n", p->annotations.count);
3310
3311 if (FAILED(hr = parse_fx10_annotations(data, data_size, ptr, p->technique->effect,
3312 &p->annotations)))
3313 {
3314 ERR("Failed to parse pass annotations, hr %#lx.\n", hr);
3315 return hr;
3316 }
3317
3318 p->vs.shader = &null_shader_variable;
3319 p->ps.shader = &null_shader_variable;
3320 p->gs.shader = &null_shader_variable;
3321
3322 for (i = 0; i < object_count; ++i)
3323 {
3325 D3D10_C_PASS, p->technique->effect, p, &p->dependencies)))
3326 {
3327 WARN("Failed to parse pass assignment %u, hr %#lx.\n", i, hr);
3328 return hr;
3329 }
3330 }
3331
3332 return hr;
3333}
3334
3335static HRESULT parse_fx10_technique(const char *data, size_t data_size,
3336 const char **ptr, struct d3d10_effect_technique *t)
3337{
3338 unsigned int i;
3340 HRESULT hr;
3341
3342 offset = read_u32(ptr);
3343 TRACE("Technique name at offset %#x.\n", offset);
3344
3345 if (!fx10_copy_string(data, data_size, offset, &t->name))
3346 {
3347 ERR("Failed to copy name.\n");
3348 return E_OUTOFMEMORY;
3349 }
3350 TRACE("Technique name: %s.\n", debugstr_a(t->name));
3351
3352 t->pass_count = read_u32(ptr);
3353 TRACE("Technique has %u passes.\n", t->pass_count);
3354
3355 t->annotations.count = read_u32(ptr);
3356 TRACE("Technique has %u annotations.\n", t->annotations.count);
3357
3359 &t->annotations)))
3360 {
3361 ERR("Failed to parse technique annotations, hr %#lx.\n", hr);
3362 return hr;
3363 }
3364
3365 if (!(t->passes = calloc(t->pass_count, sizeof(*t->passes))))
3366 {
3367 ERR("Failed to allocate passes memory\n");
3368 return E_OUTOFMEMORY;
3369 }
3370
3371 for (i = 0; i < t->pass_count; ++i)
3372 {
3373 struct d3d10_effect_pass *p = &t->passes[i];
3374
3376 p->technique = t;
3377
3378 if (FAILED(hr = parse_fx10_pass(data, data_size, ptr, p)))
3379 return hr;
3380 }
3381
3382 return S_OK;
3383}
3384
3386{
3387 float *dst = (float *)(v->buffer->u.buffer.local_buffer + v->buffer_offset), *src;
3388 BOOL col_major = v->type->type_class == D3D10_SVC_MATRIX_COLUMNS;
3389 unsigned int col_count = v->type->column_count, col;
3390 unsigned int row_count = v->type->row_count, row;
3391
3392 src = (float *)*ptr;
3393
3394 if (col_major)
3395 {
3396 for (col = 0; col < col_count; ++col)
3397 {
3398 for (row = 0; row < row_count; ++row)
3399 dst[row] = src[row * col_count + col];
3400 dst += 4;
3401 }
3402 }
3403 else
3404 {
3405 for (row = 0; row < row_count; ++row)
3406 {
3407 memcpy(dst, src, col_count * sizeof(float));
3408 src += col_count;
3409 dst += 4;
3410 }
3411 }
3412
3413 *ptr += col_count * row_count * sizeof(float);
3414}
3415
3416static void parse_fx10_default_value(const char **ptr, struct d3d10_effect_variable *var)
3417{
3418 unsigned int element_count = max(var->type->element_count, 1), i, m;
3419 struct d3d10_effect_variable *v;
3420
3421 for (i = 0; i < element_count; ++i)
3422 {
3424
3425 switch (v->type->type_class)
3426 {
3427 case D3D10_SVC_STRUCT:
3428 for (m = 0; m < v->type->member_count; ++m)
3429 parse_fx10_default_value(ptr, &v->members[m]);
3430 break;
3431 case D3D10_SVC_SCALAR:
3432 case D3D10_SVC_VECTOR:
3436 break;
3437 default:
3438 FIXME("Unexpected initial value for type %#x.\n", v->type->basetype);
3439 return;
3440 }
3441 }
3442}
3443
3445 unsigned int offset)
3446{
3447 unsigned int i;
3448
3449 for (i = 0; i < v->type->member_count; ++i)
3451
3452 for (i = 0; i < v->type->element_count; ++i)
3454
3455 v->buffer_offset += offset;
3456}
3457
3459 const char **ptr, BOOL local, struct d3d10_effect_variable *v)
3460{
3461 uint32_t offset, flags, default_value_offset, buffer_offset;
3462 const char *data_ptr;
3463 HRESULT hr;
3464
3466 return hr;
3467
3468 offset = read_u32(ptr);
3469 TRACE("Variable semantic at offset %#x.\n", offset);
3470
3471 if (!fx10_copy_string(data, data_size, offset, &v->semantic))
3472 {
3473 ERR("Failed to copy semantic.\n");
3474 return E_OUTOFMEMORY;
3475 }
3476 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
3477
3479 TRACE("Variable offset in buffer: %#x.\n", buffer_offset);
3480
3481 default_value_offset = read_u32(ptr);
3482 TRACE("Variable default value offset: %#x.\n", default_value_offset);
3483
3484 flags = read_u32(ptr);
3485 TRACE("Variable flags: %#x.\n", flags);
3486
3487 v->flag |= flags;
3488
3489 /* At this point storage offsets for members and array elements are relative to containing
3490 variable. Update them by moving to correct offset within a buffer. */
3492
3493 if (local)
3494 {
3495 if (default_value_offset)
3496 {
3497 if (!require_space(default_value_offset, 1, v->type->size_packed, data_size))
3498 {
3499 WARN("Invalid default value offset %#x, variable packed size %u.\n", default_value_offset,
3500 v->type->size_packed);
3501 return E_FAIL;
3502 }
3503
3504 data_ptr = data + default_value_offset;
3505 parse_fx10_default_value(&data_ptr, v);
3506 }
3507
3508 v->annotations.count = read_u32(ptr);
3509 TRACE("Variable has %u annotations.\n", v->annotations.count);
3510
3512 &v->annotations)))
3513 {
3514 ERR("Failed to parse variable annotations, hr %#lx.\n", hr);
3515 return hr;
3516 }
3517 }
3518
3520 v->explicit_bind_point = v->buffer_offset;
3521
3522 return S_OK;
3523}
3524
3526{
3527 ID3D10Device *device = v->effect->device;
3528 HRESULT hr;
3529
3530 switch (v->type->basetype)
3531 {
3533 if (FAILED(hr = ID3D10Device_CreateDepthStencilState(device,
3534 &v->u.state.desc.depth_stencil, &v->u.state.object.depth_stencil)))
3535 return hr;
3536 break;
3537
3538 case D3D10_SVT_BLEND:
3539 if (FAILED(hr = ID3D10Device_CreateBlendState(device,
3540 &v->u.state.desc.blend, &v->u.state.object.blend)))
3541 return hr;
3542 break;
3543
3545 if (FAILED(hr = ID3D10Device_CreateRasterizerState(device,
3546 &v->u.state.desc.rasterizer, &v->u.state.object.rasterizer)))
3547 return hr;
3548 break;
3549
3550 case D3D10_SVT_SAMPLER:
3551 if (FAILED(hr = ID3D10Device_CreateSamplerState(device,
3552 &v->u.state.desc.sampler.desc, &v->u.state.object.sampler)))
3553 return hr;
3554 break;
3555
3556 default:
3557 ERR("Unhandled variable type %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
3558 return E_FAIL;
3559 }
3560
3561 return S_OK;
3562}
3563
3565 const char **ptr, BOOL shared_type_desc, struct d3d10_effect_variable *v)
3566{
3567 struct d3d10_effect_var_array *vars;
3568 struct d3d10_effect_variable *var;
3569 unsigned int i, j, element_count;
3570 HRESULT hr;
3572
3574 return hr;
3575
3576 offset = read_u32(ptr);
3577 TRACE("Variable semantic at offset %#x.\n", offset);
3578
3579 if (!fx10_copy_string(data, data_size, offset, &v->semantic))
3580 {
3581 ERR("Failed to copy semantic.\n");
3582 return E_OUTOFMEMORY;
3583 }
3584 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
3585
3586 v->explicit_bind_point = read_u32(ptr);
3587 TRACE("Variable explicit bind point %#x.\n", v->explicit_bind_point);
3588
3589 /* Shared variable description contains only type information. */
3590 if (shared_type_desc) return S_OK;
3591
3592 element_count = max(v->type->element_count, 1);
3593
3594 switch (v->type->basetype)
3595 {
3596 case D3D10_SVT_TEXTURE:
3605 if (!(v->u.resource.srv = calloc(element_count, sizeof(*v->u.resource.srv))))
3606 {
3607 ERR("Failed to allocate shader resource view array memory.\n");
3608 return E_OUTOFMEMORY;
3609 }
3610 v->u.resource.parent = TRUE;
3611
3612 if (v->elements)
3613 {
3614 for (i = 0; i < v->type->element_count; ++i)
3615 {
3616 v->elements[i].u.resource.srv = &v->u.resource.srv[i];
3617 v->elements[i].u.resource.parent = FALSE;
3618 }
3619 }
3620 break;
3621
3624 case D3D10_SVT_BUFFER:
3625 TRACE("SVT could not have elements.\n");
3626 break;
3627
3631 TRACE("Shader type is %s\n", debug_d3d10_shader_variable_type(v->type->basetype));
3632 for (i = 0; i < element_count; ++i)
3633 {
3634 uint32_t shader_offset, sodecl_offset;
3635
3637
3638 shader_offset = read_u32(ptr);
3639 TRACE("Shader offset: %#x.\n", shader_offset);
3640
3641 if (v->type->flags & D3D10_EOT_FLAG_GS_SO)
3642 {
3643 sodecl_offset = read_u32(ptr);
3644 TRACE("Stream output declaration at offset %#x.\n", sodecl_offset);
3645
3646 if (!fx10_copy_string(data, data_size, sodecl_offset,
3647 &var->u.shader.stream_output_declaration))
3648 {
3649 ERR("Failed to copy stream output declaration.\n");
3650 return E_OUTOFMEMORY;
3651 }
3652
3653 TRACE("Stream output declaration: %s.\n", debugstr_a(var->u.shader.stream_output_declaration));
3654 }
3655
3656 if (FAILED(hr = parse_fx10_shader(data, data_size, shader_offset, var)))
3657 return hr;
3658 }
3659 break;
3660
3662 case D3D10_SVT_BLEND:
3664 case D3D10_SVT_SAMPLER:
3665 {
3666 const struct d3d10_effect_state_storage_info *storage_info;
3667
3668 if (!(storage_info = get_storage_info(v->type->basetype)))
3669 {
3670 FIXME("Failed to get backing store info for type %s.\n",
3671 debug_d3d10_shader_variable_type(v->type->basetype));
3672 return E_FAIL;
3673 }
3674
3675 if (storage_info->size > sizeof(v->u.state.desc))
3676 {
3677 ERR("Invalid storage size %#Ix.\n", storage_info->size);
3678 return E_FAIL;
3679 }
3680
3681 switch (v->type->basetype)
3682 {
3684 vars = &v->effect->ds_states;
3685 break;
3686 case D3D10_SVT_BLEND:
3687 vars = &v->effect->blend_states;
3688 break;
3690 vars = &v->effect->rs_states;
3691 break;
3692 case D3D10_SVT_SAMPLER:
3693 vars = &v->effect->samplers;
3694 break;
3695 default:
3696 ;
3697 }
3698
3699 for (i = 0; i < element_count; ++i)
3700 {
3701 unsigned int prop_count;
3702
3704
3705 if (vars->current >= vars->count)
3706 {
3707 WARN("Wrong variable array size for %#x.\n", v->type->basetype);
3708 return E_FAIL;
3709 }
3710 var->u.state.index = vars->current;
3711 vars->v[vars->current++] = var;
3712
3713 prop_count = read_u32(ptr);
3714 TRACE("State object property count: %#x.\n", prop_count);
3715
3716 memcpy(&var->u.state.desc, storage_info->default_state, storage_info->size);
3717
3718 for (j = 0; j < prop_count; ++j)
3719 {
3721 get_var_container_type(var), var->effect, &var->u.state.desc,
3722 &var->u.state.dependencies)))
3723 {
3724 ERR("Failed to read property list.\n");
3725 return hr;
3726 }
3727 }
3728
3730 return hr;
3731 }
3732 }
3733 break;
3734
3735 default:
3736 FIXME("Unhandled case %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
3737 return E_FAIL;
3738 }
3739
3740 v->annotations.count = read_u32(ptr);
3741 TRACE("Variable has %u annotations.\n", v->annotations.count);
3742
3743 if (FAILED(hr = parse_fx10_annotations(data, data_size, ptr, v->effect,
3744 &v->annotations)))
3745 {
3746 ERR("Failed to parse variable annotations, hr %#lx.\n", hr);
3747 return hr;
3748 }
3749
3750 return S_OK;
3751}
3752
3754{
3755 D3D10_BUFFER_DESC buffer_desc;
3756 D3D10_SUBRESOURCE_DATA subresource_data;
3758 ID3D10Device *device = v->effect->device;
3759 HRESULT hr;
3760
3761 buffer_desc.ByteWidth = v->data_size;
3762 buffer_desc.Usage = D3D10_USAGE_DEFAULT;
3763 buffer_desc.CPUAccessFlags = 0;
3764 buffer_desc.MiscFlags = 0;
3765 if (v->type->basetype == D3D10_SVT_CBUFFER)
3767 else
3769
3770 subresource_data.pSysMem = v->u.buffer.local_buffer;
3771 subresource_data.SysMemPitch = 0;
3772 subresource_data.SysMemSlicePitch = 0;
3773
3774 if (FAILED(hr = ID3D10Device_CreateBuffer(device, &buffer_desc, &subresource_data, &v->u.buffer.buffer)))
3775 return hr;
3776
3777 if (v->type->basetype == D3D10_SVT_TBUFFER)
3778 {
3781 srv_desc.Buffer.ElementOffset = 0;
3782 srv_desc.Buffer.ElementWidth = v->type->size_unpacked / 16;
3783 if (v->type->size_unpacked % 16)
3784 WARN("Unexpected texture buffer size not a multiple of 16.\n");
3785
3786 if (FAILED(hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)v->u.buffer.buffer,
3787 &srv_desc, &v->u.buffer.resource_view)))
3788 return hr;
3789 }
3790 else
3791 v->u.buffer.resource_view = NULL;
3792
3793 return S_OK;
3794}
3795
3796static HRESULT parse_fx10_buffer(const char *data, size_t data_size, const char **ptr,
3798{
3799 enum buffer_flags
3800 {
3801 IS_TBUFFER = 1,
3802 };
3803 const char *prefix = local ? "Local" : "Shared";
3805 unsigned int i;
3806 HRESULT hr;
3807 unsigned int stride = 0;
3808
3809 /* Generate our own type, it isn't in the fx blob. */
3810 if (!(l->type = calloc(1, sizeof(*l->type))))
3811 {
3812 ERR("Failed to allocate local buffer type memory.\n");
3813 return E_OUTOFMEMORY;
3814 }
3815 l->type->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
3816 l->type->type_class = D3D10_SVC_OBJECT;
3817 l->type->effect = l->effect;
3818
3819 offset = read_u32(ptr);
3820 TRACE("%s buffer name at offset %#x.\n", prefix, offset);
3821
3822 if (!fx10_copy_string(data, data_size, offset, &l->name))
3823 {
3824 ERR("Failed to copy name.\n");
3825 return E_OUTOFMEMORY;
3826 }
3827 TRACE("%s buffer name: %s.\n", prefix, debugstr_a(l->name));
3828
3829 l->data_size = read_u32(ptr);
3830 TRACE("%s buffer data size: %#x.\n", prefix, l->data_size);
3831
3832 flags = read_u32(ptr);
3833 TRACE("%s buffer flags: %#x.\n", prefix, flags);
3834
3835 if (flags & IS_TBUFFER)
3836 {
3837 l->type->basetype = D3D10_SVT_TBUFFER;
3838 copy_name("tbuffer", &l->type->name);
3839 }
3840 else
3841 {
3842 l->type->basetype = D3D10_SVT_CBUFFER;
3843 copy_name("cbuffer", &l->type->name);
3844 }
3845 if (!l->type->name)
3846 {
3847 ERR("Failed to copy name.\n");
3848 return E_OUTOFMEMORY;
3849 }
3850
3851 flags &= ~IS_TBUFFER;
3852 if (flags)
3853 {
3854 ERR("Unexpected buffer flags %#x.\n", flags);
3855 return E_FAIL;
3856 }
3857
3858 l->type->member_count = read_u32(ptr);
3859 TRACE("%s buffer member count: %#x.\n", prefix, l->type->member_count);
3860
3861 l->explicit_bind_point = read_u32(ptr);
3862 TRACE("%s buffer explicit bind point: %#x.\n", prefix, l->explicit_bind_point);
3863
3864 if (l->effect->flags & D3D10_EFFECT_IS_POOL)
3866
3867 if (local)
3868 {
3869 l->annotations.count = read_u32(ptr);
3870 TRACE("Local buffer has %u annotations.\n", l->annotations.count);
3871
3872 if (FAILED(hr = parse_fx10_annotations(data, data_size, ptr, l->effect,
3873 &l->annotations)))
3874 {
3875 ERR("Failed to parse buffer annotations, hr %#lx.\n", hr);
3876 return hr;
3877 }
3878 }
3879
3880 if (!(l->members = calloc(l->type->member_count, sizeof(*l->members))))
3881 {
3882 ERR("Failed to allocate members memory.\n");
3883 return E_OUTOFMEMORY;
3884 }
3885
3886 if (!(l->type->members = calloc(l->type->member_count, sizeof(*l->type->members))))
3887 {
3888 ERR("Failed to allocate type members memory.\n");
3889 return E_OUTOFMEMORY;
3890 }
3891
3892 if (local && !(l->u.buffer.local_buffer = calloc(1, l->data_size)))
3893 {
3894 ERR("Failed to allocate local constant buffer memory.\n");
3895 return E_OUTOFMEMORY;
3896 }
3897
3898 for (i = 0; i < l->type->member_count; ++i)
3899 {
3900 struct d3d10_effect_variable *v = &l->members[i];
3901 struct d3d10_effect_type_member *typem = &l->type->members[i];
3902
3903 v->buffer = l;
3904 v->effect = l->effect;
3905
3906 if (FAILED(hr = parse_fx10_numeric_variable(data, data_size, ptr, local, v)))
3907 return hr;
3908
3909 /*
3910 * Copy the values from the variable type to the constant buffers type
3911 * members structure, because it is our own generated type.
3912 */
3913 typem->type = v->type;
3914
3915 if (!copy_name(v->name, &typem->name))
3916 {
3917 ERR("Failed to copy name.\n");
3918 return E_OUTOFMEMORY;
3919 }
3920 TRACE("Variable name: %s.\n", debugstr_a(typem->name));
3921
3922 if (!copy_name(v->semantic, &typem->semantic))
3923 {
3924 ERR("Failed to copy name.\n");
3925 return E_OUTOFMEMORY;
3926 }
3927 TRACE("Variable semantic: %s.\n", debugstr_a(typem->semantic));
3928
3929 typem->buffer_offset = v->buffer_offset;
3930 TRACE("Variable buffer offset: %u.\n", typem->buffer_offset);
3931
3932 l->type->size_packed += v->type->size_packed;
3933
3934 /*
3935 * For the complete constantbuffer the size_unpacked = stride,
3936 * the stride is calculated like this:
3937 *
3938 * 1) if the constant buffer variables are packed with packoffset
3939 * - stride = the highest used constant
3940 * - the complete stride has to be a multiple of 0x10
3941 *
3942 * 2) if the constant buffer variables are NOT packed with packoffset
3943 * - sum of unpacked size for all variables which fit in a 0x10 part
3944 * - if the size exceeds a 0x10 part, the rest of the old part is skipped
3945 * and a new part is started
3946 * - if the variable is a struct it is always used a new part
3947 * - the complete stride has to be a multiple of 0x10
3948 *
3949 * e.g.:
3950 * 0x4, 0x4, 0x4, 0x8, 0x4, 0x14, 0x4
3951 * part 0x10 0x10 0x20 -> 0x40
3952 */
3954 {
3955 if ((v->type->size_unpacked + v->buffer_offset) > stride)
3956 {
3957 stride = v->type->size_unpacked + v->buffer_offset;
3958 }
3959 }
3960 else
3961 {
3962 if (v->type->type_class == D3D10_SVC_STRUCT)
3963 {
3964 stride = (stride + 0xf) & ~0xf;
3965 }
3966
3967 if ( ((stride & 0xf) + v->type->size_unpacked) > 0x10)
3968 {
3969 stride = (stride + 0xf) & ~0xf;
3970 }
3971
3972 stride += v->type->size_unpacked;
3973 }
3974 }
3975 l->type->stride = l->type->size_unpacked = (stride + 0xf) & ~0xf;
3976
3977 TRACE("%s constant buffer:\n", prefix);
3978 TRACE("\tType name: %s.\n", debugstr_a(l->type->name));
3979 TRACE("\tElement count: %u.\n", l->type->element_count);
3980 TRACE("\tMember count: %u.\n", l->type->member_count);
3981 TRACE("\tUnpacked size: %#x.\n", l->type->size_unpacked);
3982 TRACE("\tStride: %#x.\n", l->type->stride);
3983 TRACE("\tPacked size %#x.\n", l->type->size_packed);
3984 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l->type->basetype));
3985 TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l->type->type_class));
3986
3987 if (local && l->data_size)
3988 {
3990 {
3991 WARN("Failed to create a buffer object, hr %#lx.\n", hr);
3992 return hr;
3993 }
3994 }
3995
3996 if (l->explicit_bind_point != ~0u)
3998
3999 return S_OK;
4000}
4001
4003{
4004 TRACE("effect type member %p.\n", typem);
4005
4006 /* Do not release typem->type, it will be covered by d3d10_effect_type_destroy(). */
4007 free(typem->semantic);
4008 free(typem->name);
4009}
4010
4012{
4014
4015 TRACE("effect type %p.\n", t);
4016
4017 if (t->elementtype)
4018 {
4019 free(t->elementtype->name);
4020 free(t->elementtype);
4021 }
4022
4023 if (t->members)
4024 {
4025 unsigned int i;
4026
4027 for (i = 0; i < t->member_count; ++i)
4028 {
4030 }
4031 free(t->members);
4032 }
4033
4034 free(t->name);
4035 free(t);
4036}
4037
4039 const struct d3d10_effect_type *t2)
4040{
4041 unsigned int i;
4042
4043 if (strcmp(t1->name, t2->name)) return FALSE;
4044 if (t1->basetype != t2->basetype) return FALSE;
4045 if (t1->type_class != t2->type_class) return FALSE;
4046 if (t1->element_count != t2->element_count) return FALSE;
4048 if (t1->member_count != t2->member_count) return FALSE;
4049 if (t1->column_count != t2->column_count) return FALSE;
4050 if (t1->row_count != t2->row_count) return FALSE;
4051
4052 for (i = 0; i < t1->member_count; ++i)
4053 {
4054 if (strcmp(t1->members[i].name, t2->members[i].name)) return FALSE;
4055 if (t1->members[i].buffer_offset != t2->members[i].buffer_offset) return FALSE;
4056 if (!d3d10_effect_types_match(t1->members[i].type, t2->members[i].type)) return FALSE;
4057 }
4058
4059 return TRUE;
4060}
4061
4063 const struct d3d10_effect_variable *v)
4064{
4065 struct d3d10_effect_variable *sv;
4066
4067 switch (v->type->basetype)
4068 {
4069 case D3D10_SVT_CBUFFER:
4070 case D3D10_SVT_TBUFFER:
4071 sv = d3d10_effect_get_buffer_by_name(effect->pool, v->name);
4072 break;
4073 default:
4074 sv = d3d10_effect_get_variable_by_name(effect->pool, v->name);
4075 }
4076
4077 if (!sv)
4078 {
4079 WARN("Variable %s wasn't found in the pool.\n", debugstr_a(v->name));
4080 return E_INVALIDARG;
4081 }
4082
4083 if (!d3d10_effect_types_match(sv->type, v->type))
4084 {
4085 WARN("Variable %s type does not match pool type.\n", debugstr_a(v->name));
4086 return E_INVALIDARG;
4087 }
4088
4089 return S_OK;
4090}
4091
4092static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, size_t data_size)
4093{
4094 const char *ptr;
4095 unsigned int i;
4096 HRESULT hr;
4097
4098 if (e->index_offset >= data_size)
4099 {
4100 WARN("Invalid index offset %#x (data size %#Ix).\n", e->index_offset, data_size);
4101 return E_FAIL;
4102 }
4103 ptr = data + e->index_offset;
4104
4105 if (!(e->local_buffers = calloc(e->local_buffer_count, sizeof(*e->local_buffers))))
4106 {
4107 ERR("Failed to allocate local buffer memory.\n");
4108 return E_OUTOFMEMORY;
4109 }
4110
4111 if (!(e->object_variables = calloc(e->object_count, sizeof(*e->object_variables))))
4112 {
4113 ERR("Failed to allocate object variables memory.\n");
4114 return E_OUTOFMEMORY;
4115 }
4116
4117 if (!(e->anonymous_shaders = calloc(e->anonymous_shader_count, sizeof(*e->anonymous_shaders))))
4118 {
4119 ERR("Failed to allocate anonymous shaders memory\n");
4120 return E_OUTOFMEMORY;
4121 }
4122
4123 if (!(e->shaders.v = calloc(e->shaders.count, sizeof(*e->shaders.v))))
4124 {
4125 ERR("Failed to allocate used shaders memory\n");
4126 return E_OUTOFMEMORY;
4127 }
4128
4129 if (!(e->samplers.v = calloc(e->samplers.count, sizeof(*e->samplers.v))))
4130 {
4131 ERR("Failed to allocate samplers array.\n");
4132 return E_OUTOFMEMORY;
4133 }
4134
4135 if (!(e->blend_states.v = calloc(e->blend_states.count, sizeof(*e->blend_states.v))))
4136 {
4137 ERR("Failed to allocate blend states array.\n");
4138 return E_OUTOFMEMORY;
4139 }
4140
4141 if (!(e->ds_states.v = calloc(e->ds_states.count, sizeof(*e->ds_states.v))))
4142 {
4143 ERR("Failed to allocate depth stencil states array.\n");
4144 return E_OUTOFMEMORY;
4145 }
4146
4147 if (!(e->rs_states.v = calloc(e->rs_states.count, sizeof(*e->rs_states.v))))
4148 {
4149 ERR("Failed to allocate rasterizer states array.\n");
4150 return E_OUTOFMEMORY;
4151 }
4152
4153 if (!(e->techniques = calloc(e->technique_count, sizeof(*e->techniques))))
4154 {
4155 ERR("Failed to allocate techniques memory\n");
4156 return E_OUTOFMEMORY;
4157 }
4158
4159 for (i = 0; i < e->local_buffer_count; ++i)
4160 {
4161 struct d3d10_effect_variable *l = &e->local_buffers[i];
4162 l->ID3D10EffectVariable_iface.lpVtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl;
4163 l->effect = e;
4164 l->buffer = &null_local_buffer;
4165
4167 return hr;
4168 }
4169
4170 for (i = 0; i < e->object_count; ++i)
4171 {
4172 struct d3d10_effect_variable *v = &e->object_variables[i];
4173
4174 v->effect = e;
4175 v->ID3D10EffectVariable_iface.lpVtbl = &d3d10_effect_variable_vtbl;
4176 v->buffer = &null_local_buffer;
4177
4179 return hr;
4180 }
4181
4182 for (i = 0; i < e->shared_buffer_count; ++i)
4183 {
4184 struct d3d10_effect_variable b = {{ 0 }};
4185
4186 b.effect = e;
4187
4189 {
4191 return hr;
4192 }
4193
4196 if (FAILED(hr)) return hr;
4197 }
4198
4199 for (i = 0; i < e->shared_object_count; ++i)
4200 {
4201 struct d3d10_effect_variable o = {{ 0 }};
4202
4203 o.effect = e;
4204
4206 {
4208 return hr;
4209 }
4210
4213 if (FAILED(hr)) return hr;
4214 }
4215
4216 for (i = 0; i < e->technique_count; ++i)
4217 {
4218 struct d3d10_effect_technique *t = &e->techniques[i];
4219
4220 t->ID3D10EffectTechnique_iface.lpVtbl = &d3d10_effect_technique_vtbl;
4221 t->effect = e;
4222
4223 if (FAILED(hr = parse_fx10_technique(data, data_size, &ptr, t)))
4224 return hr;
4225 }
4226
4227 return S_OK;
4228}
4229
4230static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, size_t data_size)
4231{
4232 const char *ptr = data;
4234
4235 if (!require_space(0, 19, sizeof(uint32_t), data_size))
4236 {
4237 WARN("Invalid data size %#Ix.\n", data_size);
4238 return E_INVALIDARG;
4239 }
4240
4241 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
4242 e->version = read_u32(&ptr);
4243 TRACE("Target: %#x.\n", e->version);
4244
4245 e->local_buffer_count = read_u32(&ptr);
4246 TRACE("Local buffer count: %u.\n", e->local_buffer_count);
4247
4248 e->numeric_variable_count = read_u32(&ptr);
4249 TRACE("Numeric variable count: %u.\n", e->numeric_variable_count);
4250
4251 e->object_count = read_u32(&ptr);
4252 TRACE("Object count: %u.\n", e->object_count);
4253
4254 e->shared_buffer_count = read_u32(&ptr);
4255 TRACE("Pool buffer count: %u.\n", e->shared_buffer_count);
4256
4257 unused = read_u32(&ptr);
4258 TRACE("Pool variable count: %u.\n", unused);
4259
4260 e->shared_object_count = read_u32(&ptr);
4261 TRACE("Pool objects count: %u.\n", e->shared_object_count);
4262
4263 e->technique_count = read_u32(&ptr);
4264 TRACE("Technique count: %u.\n", e->technique_count);
4265
4266 e->index_offset = read_u32(&ptr);
4267 TRACE("Index offset: %#x.\n", e->index_offset);
4268
4269 unused = read_u32(&ptr);
4270 TRACE("String count: %u.\n", unused);
4271
4272 e->texture_count = read_u32(&ptr);
4273 TRACE("Texture count: %u.\n", e->texture_count);
4274
4275 e->ds_states.count = read_u32(&ptr);
4276 TRACE("Depthstencilstate count: %u.\n", e->ds_states.count);
4277
4278 e->blend_states.count = read_u32(&ptr);
4279 TRACE("Blendstate count: %u.\n", e->blend_states.count);
4280
4281 e->rs_states.count = read_u32(&ptr);
4282 TRACE("Rasterizerstate count: %u.\n", e->rs_states.count);
4283
4284 e->samplers.count = read_u32(&ptr);
4285 TRACE("Samplerstate count: %u.\n", e->samplers.count);
4286
4287 e->rtvs.count = read_u32(&ptr);
4288 TRACE("Rendertargetview count: %u.\n", e->rtvs.count);
4289
4290 e->dsvs.count = read_u32(&ptr);
4291 TRACE("Depthstencilview count: %u.\n", e->dsvs.count);
4292
4293 e->shaders.count = read_u32(&ptr);
4294 TRACE("Used shader count: %u.\n", e->shaders.count);
4295
4296 e->anonymous_shader_count = read_u32(&ptr);
4297 TRACE("Anonymous shader count: %u.\n", e->anonymous_shader_count);
4298
4299 if (!e->pool && (e->shared_object_count || e->shared_buffer_count))
4300 {
4301 WARN("Effect requires a pool to load.\n");
4302 return E_FAIL;
4303 }
4304
4305 return parse_fx10_body(e, ptr, data_size - (ptr - data));
4306}
4307
4309{
4310 const struct vkd3d_shader_code dxbc = {.code = data, .size = data_size};
4312 struct vkd3d_shader_dxbc_desc dxbc_desc;
4313 HRESULT hr = S_OK;
4314 unsigned int i;
4315 int ret;
4316
4317 if ((ret = vkd3d_shader_parse_dxbc(&dxbc, 0, &dxbc_desc, NULL)) < 0)
4318 {
4319 WARN("Failed to parse DXBC, ret %d.\n", ret);
4320 return E_FAIL;
4321 }
4322
4323 for (i = 0; i < dxbc_desc.section_count; ++i)
4324 {
4325 section = &dxbc_desc.sections[i];
4326
4327 TRACE("Section %u: tag %s, data {%p, %#Ix}.\n",
4328 i, debugstr_fourcc(section->tag),
4329 section->data.code, section->data.size);
4330
4331 if (section->tag != TAG_FX10)
4332 {
4333 FIXME("Unhandled chunk %s.\n", debugstr_fourcc(section->tag));
4334 continue;
4335 }
4336
4337 if (FAILED(hr = parse_fx10(effect, section->data.code, section->data.size)))
4338 break;
4339 }
4340
4341 vkd3d_shader_free_dxbc(&dxbc_desc);
4342
4343 return hr;
4344}
4345
4348{
4349 if (s->reflection)
4350 s->reflection->lpVtbl->Release(s->reflection);
4351 if (s->input_signature)
4352 ID3D10Blob_Release(s->input_signature);
4353 if (s->bytecode)
4354 ID3D10Blob_Release(s->bytecode);
4355
4356 switch (type)
4357 {
4361 if (s->shader.object)
4362 IUnknown_Release(s->shader.object);
4363 break;
4364
4365 default:
4366 FIXME("Unhandled shader type %s.\n", debug_d3d10_shader_variable_type(type));
4367 break;
4368 }
4369
4370 if (s->resource_count)
4371 free(s->resources);
4372}
4373
4375{
4376 unsigned int i;
4377
4378 if (!a->elements) return;
4379
4380 for (i = 0; i < a->count; ++i)
4381 d3d10_effect_variable_destroy(&a->elements[i]);
4382 free(a->elements);
4383 a->elements = NULL;
4384 a->count = 0;
4385}
4386
4388{
4389 unsigned int i, elem_count;
4390
4391 TRACE("variable %p.\n", v);
4392
4393 free(v->name);
4394 free(v->semantic);
4395 d3d10_effect_annotations_destroy(&v->annotations);
4396
4397 if (v->members)
4398 {
4399 for (i = 0; i < v->type->member_count; ++i)
4400 {
4401 d3d10_effect_variable_destroy(&v->members[i]);
4402 }
4403 free(v->members);
4404 }
4405
4406 if (v->elements)
4407 {
4408 for (i = 0; i < v->type->element_count; ++i)
4409 {
4410 d3d10_effect_variable_destroy(&v->elements[i]);
4411 }
4412 free(v->elements);
4413 }
4414
4415 if (v->type)
4416 {
4417 switch (v->type->basetype)
4418 {
4422 d3d10_effect_shader_variable_destroy(&v->u.shader, v->type->basetype);
4423 break;
4424
4426 case D3D10_SVT_BLEND:
4428 case D3D10_SVT_SAMPLER:
4429 if (v->u.state.object.object)
4430 IUnknown_Release(v->u.state.object.object);
4431 d3d10_effect_clear_prop_dependencies(&v->u.state.dependencies);
4432 break;
4433
4442 if (!v->u.resource.parent)
4443 break;
4444
4445 if (!v->type->element_count)
4446 elem_count = 1;
4447 else
4448 elem_count = v->type->element_count;
4449
4450 for (i = 0; i < elem_count; ++i)
4451 {
4452 if (v->u.resource.srv[i])
4453 ID3D10ShaderResourceView_Release(v->u.resource.srv[i]);
4454 }
4455
4456 free(v->u.resource.srv);
4457 break;
4458
4459 case D3D10_SVT_STRING:
4460 free(v->u.buffer.local_buffer);
4461 break;
4462
4463 default:
4464 break;
4465 }
4466 }
4467}
4468
4470{
4471 TRACE("pass %p\n", p);
4472
4473 free(p->name);
4474 d3d10_effect_annotations_destroy(&p->annotations);
4476}
4477
4479{
4480 unsigned int i;
4481
4482 TRACE("technique %p\n", t);
4483
4484 free(t->name);
4485 if (t->passes)
4486 {
4487 for (i = 0; i < t->pass_count; ++i)
4488 {
4489 d3d10_effect_pass_destroy(&t->passes[i]);
4490 }
4491 free(t->passes);
4492 }
4493
4494 d3d10_effect_annotations_destroy(&t->annotations);
4495}
4496
4498{
4499 unsigned int i;
4500
4501 TRACE("local buffer %p.\n", l);
4502
4503 free(l->name);
4504 if (l->members)
4505 {
4506 for (i = 0; i < l->type->member_count; ++i)
4507 {
4508 d3d10_effect_variable_destroy(&l->members[i]);
4509 }
4510 free(l->members);
4511 }
4512
4513 if (l->type)
4514 d3d10_effect_type_destroy(&l->type->entry, NULL);
4515
4516 d3d10_effect_annotations_destroy(&l->annotations);
4517 free(l->u.buffer.local_buffer);
4518
4519 if (l->u.buffer.buffer)
4520 ID3D10Buffer_Release(l->u.buffer.buffer);
4521 if (l->u.buffer.resource_view)
4522 ID3D10ShaderResourceView_Release(l->u.buffer.resource_view);
4523}
4524
4525/* IUnknown methods */
4526
4528{
4529 return CONTAINING_RECORD(iface, struct d3d10_effect, ID3D10Effect_iface);
4530}
4531
4533{
4534 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
4535
4536 if (IsEqualGUID(riid, &IID_ID3D10Effect)
4538 {
4539 IUnknown_AddRef(iface);
4540 *object = iface;
4541 return S_OK;
4542 }
4543
4544 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
4545
4546 *object = NULL;
4547 return E_NOINTERFACE;
4548}
4549
4551{
4552 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
4554
4555 TRACE("%p increasing refcount to %lu.\n", This, refcount);
4556
4557 return refcount;
4558}
4559
4561{
4562 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
4564
4565 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
4566
4567 if (!refcount)
4568 {
4569 unsigned int i;
4570
4571 if (effect->techniques)
4572 {
4573 for (i = 0; i < effect->technique_count; ++i)
4574 {
4576 }
4577 free(effect->techniques);
4578 }
4579
4580 if (effect->object_variables)
4581 {
4582 for (i = 0; i < effect->object_count; ++i)
4583 {
4585 }
4586 free(effect->object_variables);
4587 }
4588
4589 if (effect->local_buffers)
4590 {
4591 for (i = 0; i < effect->local_buffer_count; ++i)
4592 {
4594 }
4595 free(effect->local_buffers);
4596 }
4597
4598 if (effect->anonymous_shaders)
4599 {
4600 for (i = 0; i < effect->anonymous_shader_count; ++i)
4601 {
4603 free(effect->anonymous_shaders[i].type.name);
4604 }
4605 free(effect->anonymous_shaders);
4606 }
4607
4608 free(effect->shaders.v);
4609 free(effect->samplers.v);
4610 free(effect->rtvs.v);
4611 free(effect->dsvs.v);
4612 free(effect->blend_states.v);
4613 free(effect->ds_states.v);
4614 free(effect->rs_states.v);
4615
4617
4618 if (effect->pool)
4619 IUnknown_Release(&effect->pool->ID3D10Effect_iface);
4620 ID3D10Device_Release(effect->device);
4621 free(effect);
4622 }
4623
4624 return refcount;
4625}
4626
4627/* ID3D10Effect methods */
4628
4630{
4631 FIXME("iface %p stub!\n", iface);
4632
4633 return FALSE;
4634}
4635
4637{
4638 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
4639
4640 TRACE("iface %p.\n", iface);
4641
4642 return effect->ID3D10Effect_iface.lpVtbl == &d3d10_effect_pool_effect_vtbl;
4643}
4644
4646{
4647 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
4648
4649 TRACE("iface %p, device %p\n", iface, device);
4650
4651 ID3D10Device_AddRef(This->device);
4652 *device = This->device;
4653
4654 return S_OK;
4655}
4656
4658{
4659 desc->IsChildEffect = !!effect->pool;
4660 desc->ConstantBuffers = effect->local_buffer_count;
4661 desc->SharedConstantBuffers = 0;
4662 desc->GlobalVariables = effect->object_count + effect->numeric_variable_count;
4663 desc->SharedGlobalVariables = 0;
4664 desc->Techniques = effect->technique_count;
4665}
4666
4668{
4669 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
4670 D3D10_EFFECT_DESC pool_desc = { 0 };
4671
4672 TRACE("iface %p, desc %p.\n", iface, desc);
4673
4674 if (!desc)
4675 return E_INVALIDARG;
4676
4677 if (effect->pool)
4678 d3d10_effect_get_desc(effect->pool, &pool_desc);
4679
4680 d3d10_effect_get_desc(effect, desc);
4681
4682 desc->SharedConstantBuffers = pool_desc.ConstantBuffers;
4683 desc->SharedGlobalVariables = pool_desc.GlobalVariables;
4684
4685 return S_OK;
4686}
4687
4689 unsigned int index)
4690{
4691 if (index < effect->local_buffer_count)
4692 return &effect->local_buffers[index];
4693 index -= effect->local_buffer_count;
4694
4695 return effect->pool ? d3d10_effect_get_buffer_by_index(effect->pool, index) : NULL;
4696}
4697
4699{
4700 return !!(v->flag & D3D10_EFFECT_VARIABLE_POOLED);
4701}
4702
4704 UINT index)
4705{
4706 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
4707 struct d3d10_effect_variable *v;
4708
4709 TRACE("iface %p, index %u\n", iface, index);
4710
4712 {
4713 TRACE("Returning %sbuffer %p, name %s.\n", is_var_shared(v) ? "shared " : "", v,
4714 debugstr_a(v->name));
4715 return (ID3D10EffectConstantBuffer *)&v->ID3D10EffectVariable_iface;
4716 }
4717
4718 WARN("Invalid index specified\n");
4719
4720 return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface;
4721}
4722
4724 const char *name)
4725{
4726 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
4727 struct d3d10_effect_variable *v;
4728
4729 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
4730
4732 {
4733 TRACE("Returning %sbuffer %p.\n", is_var_shared(v) ? "shared " : "", v);
4734 return (ID3D10EffectConstantBuffer *)&v->ID3D10EffectVariable_iface;
4735 }
4736
4737 WARN("Invalid name specified\n");
4738
4739 return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface;
4740}
4741
4743 const struct d3d10_effect *effect, unsigned int index)
4744{
4745 unsigned int i;
4746
4747 for (i = 0; i < effect->local_buffer_count; ++i)
4748 {
4749 struct d3d10_effect_variable *v = &effect->local_buffers[i];
4750 if (index < v->type->member_count)
4751 return &v->members[index];
4752 index -= v->type->member_count;
4753 }
4754
4755 if (index < effect->object_count)
4756 return &effect->object_variables[index];
4757 index -= effect->object_count;
4758
4760}
4761
4763{
4764 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
4765 struct d3d10_effect_variable *v;
4766
4767 TRACE("iface %p, index %u\n", iface, index);
4768
4770 {
4771 TRACE("Returning %svariable %s.\n", is_var_shared(v) ? "shared " : "", debugstr_a(v->name));
4772 return &v->ID3D10EffectVariable_iface;
4773 }
4774
4775 WARN("Invalid index specified\n");
4776
4777 return &null_variable.ID3D10EffectVariable_iface;
4778}
4779
4781 const char *name)
4782{
4783 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
4784 struct d3d10_effect_variable *v;
4785
4786 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
4787
4788 if (!name)
4789 {
4790 WARN("Invalid name specified\n");
4791 return &null_variable.ID3D10EffectVariable_iface;
4792 }
4793
4795 {
4796 TRACE("Returning %svariable %p.\n", is_var_shared(v) ? "shared " : "", v);
4797 return &v->ID3D10EffectVariable_iface;
4798 }
4799
4800 WARN("Invalid name specified\n");
4801
4802 return &null_variable.ID3D10EffectVariable_iface;
4803}
4804
4806 const struct d3d10_effect *effect, const char *semantic)
4807{
4808 unsigned int i;
4809
4810 for (i = 0; i < effect->local_buffer_count; ++i)
4811 {
4812 struct d3d10_effect_variable *l = &effect->local_buffers[i];
4813 unsigned int j;
4814
4815 for (j = 0; j < l->type->member_count; ++j)
4816 {
4817 struct d3d10_effect_variable *v = &l->members[j];
4818
4819 if (v->semantic && !stricmp(v->semantic, semantic))
4820 return v;
4821 }
4822 }
4823
4824 for (i = 0; i < effect->object_count; ++i)
4825 {
4826 struct d3d10_effect_variable *v = &effect->object_variables[i];
4827
4828 if (v->semantic && !stricmp(v->semantic, semantic))
4829 return v;
4830 }
4831
4833}
4834
4836 const char *semantic)
4837{
4838 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
4839 struct d3d10_effect_variable *v;
4840
4841 TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
4842
4843 if (!semantic)
4844 {
4845 WARN("Invalid semantic specified\n");
4846 return &null_variable.ID3D10EffectVariable_iface;
4847 }
4848
4850 {
4851 TRACE("Returning %svariable %s.\n", is_var_shared(v) ? "shared " : "", debugstr_a(v->name));
4852 return &v->ID3D10EffectVariable_iface;
4853 }
4854
4855 WARN("Invalid semantic specified\n");
4856
4857 return &null_variable.ID3D10EffectVariable_iface;
4858}
4859
4861 UINT index)
4862{
4863 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
4864 struct d3d10_effect_technique *t;
4865
4866 TRACE("iface %p, index %u\n", iface, index);
4867
4868 if (index >= This->technique_count)
4869 {
4870 WARN("Invalid index specified\n");
4871 return &null_technique.ID3D10EffectTechnique_iface;
4872 }
4873
4874 t = &This->techniques[index];
4875
4876 TRACE("Returning technique %p, %s.\n", t, debugstr_a(t->name));
4877
4878 return &t->ID3D10EffectTechnique_iface;
4879}
4880
4882 const char *name)
4883{
4884 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
4885 unsigned int i;
4886
4887 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
4888
4889 if (!name)
4890 {
4891 WARN("Invalid name specified\n");
4892 return &null_technique.ID3D10EffectTechnique_iface;
4893 }
4894
4895 for (i = 0; i < This->technique_count; ++i)
4896 {
4897 struct d3d10_effect_technique *t = &This->techniques[i];
4898 if (t->name && !strcmp(t->name, name))
4899 {
4900 TRACE("Returning technique %p\n", t);
4901 return &t->ID3D10EffectTechnique_iface;
4902 }
4903 }
4904
4905 WARN("Invalid name specified\n");
4906
4907 return &null_technique.ID3D10EffectTechnique_iface;
4908}
4909
4911{
4912 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
4913 struct d3d10_effect_variable *v;
4914 unsigned int i, j;
4915
4916 FIXME("iface %p semi-stub!\n", iface);
4917
4918 if (effect->flags & D3D10_EFFECT_OPTIMIZED)
4919 return S_OK;
4920
4921 for (i = 0; i < effect->shaders.count; ++i)
4922 {
4923 v = effect->shaders.v[i];
4924
4925 if (v->u.shader.reflection)
4926 {
4927 v->u.shader.reflection->lpVtbl->Release(v->u.shader.reflection);
4928 v->u.shader.reflection = NULL;
4929 }
4930 if (v->u.shader.bytecode)
4931 {
4932 ID3D10Blob_Release(v->u.shader.bytecode);
4933 v->u.shader.bytecode = NULL;
4934 }
4935 free(v->u.shader.stream_output_declaration);
4936 v->u.shader.stream_output_declaration = NULL;
4937 }
4938
4939 for (i = 0; i < effect->technique_count; ++i)
4940 {
4941 for (j = 0; j < effect->techniques[i].pass_count; ++j)
4942 {
4943 free(effect->techniques[i].passes[j].name);
4944 effect->techniques[i].passes[j].name = NULL;
4945 }
4946
4947 free(effect->techniques[i].name);
4948 effect->techniques[i].name = NULL;
4949 }
4950
4952
4953 return S_OK;
4954}
4955
4957{
4958 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
4959
4960 TRACE("iface %p.\n", iface);
4961
4962 return !!(effect->flags & D3D10_EFFECT_OPTIMIZED);
4963}
4964
4965static const struct ID3D10EffectVtbl d3d10_effect_vtbl =
4966{
4967 /* IUnknown methods */
4971 /* ID3D10Effect methods */
4985};
4986
4987/* ID3D10EffectTechnique methods */
4988
4990{
4992}
4993
4995{
4997
4998 TRACE("iface %p\n", iface);
4999
5000 return This != &null_technique;
5001}
5002
5005{
5007
5008 TRACE("iface %p, desc %p\n", iface, desc);
5009
5010 if (tech == &null_technique)
5011 {
5012 WARN("Null technique specified\n");
5013 return E_FAIL;
5014 }
5015
5016 if (!desc)
5017 {
5018 WARN("Invalid argument specified\n");
5019 return E_INVALIDARG;
5020 }
5021
5022 desc->Name = tech->name;
5023 desc->Passes = tech->pass_count;
5024 desc->Annotations = tech->annotations.count;
5025
5026 return S_OK;
5027}
5028
5030 unsigned int index)
5031{
5032 struct d3d10_effect_variable *a;
5033
5034 if (index >= annotations->count)
5035 {
5036 WARN("Invalid index specified\n");
5037 return &null_variable.ID3D10EffectVariable_iface;
5038 }
5039
5040 a = &annotations->elements[index];
5041
5042 TRACE("Returning annotation %p, name %s.\n", a, debugstr_a(a->name));
5043
5044 return &a->ID3D10EffectVariable_iface;
5045}
5046
5048 const char *name)
5049{
5050 unsigned int i;
5051
5052 for (i = 0; i < annotations->count; ++i)
5053 {
5054 struct d3d10_effect_variable *a = &annotations->elements[i];
5055 if (a->name && !strcmp(a->name, name))
5056 {
5057 TRACE("Returning annotation %p.\n", a);
5058 return &a->ID3D10EffectVariable_iface;
5059 }
5060 }
5061
5062 WARN("Invalid name specified.\n");
5063
5064 return &null_variable.ID3D10EffectVariable_iface;
5065}
5066
5069{
5071
5072 TRACE("iface %p, index %u\n", iface, index);
5073
5075}
5076
5078 ID3D10EffectTechnique *iface, const char *name)
5079{
5081
5082 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
5083
5085}
5086
5088 UINT index)
5089{
5091 struct d3d10_effect_pass *p;
5092
5093 TRACE("iface %p, index %u\n", iface, index);
5094
5095 if (index >= This->pass_count)
5096 {
5097 WARN("Invalid index specified\n");
5098 return &null_pass.ID3D10EffectPass_iface;
5099 }
5100
5101 p = &This->passes[index];
5102
5103 TRACE("Returning pass %p, %s.\n", p, debugstr_a(p->name));
5104
5105 return &p->ID3D10EffectPass_iface;
5106}
5107
5109 const char *name)
5110{
5112 unsigned int i;
5113
5114 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
5115
5116 /* Do not check for name==NULL, W7/DX10 crashes in that case. */
5117
5118 for (i = 0; i < This->pass_count; ++i)
5119 {
5120 struct d3d10_effect_pass *p = &This->passes[i];
5121 if (p->name && !strcmp(p->name, name))
5122 {
5123 TRACE("Returning pass %p\n", p);
5124 return &p->ID3D10EffectPass_iface;
5125 }
5126 }
5127
5128 WARN("Invalid name specified\n");
5129
5130 return &null_pass.ID3D10EffectPass_iface;
5131}
5132
5135{
5136 FIXME("iface %p,mask %p stub!\n", iface, mask);
5137
5138 return E_NOTIMPL;
5139}
5140
5141static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl =
5142{
5143 /* ID3D10EffectTechnique methods */
5151};
5152
5153/* ID3D10EffectPass methods */
5154
5156{
5158}
5159
5161{
5163
5164 TRACE("iface %p\n", iface);
5165
5166 return This != &null_pass;
5167}
5168
5171{
5173 struct d3d10_effect_variable *vs;
5174 ID3D10Blob *input_signature;
5175
5176 TRACE("iface %p, desc %p.\n", iface, desc);
5177
5178 if (pass == &null_pass)
5179 {
5180 WARN("Null pass specified\n");
5181 return E_FAIL;
5182 }
5183
5184 if (!desc)
5185 {
5186 WARN("Invalid argument specified\n");
5187 return E_INVALIDARG;
5188 }
5189
5191
5192 vs = d3d10_array_get_element(pass->vs.shader, pass->vs.index);
5193 input_signature = vs->u.shader.input_signature;
5194
5195 desc->Name = pass->name;
5196 desc->Annotations = pass->annotations.count;
5197 if (input_signature)
5198 {
5199 desc->pIAInputSignature = ID3D10Blob_GetBufferPointer(input_signature);
5200 desc->IAInputSignatureSize = ID3D10Blob_GetBufferSize(input_signature);
5201 }
5202 else
5203 {
5204 desc->pIAInputSignature = NULL;
5205 desc->IAInputSignatureSize = 0;
5206 }
5207 desc->StencilRef = pass->stencil_ref;
5208 desc->SampleMask = pass->sample_mask;
5209 memcpy(desc->BlendFactor, pass->blend_factor, 4 * sizeof(float));
5210
5211 return S_OK;
5212}
5213
5216{
5218
5219 TRACE("iface %p, desc %p.\n", iface, desc);
5220
5221 if (pass == &null_pass)
5222 {
5223 WARN("Null pass specified.\n");
5224 return E_FAIL;
5225 }
5226
5227 if (!desc)
5228 {
5229 WARN("Invalid argument specified.\n");
5230 return E_INVALIDARG;
5231 }
5232
5234
5235 desc->pShaderVariable = (ID3D10EffectShaderVariable *)&pass->vs.shader->ID3D10EffectVariable_iface;
5236 desc->ShaderIndex = pass->vs.index;
5237
5238 return S_OK;
5239}
5240
5243{
5245
5246 TRACE("iface %p, desc %p.\n", iface, desc);
5247
5248 if (pass == &null_pass)
5249 {
5250 WARN("Null pass specified.\n");
5251 return E_FAIL;
5252 }
5253
5254 if (!desc)
5255 {
5256 WARN("Invalid argument specified.\n");
5257 return E_INVALIDARG;
5258 }
5259
5261
5262 desc->pShaderVariable = (ID3D10EffectShaderVariable *)&pass->gs.shader->ID3D10EffectVariable_iface;
5263 desc->ShaderIndex = pass->gs.index;
5264
5265 return S_OK;
5266}
5267
5270{
5272
5273 TRACE("iface %p, desc %p.\n", iface, desc);
5274
5275 if (pass == &null_pass)
5276 {
5277 WARN("Null pass specified.\n");
5278 return E_FAIL;
5279 }
5280
5281 if (!desc)
5282 {
5283 WARN("Invalid argument specified.\n");
5284 return E_INVALIDARG;
5285 }
5286
5288
5289 desc->pShaderVariable = (ID3D10EffectShaderVariable *)&pass->ps.shader->ID3D10EffectVariable_iface;
5290 desc->ShaderIndex = pass->ps.index;
5291
5292 return S_OK;
5293}
5294
5296 UINT index)
5297{
5299
5300 TRACE("iface %p, index %u\n", iface, index);
5301
5302 return d3d10_annotation_get_by_index(&pass->annotations, index);
5303}
5304
5306 const char *name)
5307{
5309
5310 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
5311
5312 return d3d10_annotation_get_by_name(&pass->annotations, name);
5313}
5314
5316{
5317 struct d3d10_effect_buffer_variable *b = &v->u.buffer;
5318
5319 if (!b->changed)
5320 return;
5321
5322 ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)b->buffer, 0, NULL,
5323 b->local_buffer, v->data_size, 0);
5324
5325 b->changed = FALSE;
5326}
5327
5329 struct d3d10_effect_variable *v, unsigned int bind_point)
5330{
5331 switch (shader_type)
5332 {
5334 ID3D10Device_VSSetSamplers(device, bind_point, 1, &v->u.state.object.sampler);
5335 break;
5336
5338 ID3D10Device_PSSetSamplers(device, bind_point, 1, &v->u.state.object.sampler);
5339 break;
5340
5342 ID3D10Device_GSSetSamplers(device, bind_point, 1, &v->u.state.object.sampler);
5343 break;
5344
5345 default:
5346 WARN("Incorrect shader type to bind sampler.\n");
5347 break;
5348 }
5349}
5350
5352{
5353 struct d3d10_effect_shader_variable *sv = &v->u.shader;
5355 struct d3d10_effect_variable *rsrc_v;
5357 unsigned int i, j;
5358
5359 for (i = 0; i < sv->resource_count; ++i)
5360 {
5361 sr = &sv->resources[i];
5362 rsrc_v = sr->variable;
5363
5364 switch (sr->in_type)
5365 {
5366 case D3D10_SIT_CBUFFER:
5367 update_buffer(device, rsrc_v);
5368 switch (v->type->basetype)
5369 {
5371 ID3D10Device_VSSetConstantBuffers(device, sr->bind_point, 1,
5372 &rsrc_v->u.buffer.buffer);
5373 break;
5374
5376 ID3D10Device_PSSetConstantBuffers(device, sr->bind_point, 1,
5377 &rsrc_v->u.buffer.buffer);
5378 break;
5379
5381 ID3D10Device_GSSetConstantBuffers(device, sr->bind_point, 1,
5382 &rsrc_v->u.buffer.buffer);
5383 break;
5384
5385 default:
5386 WARN("Incorrect shader type to bind constant buffer.\n");
5387 break;
5388 }
5389 break;
5390
5391 case D3D10_SIT_TEXTURE:
5392
5393 if (rsrc_v->type->basetype == D3D10_SVT_SAMPLER)
5394 {
5395 TRACE("Using texture associated with sampler %s.\n", debugstr_a(rsrc_v->name));
5396 rsrc_v = rsrc_v->u.state.desc.sampler.texture;
5397 }
5398
5399 /* fallthrough */
5400 case D3D10_SIT_TBUFFER:
5401
5402 if (sr->in_type == D3D10_SIT_TBUFFER)
5403 {
5404 update_buffer(device, rsrc_v);
5405 srv = &rsrc_v->u.buffer.resource_view;
5406 }
5407 else
5408 srv = rsrc_v->u.resource.srv;
5409
5410 switch (v->type->basetype)
5411 {
5413 ID3D10Device_VSSetShaderResources(device, sr->bind_point, sr->bind_count, srv);
5414 break;
5415
5417 ID3D10Device_PSSetShaderResources(device, sr->bind_point, sr->bind_count, srv);
5418 break;
5419
5421 ID3D10Device_GSSetShaderResources(device, sr->bind_point, sr->bind_count, srv);
5422 break;
5423
5424 default:
5425 WARN("Incorrect shader type to bind shader resource view.\n");
5426 break;
5427 }
5428 break;
5429
5430 case D3D10_SIT_SAMPLER:
5431 if (!rsrc_v->type->element_count)
5432 {
5433 set_sampler(device, v->type->basetype, rsrc_v, sr->bind_point);
5434 break;
5435 }
5436
5437 for (j = 0; j < sr->bind_count; ++j)
5438 set_sampler(device, v->type->basetype, &rsrc_v->elements[j], sr->bind_point + j);
5439 break;
5440
5441 default:
5442 WARN("Unhandled shader resource %#x.\n", sr->in_type);
5443 break;
5444 }
5445 }
5446}
5447
5449 const struct d3d10_effect_pass_shader_desc *shader_desc)
5450{
5451 ID3D10Device *device = pass->technique->effect->device;
5452 struct d3d10_effect_variable *v;
5453
5454 v = d3d10_array_get_element(shader_desc->shader, shader_desc->index);
5455
5456 switch (v->type->basetype)
5457 {
5459 ID3D10Device_VSSetShader(device, v->u.shader.shader.vs);
5460 break;
5462 ID3D10Device_PSSetShader(device, v->u.shader.shader.ps);
5463 break;
5465 ID3D10Device_GSSetShader(device, v->u.shader.shader.gs);
5466 break;
5467 default:
5468 WARN("Unexpected shader type %u.\n", v->type->basetype);
5469 }
5470
5472}
5473
5475{
5477 ID3D10Device *device = pass->technique->effect->device;
5478
5479 TRACE("iface %p, flags %#x\n", iface, flags);
5480
5481 if (flags) FIXME("Ignoring flags (%#x)\n", flags);
5482
5484
5485 if (pass->vs.shader != &null_shader_variable)
5487 if (pass->gs.shader != &null_shader_variable)
5489 if (pass->ps.shader != &null_shader_variable)
5491 if (pass->rasterizer)
5492 ID3D10Device_RSSetState(device, pass->rasterizer->u.state.object.rasterizer);
5493 if (pass->depth_stencil)
5494 ID3D10Device_OMSetDepthStencilState(device, pass->depth_stencil->u.state.object.depth_stencil,
5495 pass->stencil_ref);
5496 if (pass->blend)
5497 ID3D10Device_OMSetBlendState(device, pass->blend->u.state.object.blend,
5498 pass->blend_factor, pass->sample_mask);
5499
5500 return S_OK;
5501}
5502
5505{
5507
5508 FIXME("iface %p, mask %p semi-stub!\n", iface, mask);
5509
5510 if (pass->vs.shader != &null_shader_variable)
5512 if (pass->ps.shader != &null_shader_variable)
5514 if (pass->gs.shader != &null_shader_variable)
5516 if (pass->rasterizer)
5518 if (pass->depth_stencil)
5520 if (pass->blend)
5522
5523 return S_OK;
5524}
5525
5526static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl =
5527{
5528 /* ID3D10EffectPass methods */
5538};
5539
5540/* ID3D10EffectVariable methods */
5541
5543{
5544 TRACE("iface %p\n", iface);
5545
5547}
5548
5550{
5552
5553 TRACE("iface %p\n", iface);
5554
5555 return &This->type->ID3D10EffectType_iface;
5556}
5557
5560{
5562
5563 TRACE("iface %p, desc %p\n", iface, desc);
5564
5565 if (!iface->lpVtbl->IsValid(iface))
5566 {
5567 WARN("Null variable specified\n");
5568 return E_FAIL;
5569 }
5570
5571 if (!desc)
5572 {
5573 WARN("Invalid argument specified\n");
5574 return E_INVALIDARG;
5575 }
5576
5577 /* FIXME: This isn't correct. Anonymous shaders let desc->ExplicitBindPoint untouched, but normal shaders set it! */
5578 memset(desc, 0, sizeof(*desc));
5579 desc->Name = v->name;
5580 desc->Semantic = v->semantic;
5581 desc->Flags = v->flag;
5582 desc->Annotations = v->annotations.count;
5583 desc->BufferOffset = v->buffer_offset;
5584
5586 desc->ExplicitBindPoint = v->explicit_bind_point;
5587
5588 return S_OK;
5589}
5590
5593{
5595
5596 TRACE("iface %p, index %u\n", iface, index);
5597
5598 return d3d10_annotation_get_by_index(&var->annotations, index);
5599}
5600
5602 ID3D10EffectVariable *iface, const char *name)
5603{
5605
5606 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
5607
5608 return d3d10_annotation_get_by_name(&var->annotations, name);
5609}
5610
5613{
5615 struct d3d10_effect_variable *m;
5616
5617 TRACE("iface %p, index %u\n", iface, index);
5618
5619 if (index >= This->type->member_count)
5620 {
5621 WARN("Invalid index specified\n");
5622 return &null_variable.ID3D10EffectVariable_iface;
5623 }
5624
5625 m = &This->members[index];
5626
5627 TRACE("Returning member %p, %s\n", m, debugstr_a(m->name));
5628
5629 return &m->ID3D10EffectVariable_iface;
5630}
5631
5633 ID3D10EffectVariable *iface, const char *name)
5634{
5636 unsigned int i;
5637
5638 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
5639
5640 if (!name)
5641 {
5642 WARN("Invalid name specified\n");
5643 return &null_variable.ID3D10EffectVariable_iface;
5644 }
5645
5646 for (i = 0; i < This->type->member_count; ++i)
5647 {
5648 struct d3d10_effect_variable *m = &This->members[i];
5649
5650 if (m->name && !strcmp(m->name, name))
5651 {
5652 TRACE("Returning member %p\n", m);
5653 return &m->ID3D10EffectVariable_iface;
5654 }
5655 }
5656
5657 WARN("Invalid name specified\n");
5658
5659 return &null_variable.ID3D10EffectVariable_iface;
5660}
5661
5663 ID3D10EffectVariable *iface, const char *semantic)
5664{
5666 unsigned int i;
5667
5668 TRACE("iface %p, semantic %s.\n", iface, debugstr_a(semantic));
5669
5670 if (!semantic)
5671 {
5672 WARN("Invalid semantic specified\n");
5673 return &null_variable.ID3D10EffectVariable_iface;
5674 }
5675
5676 for (i = 0; i < This->type->member_count; ++i)
5677 {
5678 struct d3d10_effect_variable *m = &This->members[i];
5679
5680 if (m->semantic && !stricmp(m->semantic, semantic))
5681 {
5682 TRACE("Returning member %p\n", m);
5683 return &m->ID3D10EffectVariable_iface;
5684 }
5685 }
5686
5687 WARN("Invalid semantic specified\n");
5688
5689 return &null_variable.ID3D10EffectVariable_iface;
5690}
5691
5694{
5696 struct d3d10_effect_variable *v;
5697
5698 TRACE("iface %p, index %u\n", iface, index);
5699
5700 if (index >= This->type->element_count)
5701 {
5702 WARN("Invalid index specified\n");
5703 return &null_variable.ID3D10EffectVariable_iface;
5704 }
5705
5706 v = &This->elements[index];
5707
5708 TRACE("Returning element %p, %s\n", v, debugstr_a(v->name));
5709
5710 return &v->ID3D10EffectVariable_iface;
5711}
5712
5714 ID3D10EffectVariable *iface)
5715{
5717
5718 TRACE("iface %p\n", iface);
5719
5720 return (ID3D10EffectConstantBuffer *)&This->buffer->ID3D10EffectVariable_iface;
5721}
5722
5724 ID3D10EffectVariable *iface)
5725{
5727
5728 TRACE("iface %p\n", iface);
5729
5730 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl)
5731 return (ID3D10EffectScalarVariable *)&This->ID3D10EffectVariable_iface;
5732
5733 return (ID3D10EffectScalarVariable *)&null_scalar_variable.ID3D10EffectVariable_iface;
5734}
5735
5737 ID3D10EffectVariable *iface)
5738{
5740
5741 TRACE("iface %p\n", iface);
5742
5743 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl)
5744 return (ID3D10EffectVectorVariable *)&This->ID3D10EffectVariable_iface;
5745
5746 return (ID3D10EffectVectorVariable *)&null_vector_variable.ID3D10EffectVariable_iface;
5747}
5748
5750 ID3D10EffectVariable *iface)
5751{
5753
5754 TRACE("iface %p\n", iface);
5755
5756 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl)
5757 return (ID3D10EffectMatrixVariable *)&This->ID3D10EffectVariable_iface;
5758
5759 return (ID3D10EffectMatrixVariable *)&null_matrix_variable.ID3D10EffectVariable_iface;
5760}
5761
5763 ID3D10EffectVariable *iface)
5764{
5766
5767 TRACE("iface %p\n", iface);
5768
5769 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl)
5770 return (ID3D10EffectStringVariable *)&This->ID3D10EffectVariable_iface;
5771
5772 return (ID3D10EffectStringVariable *)&null_string_variable.ID3D10EffectVariable_iface;
5773}
5774
5776 ID3D10EffectVariable *iface)
5777{
5779
5780 TRACE("iface %p\n", iface);
5781
5782 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl)
5783 return (ID3D10EffectShaderResourceVariable *)&This->ID3D10EffectVariable_iface;
5784
5785 return (ID3D10EffectShaderResourceVariable *)&null_shader_resource_variable.ID3D10EffectVariable_iface;
5786}
5787
5789 ID3D10EffectVariable *iface)
5790{
5792
5793 TRACE("iface %p\n", iface);
5794
5795 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl)
5796 return (ID3D10EffectRenderTargetViewVariable *)&This->ID3D10EffectVariable_iface;
5797
5798 return (ID3D10EffectRenderTargetViewVariable *)&null_render_target_view_variable.ID3D10EffectVariable_iface;
5799}
5800
5802 ID3D10EffectVariable *iface)
5803{
5805
5806 TRACE("iface %p\n", iface);
5807
5808 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl)
5809 return (ID3D10EffectDepthStencilViewVariable *)&This->ID3D10EffectVariable_iface;
5810
5811 return (ID3D10EffectDepthStencilViewVariable *)&null_depth_stencil_view_variable.ID3D10EffectVariable_iface;
5812}
5813
5815 ID3D10EffectVariable *iface)
5816{
5818
5819 TRACE("iface %p\n", iface);
5820
5821 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl)
5822 return (ID3D10EffectConstantBuffer *)&This->ID3D10EffectVariable_iface;
5823
5824 return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface;
5825}
5826
5828 ID3D10EffectVariable *iface)
5829{
5831
5832 TRACE("iface %p\n", iface);
5833
5834 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl)
5835 return (ID3D10EffectShaderVariable *)&This->ID3D10EffectVariable_iface;
5836
5837 return (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface;
5838}
5839
5841{
5843
5844 TRACE("iface %p\n", iface);
5845
5846 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl)
5847 return (ID3D10EffectBlendVariable *)&This->ID3D10EffectVariable_iface;
5848
5849 return (ID3D10EffectBlendVariable *)&null_blend_variable.ID3D10EffectVariable_iface;
5850}
5851
5853 ID3D10EffectVariable *iface)
5854{
5856
5857 TRACE("iface %p\n", iface);
5858
5859 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl)
5860 return (ID3D10EffectDepthStencilVariable *)&This->ID3D10EffectVariable_iface;
5861
5862 return (ID3D10EffectDepthStencilVariable *)&null_depth_stencil_variable.ID3D10EffectVariable_iface;
5863}
5864
5866 ID3D10EffectVariable *iface)
5867{
5869
5870 TRACE("iface %p\n", iface);
5871
5872 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl)
5873 return (ID3D10EffectRasterizerVariable *)&This->ID3D10EffectVariable_iface;
5874
5875 return (ID3D10EffectRasterizerVariable *)&null_rasterizer_variable.ID3D10EffectVariable_iface;
5876}
5877
5879 ID3D10EffectVariable *iface)
5880{
5882
5883 TRACE("iface %p\n", iface);
5884
5885 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl)
5886 return (ID3D10EffectSamplerVariable *)&This->ID3D10EffectVariable_iface;
5887
5888 return (ID3D10EffectSamplerVariable *)&null_sampler_variable.ID3D10EffectVariable_iface;
5889}
5890
5892 void *data, UINT offset, UINT count)
5893{
5895 BOOL is_buffer;
5896
5897 TRACE("iface %p, data %p, offset %u, count %u.\n", iface, data, offset, count);
5898
5899 if (!iface->lpVtbl->IsValid(iface))
5900 {
5901 WARN("Invalid variable.\n");
5902 return E_FAIL;
5903 }
5904
5905 is_buffer = v->type->basetype == D3D10_SVT_CBUFFER || v->type->basetype == D3D10_SVT_TBUFFER;
5906
5907 if (v->type->type_class == D3D10_SVC_OBJECT && !is_buffer)
5908 {
5909 WARN("Not supported on object variables of type %s.\n",
5910 debug_d3d10_shader_variable_type(v->type->basetype));
5911 return D3DERR_INVALIDCALL;
5912 }
5913
5914 if (!is_buffer)
5915 {
5916 offset += v->buffer_offset;
5917 v = v->buffer;
5918 }
5919
5920 memcpy(v->u.buffer.local_buffer + offset, data, count);
5921 v->u.buffer.changed = TRUE;
5922
5923 return S_OK;
5924}
5925
5927 void *data, UINT offset, UINT count)
5928{
5930
5931 TRACE("iface %p, data %p, offset %u, count %u.\n", iface, data, offset, count);
5932
5933 if (!iface->lpVtbl->IsValid(iface))
5934 {
5935 WARN("Invalid variable.\n");
5936 return E_FAIL;
5937 }
5938
5940}
5941
5942static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl =
5943{
5944 /* ID3D10EffectVariable methods */
5970};
5971
5972/* ID3D10EffectVariable methods */
5974{
5976}
5977
5979{
5981
5982 TRACE("iface %p.\n", iface);
5983
5984 return v != &null_local_buffer;
5985}
5986
5988{
5990}
5991
5994{
5996}
5997
6000{
6002}
6003
6005 ID3D10EffectConstantBuffer *iface, const char *name)
6006{
6008}
6009
6012{
6014}
6015
6017 ID3D10EffectConstantBuffer *iface, const char *name)
6018{
6020}
6021
6023 ID3D10EffectConstantBuffer *iface, const char *semantic)
6024{
6026}
6027
6030{
6032}
6033
6036{
6038}
6039
6042{
6044}
6045
6048{
6050}
6051
6054{
6056}
6057
6060{
6062}
6063
6066{
6068}
6069
6072{
6074}
6075
6078{
6080}
6081
6084{
6086}
6087
6090{
6092}
6093
6095{
6097}
6098
6101{
6103}
6104
6107{
6109}
6110
6113{
6115}
6116
6118 void *data, UINT offset, UINT count)
6119{
6121}
6122
6124 void *data, UINT offset, UINT count)
6125{
6127}
6128
6129/* ID3D10EffectConstantBuffer methods */
6132{
6133 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
6134
6135 return E_NOTIMPL;
6136}
6137
6140{
6142
6143 TRACE("iface %p, buffer %p.\n", iface, buffer);
6144
6145 if (!iface->lpVtbl->IsValid(iface))
6146 {
6147 WARN("Null variable specified.\n");
6148 return E_FAIL;
6149 }
6150
6151 if (v->type->basetype != D3D10_SVT_CBUFFER)
6152 {
6153 WARN("Wrong variable type %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
6154 return D3DERR_INVALIDCALL;
6155 }
6156
6157 *buffer = v->u.buffer.buffer;
6158 ID3D10Buffer_AddRef(*buffer);
6159
6160 return S_OK;
6161}
6162
6165{
6166 FIXME("iface %p, view %p stub!\n", iface, view);
6167
6168 return E_NOTIMPL;
6169}
6170
6173{
6175
6176 FIXME("iface %p, view %p stub!\n", iface, view);
6177
6178 if (!iface->lpVtbl->IsValid(iface))
6179 {
6180 WARN("Null variable specified.\n");
6181 return E_FAIL;
6182 }
6183
6184 if (v->type->basetype != D3D10_SVT_TBUFFER)
6185 {
6186 WARN("Wrong variable type %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
6187 return D3DERR_INVALIDCALL;
6188 }
6189
6190 return E_NOTIMPL;
6191}
6192
6193static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl =
6194{
6195 /* ID3D10EffectVariable methods */
6221 /* ID3D10EffectConstantBuffer methods */
6226};
6227
6228
6229static BOOL get_value_as_bool(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_type)
6230{
6231 switch (src_type)
6232 {
6233 case D3D10_SVT_FLOAT:
6234 case D3D10_SVT_INT:
6235 case D3D10_SVT_UINT:
6236 case D3D10_SVT_BOOL:
6237 if (*(DWORD *)src_data)
6238 return -1;
6239 break;
6240
6241 default:
6242 break;
6243 }
6244
6245 return 0;
6246}
6247
6248static int get_value_as_int(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_type)
6249{
6250 switch (src_type)
6251 {
6252 case D3D10_SVT_FLOAT:
6253 return (int)(*(float *)src_data);
6254
6255 case D3D10_SVT_INT:
6256 case D3D10_SVT_UINT:
6257 return *(int *)src_data;
6258
6259 case D3D10_SVT_BOOL:
6260 return get_value_as_bool(src_data, src_type);
6261
6262 default:
6263 return 0;
6264 }
6265}
6266
6267static float get_value_as_float(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_type)
6268{
6269 switch (src_type)
6270 {
6271 case D3D10_SVT_FLOAT:
6272 return *(float *)src_data;
6273
6274 case D3D10_SVT_INT:
6275 case D3D10_SVT_UINT:
6276 return (float)(*(int *)src_data);
6277
6278 case D3D10_SVT_BOOL:
6279 return (float)get_value_as_bool(src_data, src_type);
6280
6281 default:
6282 return 0.0f;
6283 }
6284}
6285
6286static void get_vector_as_type(BYTE *dst_data, D3D_SHADER_VARIABLE_TYPE dst_type,
6287 BYTE *src_data, D3D_SHADER_VARIABLE_TYPE src_type, unsigned int count)
6288{
6289 DWORD *src_data_dword = (DWORD *)src_data;
6290 DWORD *dst_data_dword = (DWORD *)dst_data;
6291 unsigned int i;
6292
6293 for (i = 0; i < count; ++i, ++dst_data_dword, ++src_data_dword)
6294 {
6295 if (dst_type == src_type)
6296 *dst_data_dword = *src_data_dword;
6297 else
6298 {
6299 switch (dst_type)
6300 {
6301 case D3D10_SVT_FLOAT:
6302 *(float *)dst_data_dword = get_value_as_float(src_data_dword, src_type);
6303 break;
6304
6305 case D3D10_SVT_INT:
6306 case D3D10_SVT_UINT:
6307 *(int *)dst_data_dword = get_value_as_int(src_data_dword, src_type);
6308 break;
6309
6310 case D3D10_SVT_BOOL:
6311 *(BOOL *)dst_data_dword = get_value_as_bool(src_data_dword, src_type);
6312 break;
6313
6314 default:
6315 *dst_data_dword = 0;
6316 break;
6317 }
6318 }
6319 }
6320}
6321
6323 D3D_SHADER_VARIABLE_TYPE src_type)
6324{
6325 BYTE *dst = variable->buffer->u.buffer.local_buffer + variable->buffer_offset;
6326 D3D_SHADER_VARIABLE_TYPE dst_type = variable->type->basetype;
6327
6328 get_vector_as_type(dst, dst_type, src, src_type, variable->type->column_count);
6329
6330 variable->buffer->u.buffer.changed = TRUE;
6331}
6332
6334 D3D_SHADER_VARIABLE_TYPE src_type, unsigned int offset, unsigned int count)
6335{
6336 BYTE *dst = variable->buffer->u.buffer.local_buffer + variable->buffer_offset;
6337 D3D_SHADER_VARIABLE_TYPE dst_type = variable->type->basetype;
6338 unsigned int element_size, i;
6339 BYTE *cur_element = src;
6340
6341 if (!variable->type->element_count)
6342 {
6344 return;
6345 }
6346
6347 if (offset >= variable->type->element_count)
6348 {
6349 WARN("Offset %u larger than element count %u, ignoring.\n", offset, variable->type->element_count);
6350 return;
6351 }
6352
6353 if (count > variable->type->element_count - offset)
6354 {
6355 WARN("Offset %u, count %u overruns the variable (element count %u), fixing up.\n",
6356 offset, count, variable->type->element_count);
6357 count = variable->type->element_count - offset;
6358 }
6359
6360 element_size = variable->type->elementtype->size_packed;
6361 dst += variable->type->stride * offset;
6362
6363 for (i = 0; i < count; ++i)
6364 {
6365 get_vector_as_type(dst, dst_type, cur_element, src_type, variable->type->column_count);
6366
6367 cur_element += element_size;
6368 dst += variable->type->stride;
6369 }
6370
6371 variable->buffer->u.buffer.changed = TRUE;
6372}
6373
6375 D3D_SHADER_VARIABLE_TYPE dst_type)
6376{
6377 BYTE *src = variable->buffer->u.buffer.local_buffer + variable->buffer_offset;
6378 D3D_SHADER_VARIABLE_TYPE src_type = variable->type->basetype;
6379
6380 get_vector_as_type(dst, dst_type, src, src_type, variable->type->column_count);
6381}
6382
6384 D3D_SHADER_VARIABLE_TYPE dst_type, unsigned int offset, unsigned int count)
6385{
6386 BYTE *src = variable->buffer->u.buffer.local_buffer + variable->buffer_offset;
6387 D3D_SHADER_VARIABLE_TYPE src_type = variable->type->basetype;
6388 unsigned int element_size, i;
6389 BYTE *cur_element = dst;
6390
6391 if (!variable->type->element_count)
6392 {
6394 return;
6395 }
6396
6397 if (offset >= variable->type->element_count)
6398 {
6399 WARN("Offset %u larger than element count %u, ignoring.\n", offset, variable->type->element_count);
6400 return;
6401 }
6402
6403 if (count > variable->type->element_count - offset)
6404 {
6405 WARN("Offset %u, count %u overruns the variable (element count %u), fixing up.\n",
6406 offset, count, variable->type->element_count);
6407 count = variable->type->element_count - offset;
6408 }
6409
6410 element_size = variable->type->elementtype->size_packed;
6411 src += variable->type->stride * offset;
6412
6413 for (i = 0; i < count; ++i)
6414 {
6415 get_vector_as_type(cur_element, dst_type, src, src_type, variable->type->column_count);
6416
6417 cur_element += element_size;
6418 src += variable->type->stride;
6419 }
6420}
6421
6422/* ID3D10EffectVariable methods */
6423
6425{
6427}
6428
6430{
6432
6433 TRACE("iface %p\n", iface);
6434
6435 return v != &null_scalar_variable;
6436}
6437
6440{
6442}
6443
6446{
6448}
6449
6452{
6454}
6455
6457 ID3D10EffectScalarVariable *iface, const char *name)
6458{
6460}
6461
6464{
6466}
6467
6469 ID3D10EffectScalarVariable *iface, const char *name)
6470{
6472}
6473
6475 ID3D10EffectScalarVariable *iface, const char *semantic)
6476{
6478}
6479
6482{
6484}
6485
6488{
6490}
6491
6494{
6496}
6497
6500{
6502}
6503
6506{
6508}
6509
6512{
6514}
6515
6518{
6520}
6521
6524{
6526}
6527
6530{
6532}
6533
6536{
6538}
6539
6542{
6544}
6545
6548{
6550}
6551
6554{
6556}
6557
6560{
6562}
6563
6566{
6568}
6569
6571 void *data, UINT offset, UINT count)
6572{
6574}
6575
6577 void *data, UINT offset, UINT count)
6578{
6580}
6581
6582/* ID3D10EffectScalarVariable methods */
6583
6585 float value)
6586{
6588
6589 TRACE("iface %p, value %.8e.\n", iface, value);
6591
6592 return S_OK;
6593}
6594
6596 float *value)
6597{
6599
6600 TRACE("iface %p, value %p.\n", iface, value);
6602
6603 return S_OK;
6604}
6605
6606/* Tests show that offset is ignored for scalar variables. */
6608 float *values, UINT offset, UINT count)
6609{
6611
6612 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
6614
6615 return S_OK;
6616}
6617
6619 float *values, UINT offset, UINT count)
6620{
6622
6623 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
6625
6626 return S_OK;
6627}
6628
6630 int value)
6631{
6633
6634 TRACE("iface %p, value %d.\n", iface, value);
6636
6637 return S_OK;
6638}
6639
6641 int *value)
6642{
6644
6645 TRACE("iface %p, value %p.\n", iface, value);
6647
6648 return S_OK;
6649}
6650
6652 int *values, UINT offset, UINT count)
6653{
6655
6656 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
6658
6659 return S_OK;
6660}
6661
6663 int *values, UINT offset, UINT count)
6664{
6666
6667 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
6669
6670 return S_OK;
6671}
6672
6674 BOOL value)
6675{
6677
6678 TRACE("iface %p, value %d.\n", iface, value);
6680
6681 return S_OK;
6682}
6683
6685 BOOL *value)
6686{
6688
6689 TRACE("iface %p, value %p.\n", iface, value);
6691
6692 return S_OK;
6693}
6694
6697{
6699
6700 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
6702
6703 return S_OK;
6704}
6705
6708{
6710
6711 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
6713
6714 return S_OK;
6715}
6716
6717static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl =
6718{
6719 /* ID3D10EffectVariable methods */
6745 /* ID3D10EffectScalarVariable methods */
6758};
6759
6760/* ID3D10EffectVariable methods */
6761
6763{
6765}
6766
6768{
6770
6771 TRACE("iface %p\n", iface);
6772
6773 return v != &null_vector_variable;
6774}
6775
6778{
6780}
6781
6784{
6786}
6787
6790{
6792}
6793
6795 ID3D10EffectVectorVariable *iface, const char *name)
6796{
6798}
6799
6802{
6804}
6805
6807 ID3D10EffectVectorVariable *iface, const char *name)
6808{
6810}
6811
6813 ID3D10EffectVectorVariable *iface, const char *semantic)
6814{
6816}
6817
6820{
6822}
6823
6826{
6828}
6829
6832{
6834}
6835
6838{
6840}
6841
6844{
6846}
6847
6850{
6852}
6853
6856{
6858}
6859
6862{
6864}
6865
6868{
6870}
6871
6874{
6876}
6877
6880{
6882}
6883
6886{
6888}
6889
6892{
6894}
6895
6898{
6900}
6901
6904{
6906}
6907
6909 void *data, UINT offset, UINT count)
6910{
6912}
6913
6915 void *data, UINT offset, UINT count)
6916{
6918}
6919
6920/* ID3D10EffectVectorVariable methods */
6921
6923 BOOL *value)
6924{
6926
6927 TRACE("iface %p, value %p.\n", iface, value);
6929
6930 return S_OK;
6931}
6932
6934 int *value)
6935{
6937
6938 TRACE("iface %p, value %p.\n", iface, value);
6940
6941 return S_OK;
6942}
6943
6945 float *value)
6946{
6948
6949 TRACE("iface %p, value %p.\n", iface, value);
6951
6952 return S_OK;
6953}
6954
6956 BOOL *value)
6957{
6959
6960 TRACE("iface %p, value %p.\n", iface, value);
6962
6963 return S_OK;
6964}
6965
6967 int *value)
6968{
6970
6971 TRACE("iface %p, value %p.\n", iface, value);
6973
6974 return S_OK;
6975}
6976
6978 float *value)
6979{
6981
6982 TRACE("iface %p, value %p.\n", iface, value);
6984
6985 return S_OK;
6986}
6987
6990{
6992
6993 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
6995
6996 return S_OK;
6997}
6998
7000 int *values, UINT offset, UINT count)
7001{
7003
7004 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
7006
7007 return S_OK;
7008}
7009
7011 float *values, UINT offset, UINT count)
7012{
7014
7015 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
7017
7018 return S_OK;
7019}
7020
7023{
7025
7026 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
7028
7029 return S_OK;
7030}
7031
7033 int *values, UINT offset, UINT count)
7034{
7036
7037 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
7039
7040 return S_OK;
7041}
7042
7044 float *values, UINT offset, UINT count)
7045{
7047
7048 TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count);
7050
7051 return S_OK;
7052}
7053
7054static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl =
7055{
7056 /* ID3D10EffectVariable methods */
7082 /* ID3D10EffectVectorVariable methods */
7095};
7096
7097static void write_matrix_to_buffer(struct d3d10_effect_variable *variable, void *dst_void,
7098 struct d3d10_matrix *src, BOOL transpose)
7099{
7100 unsigned int col_count = !transpose ? variable->type->column_count : variable->type->row_count;
7101 unsigned int row_count = !transpose ? variable->type->row_count : variable->type->column_count;
7102 BOOL major = variable->type->type_class == D3D10_SVC_MATRIX_COLUMNS;
7103 float *dst = dst_void;
7104 unsigned int row, col;
7105
7106 if (transpose)
7107 major = !major;
7108
7109 if (major)
7110 {
7111 for (col = 0; col < col_count; ++col)
7112 {
7113 for (row = 0; row < row_count; ++row)
7114 dst[(col * 4) + row] = src->m[row][col];
7115 }
7116 }
7117 else
7118 {
7119 for (row = 0; row < row_count; ++row)
7120 {
7121 for (col = 0; col < col_count; ++col)
7122 dst[(row * 4) + col] = src->m[row][col];
7123 }
7124 }
7125}
7126
7128{
7129 BYTE *dst = variable->buffer->u.buffer.local_buffer + variable->buffer_offset;
7130
7132
7133 variable->buffer->u.buffer.changed = TRUE;
7134}
7135
7137 unsigned int offset, unsigned int count, BOOL transpose)
7138{
7139 BYTE *dst = variable->buffer->u.buffer.local_buffer + variable->buffer_offset;
7140 struct d3d10_matrix *src = src_data;
7141 unsigned int i;
7142
7143 if (!variable->type->element_count)
7144 {
7146 return;
7147 }
7148
7149 if (offset >= variable->type->element_count)
7150 {
7151 WARN("Offset %u larger than element count %u, ignoring.\n", offset, variable->type->element_count);
7152 return;
7153 }
7154
7155 if (count > variable->type->element_count - offset)
7156 {
7157 WARN("Offset %u, count %u overruns the variable (element count %u), fixing up.\n",
7158 offset, count, variable->type->element_count);
7159 count = variable->type->element_count - offset;
7160 }
7161
7162 if (offset)
7163 dst += variable->type->stride * offset;
7164
7165 for (i = 0; i < count; ++i)
7166 {
7168
7169 dst += variable->type->stride;
7170 }
7171
7172 variable->buffer->u.buffer.changed = TRUE;
7173}
7174
7175static void read_matrix_from_buffer(struct d3d10_effect_variable *variable, void *src_void,
7176 struct d3d10_matrix *dst, BOOL transpose)
7177{
7178 unsigned int col_count = !transpose ? variable->type->column_count : variable->type->row_count;
7179 unsigned int row_count = !transpose ? variable->type->row_count : variable->type->column_count;
7180 BOOL major = variable->type->type_class == D3D10_SVC_MATRIX_COLUMNS;
7181 float *src = src_void;
7182 unsigned int row, col;
7183
7184 if (transpose)
7185 major = !major;
7186
7187 if (major)
7188 {
7189 for (col = 0; col < col_count; ++col)
7190 {
7191 for (row = 0; row < row_count; ++row)
7192 dst->m[row][col] = src[(col * 4) + row];
7193 }
7194 }
7195 else
7196 {
7197 for (row = 0; row < row_count; ++row)
7198 {
7199 for (col = 0; col < col_count; ++col)
7200 dst->m[row][col] = src[(row * 4) + col];
7201 }
7202 }
7203}
7204
7206{
7207 BYTE *src = variable->buffer->u.buffer.local_buffer + variable->buffer_offset;
7208
7210}
7211
7214{
7215 BYTE *src = variable->buffer->u.buffer.local_buffer + variable->buffer_offset;
7216 struct d3d10_matrix *dst = dst_data;
7217 unsigned int i;
7218
7219 if (!variable->type->element_count)
7220 {
7222 return;
7223 }
7224
7225 if (offset >= variable->type->element_count)
7226 {
7227 WARN("Offset %u larger than element count %u, ignoring.\n", offset, variable->type->element_count);
7228 return;
7229 }
7230
7231 if (count > variable->type->element_count - offset)
7232 {
7233 WARN("Offset %u, count %u overruns the variable (element count %u), fixing up.\n",
7234 offset, count, variable->type->element_count);
7235 count = variable->type->element_count - offset;
7236 }
7237
7238 if (offset)
7239 src += variable->type->stride * offset;
7240
7241 for (i = 0; i < count; ++i)
7242 {
7244
7245 src += variable->type->stride;
7246 }
7247}
7248
7249/* ID3D10EffectVariable methods */
7250
7252{
7254}
7255
7257{
7259
7260 TRACE("iface %p\n", iface);
7261
7262 return v != &null_matrix_variable;
7263}
7264
7267{
7269}
7270
7273{
7275}
7276
7279{
7281}
7282
7284 ID3D10EffectMatrixVariable *iface, const char *name)
7285{
7287}
7288
7291{
7293}
7294
7296 ID3D10EffectMatrixVariable *iface, const char *name)
7297{
7299}
7300
7302 ID3D10EffectMatrixVariable *iface, const char *semantic)
7303{
7305}
7306
7309{
7311}
7312
7315{
7317}
7318
7321{
7323}
7324
7327{
7329}
7330
7333{
7335}
7336
7339{
7341}
7342
7345{
7347}
7348
7351{
7353}
7354
7357{
7359}
7360
7363{
7365}
7366
7369{
7371}
7372
7375{
7377}
7378
7381{
7383}
7384
7387{
7389}
7390
7393{
7395}
7396
7398 void *data, UINT offset, UINT count)
7399{
7401}
7402
7404 void *data, UINT offset, UINT count)
7405{
7407}
7408
7409/* ID3D10EffectMatrixVariable methods */
7410
7412 float *data)
7413{
7415
7416 TRACE("iface %p, data %p.\n", iface, data);
7418
7419 return S_OK;
7420}
7421
7423 float *data)
7424{
7426
7427 TRACE("iface %p, data %p.\n", iface, data);
7429
7430 return S_OK;
7431}
7432
7434 float *data, UINT offset, UINT count)
7435{
7437
7438 TRACE("iface %p, data %p, offset %u, count %u.\n", iface, data, offset, count);
7440
7441 return S_OK;
7442}
7443
7445 float *data, UINT offset, UINT count)
7446{
7448
7449 TRACE("iface %p, data %p, offset %u, count %u.\n", iface, data, offset, count);
7451
7452 return S_OK;
7453}
7454
7456 float *data)
7457{
7459
7460 TRACE("iface %p, data %p.\n", iface, data);
7462
7463 return S_OK;
7464}
7465
7467 float *data)
7468{
7470
7471 TRACE("iface %p, data %p.\n", iface, data);
7473
7474 return S_OK;
7475}
7476
7478 float *data, UINT offset, UINT count)
7479{
7481
7482 TRACE("iface %p, data %p, offset %u, count %u.\n", iface, data, offset, count);
7484
7485 return S_OK;
7486}
7487
7489 float *data, UINT offset, UINT count)
7490{
7492
7493 TRACE("iface %p, data %p, offset %u, count %u.\n", iface, data, offset, count);
7495
7496 return S_OK;
7497}
7498
7499
7500static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl =
7501{
7502 /* ID3D10EffectVariable methods */
7528 /* ID3D10EffectMatrixVariable methods */
7537};
7538
7539/* ID3D10EffectVariable methods */
7540
7542{
7544}
7545
7547{
7549
7550 TRACE("iface %p\n", iface);
7551
7552 return v != &null_string_variable;
7553}
7554
7557{
7559}
7560
7563{
7565}
7566
7569{
7571}
7572
7574 ID3D10EffectStringVariable *iface, const char *name)
7575{
7577}
7578
7581{
7583}
7584
7586 ID3D10EffectStringVariable *iface, const char *name)
7587{
7589}
7590
7592 ID3D10EffectStringVariable *iface, const char *semantic)
7593{
7595}
7596
7599{
7601}
7602
7605{
7607}
7608
7611{
7613}
7614
7617{
7619}
7620
7623{
7625}
7626
7629{
7631}
7632
7635{
7637}
7638
7641{
7643}
7644
7647{
7649}
7650
7653{
7655}
7656
7659{
7661}
7662
7665{
7667}
7668
7671{
7673}
7674
7677{
7679}
7680
7683{
7685}
7686
7688 void *data, UINT offset, UINT count)
7689{
7691}
7692
7694 void *data, UINT offset, UINT count)
7695{
7697}
7698
7699/* ID3D10EffectStringVariable methods */
7700
7702 const char **str)
7703{
7705 char *value = (char *)var->u.buffer.local_buffer;
7706
7707 TRACE("iface %p, str %p.\n", iface, str);
7708
7709 if (!value)
7710 return E_FAIL;
7711
7712 if (!str)
7713 return E_INVALIDARG;
7714
7715 *str = value;
7716
7717 return S_OK;
7718}
7719
7721 const char **strs, UINT offset, UINT count)
7722{
7723 FIXME("iface %p, strs %p, offset %u, count %u stub!\n", iface, strs, offset, count);
7724
7725 return E_NOTIMPL;
7726}
7727
7728
7729static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl =
7730{
7731 /* ID3D10EffectVariable methods */
7757 /* ID3D10EffectStringVariable methods */
7760};
7761
7763{
7764 if (*dst == *src)
7765 return;
7766
7767 if (*src)
7768 ID3D10ShaderResourceView_AddRef(*src);
7769 if (*dst)
7770 ID3D10ShaderResourceView_Release(*dst);
7771
7772 *dst = *src;
7773}
7774
7775/* ID3D10EffectVariable methods */
7776
7779{
7781}
7782
7784{
7786
7787 TRACE("iface %p.\n", iface);
7788
7790}
7791
7794{
7796}
7797
7800{
7802}
7803
7806{
7808}
7809
7811 ID3D10EffectShaderResourceVariable *iface, const char *name)
7812{
7814}
7815
7818{
7820}
7821
7823 ID3D10EffectShaderResourceVariable *iface, const char *name)
7824{
7826}
7827
7829 ID3D10EffectShaderResourceVariable *iface, const char *semantic)
7830{
7832}
7833
7836{
7838}
7839
7842{
7844}
7845
7848{
7850}
7851
7854{
7856}
7857
7860{
7862}
7863
7866{
7868}
7869
7872{
7874}
7875
7878{
7880}
7881
7884{
7886}
7887
7890{
7892}
7893
7896{
7898}
7899
7902{
7904}
7905
7908{
7910}
7911
7914{
7916}
7917
7920{
7922}
7923
7926{
7928}
7929
7932{
7934}
7935
7936/* ID3D10EffectShaderResourceVariable methods */
7937
7940{
7942
7943 TRACE("iface %p, resource %p.\n", iface, resource);
7944
7946 return E_FAIL;
7947
7948 set_shader_resource_variable(&resource, v->u.resource.srv);
7949
7950 return S_OK;
7951}
7952
7955{
7956 FIXME("iface %p, resource %p stub!\n", iface, resource);
7957
7958 return E_NOTIMPL;
7959}
7960
7963{
7965 ID3D10ShaderResourceView **rsrc_view;
7966 unsigned int i;
7967
7968 TRACE("iface %p, resources %p, offset %u, count %u.\n", iface, resources, offset, count);
7969
7970 if (!v->type->element_count)
7972
7973 if (offset >= v->type->element_count)
7974 {
7975 WARN("Offset %u larger than element count %u, ignoring.\n", offset, v->type->element_count);
7976 return S_OK;
7977 }
7978
7979 if (count > v->type->element_count - offset)
7980 {
7981 WARN("Offset %u, count %u overruns the variable (element count %u), fixing up.\n",
7982 offset, count, v->type->element_count);
7983 count = v->type->element_count - offset;
7984 }
7985
7986 rsrc_view = &v->u.resource.srv[offset];
7987 for (i = 0; i < count; ++i)
7988 set_shader_resource_variable(&resources[i], &rsrc_view[i]);
7989
7990 return S_OK;
7991}
7992
7995{
7996 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface, resources, offset, count);
7997
7998 return E_NOTIMPL;
7999}
8000
8001
8002static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl =
8003{
8004 /* ID3D10EffectVariable methods */
8030 /* ID3D10EffectShaderResourceVariable methods */
8035};
8036
8037/* ID3D10EffectVariable methods */
8038
8041{
8043}
8044
8047{
8049
8050 TRACE("iface %p\n", iface);
8051
8053}
8054
8057{
8059}
8060
8063{
8065}
8066
8069{
8071}
8072
8074 ID3D10EffectRenderTargetViewVariable *iface, const char *name)
8075{
8077}
8078
8081{
8083}
8084
8086 ID3D10EffectRenderTargetViewVariable *iface, const char *name)
8087{
8089}
8090
8092 ID3D10EffectRenderTargetViewVariable *iface, const char *semantic)
8093{
8095}
8096
8099{
8101}
8102
8105{
8107}
8108
8111{
8113}
8114
8117{
8119}
8120
8123{
8125}
8126
8129{
8131}
8132
8135{
8137}
8138
8141{
8143}
8144
8147{
8149}
8150
8153{
8155}
8156
8159{
8161}
8162
8165{
8167}
8168
8171{
8173}
8174
8177{
8179}
8180
8183{
8185}
8186
8189{
8191}
8192
8195{
8197}
8198
8199/* ID3D10EffectRenderTargetViewVariable methods */
8200
8203{
8204 FIXME("iface %p, view %p stub!\n", iface, view);
8205
8206 return E_NOTIMPL;
8207}
8208
8211{
8212 FIXME("iface %p, view %p stub!\n", iface, view);
8213
8214 return E_NOTIMPL;
8215}
8216
8219{
8220 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
8221
8222 return E_NOTIMPL;
8223}
8224
8227{
8228 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
8229
8230 return E_NOTIMPL;
8231}
8232
8233
8234static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl =
8235{
8236 /* ID3D10EffectVariable methods */
8262 /* ID3D10EffectRenderTargetViewVariable methods */
8267};
8268
8269/* ID3D10EffectVariable methods */
8270
8273{
8275}
8276
8279{
8281
8282 TRACE("iface %p\n", iface);
8283
8285}
8286
8289{
8291}
8292
8295{
8297}
8298
8301{
8303}
8304
8306 ID3D10EffectDepthStencilViewVariable *iface, const char *name)
8307{
8309}
8310
8313{
8315}
8316
8318 ID3D10EffectDepthStencilViewVariable *iface, const char *name)
8319{
8321}
8322
8324 ID3D10EffectDepthStencilViewVariable *iface, const char *semantic)
8325{
8327}
8328
8331{
8333}
8334
8337{
8339}
8340
8343{
8345}
8346
8349{
8351}
8352
8355{
8357}
8358
8361{
8363}
8364
8367{
8369}
8370
8373{
8375}
8376
8379{
8381}
8382
8385{
8387}
8388
8391{
8393}
8394
8397{
8399}
8400
8403{
8405}
8406
8409{
8411}
8412
8415{
8417}
8418
8421{
8423}
8424
8427{
8429}
8430
8431/* ID3D10EffectDepthStencilViewVariable methods */
8432
8435{
8436 FIXME("iface %p, view %p stub!\n", iface, view);
8437
8438 return E_NOTIMPL;
8439}
8440
8443{
8444 FIXME("iface %p, view %p stub!\n", iface, view);
8445
8446 return E_NOTIMPL;
8447}
8448
8451{
8452 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
8453
8454 return E_NOTIMPL;
8455}
8456
8459{
8460 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
8461
8462 return E_NOTIMPL;
8463}
8464
8465
8466static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl =
8467{
8468 /* ID3D10EffectVariable methods */
8494 /* ID3D10EffectDepthStencilViewVariable methods */
8499};
8500
8501/* ID3D10EffectVariable methods */
8502
8504{
8506
8507 TRACE("iface %p\n", iface);
8508
8509 return v != &null_shader_variable;
8510}
8511
8514{
8516}
8517
8520{
8522}
8523
8526{
8528}
8529
8531 ID3D10EffectShaderVariable *iface, const char *name)
8532{
8534}
8535
8538{
8540}
8541
8543 ID3D10EffectShaderVariable *iface, const char *name)
8544{
8546}
8547
8549 ID3D10EffectShaderVariable *iface, const char *semantic)
8550{
8552}
8553
8556{
8558}
8559
8562{
8564}
8565
8568{
8570}
8571
8574{
8576}
8577
8580{
8582}
8583
8586{
8588}
8589
8592{
8594}
8595
8598{
8600}
8601
8604{
8606}
8607
8610{
8612}
8613
8616{
8618}
8619
8622{
8624}
8625
8628{
8630}
8631
8634{
8636}
8637
8640{
8642}
8643
8646{
8648}
8649
8652{
8654}
8655
8656/* ID3D10EffectShaderVariable methods */
8657
8660{
8661 unsigned int i;
8662
8664
8665 if (!shader_index)
8666 {
8667 *s = &v->u.shader;
8668 if (basetype) *basetype = v->type->basetype;
8669 return S_OK;
8670 }
8671
8672 /* Index is used as an offset from this variable. */
8673
8674 for (i = 0; i < v->effect->shaders.count; ++i)
8675 {
8676 if (v == v->effect->shaders.v[i]) break;
8677 }
8678
8679 if (i + shader_index >= v->effect->shaders.count)
8680 {
8681 WARN("Invalid shader index %u.\n", shader_index);
8682 return E_FAIL;
8683 }
8684
8685 *s = &v->effect->shaders.v[i + shader_index]->u.shader;
8686 if (basetype) *basetype = v->effect->shaders.v[i + shader_index]->type->basetype;
8687
8688 return S_OK;
8689}
8690
8693{
8696 D3D10_SHADER_DESC shader_desc;
8697 HRESULT hr;
8698
8699 TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
8700
8702 return hr;
8703
8704 memset(desc, 0, sizeof(*desc));
8705 if (s->input_signature)
8706 desc->pInputSignature = ID3D10Blob_GetBufferPointer(s->input_signature);
8707 desc->SODecl = s->stream_output_declaration;
8708 desc->IsInline = s->isinline;
8709 if (s->bytecode)
8710 {
8711 desc->pBytecode = ID3D10Blob_GetBufferPointer(s->bytecode);
8712 desc->BytecodeLength = ID3D10Blob_GetBufferSize(s->bytecode);
8713 }
8714 if (s->reflection)
8715 {
8716 if (SUCCEEDED(hr = s->reflection->lpVtbl->GetDesc(s->reflection, &shader_desc)))
8717 {
8718 desc->NumInputSignatureEntries = shader_desc.InputParameters;
8719 desc->NumOutputSignatureEntries = shader_desc.OutputParameters;
8720 }
8721 }
8722
8723 return hr;
8724}
8725
8728{
8732 HRESULT hr;
8733
8734 TRACE("iface %p, index %u, shader %p.\n", iface, index, shader);
8735
8736 *shader = NULL;
8737
8738 if (FAILED(hr = d3d10_get_shader_variable(v, index, &s, &basetype)))
8739 return hr;
8740
8741 if (basetype != D3D10_SVT_VERTEXSHADER)
8742 {
8743 WARN("Shader is not a vertex shader.\n");
8744 return D3DERR_INVALIDCALL;
8745 }
8746
8747 if ((*shader = s->shader.vs))
8748 ID3D10VertexShader_AddRef(*shader);
8749
8750 return S_OK;
8751}
8752
8755{
8759 HRESULT hr;
8760
8761 TRACE("iface %p, index %u, shader %p.\n", iface, index, shader);
8762
8763 *shader = NULL;
8764
8765 if (FAILED(hr = d3d10_get_shader_variable(v, index, &s, &basetype)))
8766 return hr;
8767
8768 if (basetype != D3D10_SVT_GEOMETRYSHADER)
8769 {
8770 WARN("Shader is not a geometry shader.\n");
8771 return D3DERR_INVALIDCALL;
8772 }
8773
8774 if ((*shader = s->shader.gs))
8775 ID3D10GeometryShader_AddRef(*shader);
8776
8777 return S_OK;
8778}
8779
8782{
8786 HRESULT hr;
8787
8788 TRACE("iface %p, index %u, shader %p.\n", iface, index, shader);
8789
8790 *shader = NULL;
8791
8792 if (FAILED(hr = d3d10_get_shader_variable(v, index, &s, &basetype)))
8793 return hr;
8794
8795 if (basetype != D3D10_SVT_PIXELSHADER)
8796 {
8797 WARN("Shader is not a pixel shader.\n");
8798 return D3DERR_INVALIDCALL;
8799 }
8800
8801 if ((*shader = s->shader.ps))
8802 ID3D10PixelShader_AddRef(*shader);
8803
8804 return S_OK;
8805}
8806
8808 UINT shader_index, UINT element_index, BOOL output, D3D10_SIGNATURE_PARAMETER_DESC *desc)
8809{
8811 HRESULT hr;
8812
8813 if (FAILED(hr = d3d10_get_shader_variable(v, shader_index, &s, NULL)))
8814 return hr;
8815
8816 if (!s->reflection)
8817 return D3DERR_INVALIDCALL;
8818
8819 if (output)
8820 return s->reflection->lpVtbl->GetOutputParameterDesc(s->reflection, element_index, desc);
8821 else
8822 return s->reflection->lpVtbl->GetInputParameterDesc(s->reflection, element_index, desc);
8823}
8824
8826 ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index,
8828{
8830
8831 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
8832 iface, shader_index, element_index, desc);
8833
8834 if (!iface->lpVtbl->IsValid(iface))
8835 {
8836 WARN("Null variable specified\n");
8837 return E_FAIL;
8838 }
8839
8840 return d3d10_get_shader_variable_signature(v, shader_index, element_index, FALSE, desc);
8841}
8842
8844 ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index,
8846{
8848
8849 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
8850 iface, shader_index, element_index, desc);
8851
8852 if (!iface->lpVtbl->IsValid(iface))
8853 {
8854 WARN("Null variable specified\n");
8855 return E_FAIL;
8856 }
8857
8858 return d3d10_get_shader_variable_signature(v, shader_index, element_index, TRUE, desc);
8859}
8860
8861
8862static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl =
8863{
8864 /* ID3D10EffectVariable methods */
8890 /* ID3D10EffectShaderVariable methods */
8897};
8898
8899/* ID3D10EffectVariable methods */
8900
8903{
8905}
8906
8908{
8910
8911 TRACE("iface %p\n", iface);
8912
8913 return v != &null_blend_variable;
8914}
8915
8918{
8920}
8921
8924{
8926}
8927
8930{
8932}
8933
8935 ID3D10EffectBlendVariable *iface, const char *name)
8936{
8938}
8939
8942{
8944}
8945
8947 ID3D10EffectBlendVariable *iface, const char *name)
8948{
8950}
8951
8953 ID3D10EffectBlendVariable *iface, const char *semantic)
8954{
8956}
8957
8960{
8962}
8963
8966{
8968}
8969
8972{
8974}
8975
8978{
8980}
8981
8984{
8986}
8987
8990{
8992}
8993
8996{
8998}
8999
9002{
9004}
9005
9008{
9010}
9011
9014{
9016}
9017
9020{
9022}
9023
9026{
9028}
9029
9032{
9034}
9035
9038{
9040}
9041
9044{
9046}
9047
9049 void *data, UINT offset, UINT count)
9050{
9052}
9053
9055 void *data, UINT offset, UINT count)
9056{
9058}
9059
9060/* ID3D10EffectBlendVariable methods */
9061
9063 UINT index, ID3D10BlendState **blend_state)
9064{
9066
9067 TRACE("iface %p, index %u, blend_state %p.\n", iface, index, blend_state);
9068
9069 if (!iface->lpVtbl->IsValid(iface))
9070 {
9071 WARN("Invalid variable.\n");
9072 return E_FAIL;
9073 }
9074
9075 if (!(v = d3d10_get_state_variable(v, index, &v->effect->blend_states)))
9076 return E_FAIL;
9077
9078 if ((*blend_state = v->u.state.object.blend))
9079 ID3D10BlendState_AddRef(*blend_state);
9080
9081 return S_OK;
9082}
9083
9086{
9088
9089 TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
9090
9091 if (!iface->lpVtbl->IsValid(iface))
9092 {
9093 WARN("Invalid variable.\n");
9094 return E_FAIL;
9095 }
9096
9097 if (!(v = d3d10_get_state_variable(v, index, &v->effect->blend_states)))
9098 return E_FAIL;
9099
9100 *desc = v->u.state.desc.blend;
9101
9102 return S_OK;
9103}
9104
9105static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl =
9106{
9107 /* ID3D10EffectVariable methods */
9133 /* ID3D10EffectBlendVariable methods */
9136};
9137
9138/* ID3D10EffectVariable methods */
9139
9142{
9144}
9145
9147{
9149
9150 TRACE("iface %p\n", iface);
9151
9152 return v != &null_depth_stencil_variable;
9153}
9154
9157{
9159}
9160
9163{
9165}
9166
9169{
9171}
9172
9174 ID3D10EffectDepthStencilVariable *iface, const char *name)
9175{
9177}
9178
9181{
9183}
9184
9186 ID3D10EffectDepthStencilVariable *iface, const char *name)
9187{
9189}
9190
9192 ID3D10EffectDepthStencilVariable *iface, const char *semantic)
9193{
9195}
9196
9199{
9201}
9202
9205{
9207}
9208
9211{
9213}
9214
9217{
9219}
9220
9223{
9225}
9226
9229{
9231}
9232
9235{
9237}
9238
9241{
9243}
9244
9247{
9249}
9250
9253{
9255}
9256
9259{
9261}
9262
9265{
9267}
9268
9271{
9273}
9274
9277{
9279}
9280
9283{
9285}
9286
9288 void *data, UINT offset, UINT count)
9289{
9291}
9292
9294 void *data, UINT offset, UINT count)
9295{
9297}
9298
9299/* ID3D10EffectDepthStencilVariable methods */
9300
9302 UINT index, ID3D10DepthStencilState **depth_stencil_state)
9303{
9305
9306 TRACE("iface %p, index %u, depth_stencil_state %p.\n", iface, index, depth_stencil_state);
9307
9308 if (!iface->lpVtbl->IsValid(iface))
9309 {
9310 WARN("Invalid variable.\n");
9311 return E_FAIL;
9312 }
9313
9314 if (!(v = d3d10_get_state_variable(v, index, &v->effect->ds_states)))
9315 return E_FAIL;
9316
9317 if ((*depth_stencil_state = v->u.state.object.depth_stencil))
9318 ID3D10DepthStencilState_AddRef(*depth_stencil_state);
9319
9320 return S_OK;
9321}
9322
9325{
9327
9328 TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
9329
9330 if (!iface->lpVtbl->IsValid(iface))
9331 {
9332 WARN("Invalid variable.\n");
9333 return E_FAIL;
9334 }
9335
9336 if (!(v = d3d10_get_state_variable(v, index, &v->effect->ds_states)))
9337 return E_FAIL;
9338
9339 d3d10_effect_update_dependent_props(&v->u.state.dependencies, &v->u.state.desc);
9340
9341 *desc = v->u.state.desc.depth_stencil;
9342
9343 return S_OK;
9344}
9345
9346static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl =
9347{
9348 /* ID3D10EffectVariable methods */
9374 /* ID3D10EffectDepthStencilVariable methods */
9377};
9378
9379/* ID3D10EffectVariable methods */
9380
9383{
9385}
9386
9388{
9390
9391 TRACE("iface %p\n", iface);
9392
9393 return v != &null_rasterizer_variable;
9394}
9395
9398{
9400}
9401
9404{
9406}
9407
9410{
9412}
9413
9415 ID3D10EffectRasterizerVariable *iface, const char *name)
9416{
9418}
9419
9422{
9424}
9425
9427 ID3D10EffectRasterizerVariable *iface, const char *name)
9428{
9430}
9431
9433 ID3D10EffectRasterizerVariable *iface, const char *semantic)
9434{
9436}
9437
9440{
9442}
9443
9446{
9448}
9449
9452{
9454}
9455
9458{
9460}
9461
9464{
9466}
9467
9470{
9472}
9473
9476{
9478}
9479
9482{
9484}
9485
9488{
9490}
9491
9494{
9496}
9497
9500{
9502}
9503
9506{
9508}
9509
9512{
9514}
9515
9518{
9520}
9521
9524{
9526}
9527
9529 void *data, UINT offset, UINT count)
9530{
9532}
9533
9535 void *data, UINT offset, UINT count)
9536{
9538}
9539
9540/* ID3D10EffectRasterizerVariable methods */
9541
9543 UINT index, ID3D10RasterizerState **rasterizer_state)
9544{
9546
9547 TRACE("iface %p, index %u, rasterizer_state %p.\n", iface, index, rasterizer_state);
9548
9549 if (!iface->lpVtbl->IsValid(iface))
9550 {
9551 WARN("Invalid variable.\n");
9552 return E_FAIL;
9553 }
9554
9555 if (!(v = d3d10_get_state_variable(v, index, &v->effect->rs_states)))
9556 return E_FAIL;
9557
9558 if ((*rasterizer_state = v->u.state.object.rasterizer))
9559 ID3D10RasterizerState_AddRef(*rasterizer_state);
9560
9561 return S_OK;
9562}
9563
9566{
9568
9569 TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
9570
9571 if (!iface->lpVtbl->IsValid(iface))
9572 {
9573 WARN("Invalid variable.\n");
9574 return E_FAIL;
9575 }
9576
9577 if (!(v = d3d10_get_state_variable(v, index, &v->effect->rs_states)))
9578 return E_FAIL;
9579
9580 *desc = v->u.state.desc.rasterizer;
9581
9582 return S_OK;
9583}
9584
9585static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl =
9586{
9587 /* ID3D10EffectVariable methods */
9613 /* ID3D10EffectRasterizerVariable methods */
9616};
9617
9618/* ID3D10EffectVariable methods */
9619
9622{
9624}
9625
9627{
9629
9630 TRACE("iface %p\n", iface);
9631
9632 return v != &null_sampler_variable;
9633}
9634
9637{
9639}
9640
9643{
9645}
9646
9649{
9651}
9652
9654 ID3D10EffectSamplerVariable *iface, const char *name)
9655{
9657}
9658
9661{
9663}
9664
9666 ID3D10EffectSamplerVariable *iface, const char *name)
9667{
9669}
9670
9672 ID3D10EffectSamplerVariable *iface, const char *semantic)
9673{
9675}
9676
9679{
9681}
9682
9685{
9687}
9688
9691{
9693}
9694
9697{
9699}
9700
9703{
9705}
9706
9709{
9711}
9712
9715{
9717}
9718
9721{
9723}
9724
9727{
9729}
9730
9733{
9735}
9736
9739{
9741}
9742
9745{
9747}
9748
9751{
9753}
9754
9757{
9759}
9760
9763{
9765}
9766
9768 void *data, UINT offset, UINT count)
9769{
9771}
9772
9774 void *data, UINT offset, UINT count)
9775{
9777}
9778
9779/* ID3D10EffectSamplerVariable methods */
9780
9783{
9785
9786 TRACE("iface %p, index %u, sampler %p.\n", iface, index, sampler);
9787
9788 if (!iface->lpVtbl->IsValid(iface))
9789 {
9790 WARN("Invalid variable.\n");
9791 return E_FAIL;
9792 }
9793
9794 if (!(v = d3d10_get_state_variable(v, index, &v->effect->samplers)))
9795 return E_FAIL;
9796
9797 if ((*sampler = v->u.state.object.sampler))
9798 ID3D10SamplerState_AddRef(*sampler);
9799
9800 return S_OK;
9801}
9802
9805{
9807
9808 TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
9809
9810 if (!iface->lpVtbl->IsValid(iface))
9811 {
9812 WARN("Invalid variable.\n");
9813 return E_FAIL;
9814 }
9815
9816 if (!(v = d3d10_get_state_variable(v, index, &v->effect->samplers)))
9817 return E_FAIL;
9818
9819 *desc = v->u.state.desc.sampler.desc;
9820
9821 return S_OK;
9822}
9823
9824static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl =
9825{
9826 /* ID3D10EffectVariable methods */
9852 /* ID3D10EffectSamplerVariable methods */
9855};
9856
9857/* ID3D10EffectType methods */
9858
9860{
9862}
9863
9865{
9867
9868 TRACE("iface %p\n", iface);
9869
9870 return This != &null_type;
9871}
9872
9874{
9876
9877 TRACE("iface %p, desc %p\n", iface, desc);
9878
9879 if (This == &null_type)
9880 {
9881 WARN("Null type specified\n");
9882 return E_FAIL;
9883 }
9884
9885 if (!desc)
9886 {
9887 WARN("Invalid argument specified\n");
9888 return E_INVALIDARG;
9889 }
9890
9891 desc->TypeName = This->name;
9892 desc->Class = This->type_class;
9893 desc->Type = This->basetype;
9894 desc->Elements = This->element_count;
9895 desc->Members = This->member_count;
9896 desc->Rows = This->row_count;
9897 desc->Columns = This->column_count;
9898 desc->PackedSize = This->size_packed;
9899 desc->UnpackedSize = This->size_unpacked;
9900 desc->Stride = This->stride;
9901
9902 return S_OK;
9903}
9904
9906 UINT index)
9907{
9909 struct d3d10_effect_type *t;
9910
9911 TRACE("iface %p, index %u\n", iface, index);
9912
9913 if (index >= This->member_count)
9914 {
9915 WARN("Invalid index specified\n");
9916 return &null_type.ID3D10EffectType_iface;
9917 }
9918
9919 t = (&This->members[index])->type;
9920
9921 TRACE("Returning member %p, %s\n", t, debugstr_a(t->name));
9922
9923 return &t->ID3D10EffectType_iface;
9924}
9925
9927 const char *name)
9928{
9930 unsigned int i;
9931
9932 TRACE("iface %p, name %s\n", iface, debugstr_a(name));
9933
9934 if (!name)
9935 {
9936 WARN("Invalid name specified\n");
9937 return &null_type.ID3D10EffectType_iface;
9938 }
9939
9940 for (i = 0; i < This->member_count; ++i)
9941 {
9942 struct d3d10_effect_type_member *typem = &This->members[i];
9943
9944 if (typem->name && !strcmp(typem->name, name))
9945 {
9946 TRACE("Returning type %p.\n", typem->type);
9947 return &typem->type->ID3D10EffectType_iface;
9948 }
9949 }
9950
9951 WARN("Invalid name specified\n");
9952
9953 return &null_type.ID3D10EffectType_iface;
9954}
9955
9957 const char *semantic)
9958{
9960 unsigned int i;
9961
9962 TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
9963
9964 if (!semantic)
9965 {
9966 WARN("Invalid semantic specified\n");
9967 return &null_type.ID3D10EffectType_iface;
9968 }
9969
9970 for (i = 0; i < This->member_count; ++i)
9971 {
9972 struct d3d10_effect_type_member *typem = &This->members[i];
9973
9974 if (typem->semantic && !stricmp(typem->semantic, semantic))
9975 {
9976 TRACE("Returning type %p.\n", typem->type);
9977 return &typem->type->ID3D10EffectType_iface;
9978 }
9979 }
9980
9981 WARN("Invalid semantic specified\n");
9982
9983 return &null_type.ID3D10EffectType_iface;
9984}
9985
9987{
9989 struct d3d10_effect_type_member *typem;
9990
9991 TRACE("iface %p, index %u\n", iface, index);
9992
9993 if (index >= This->member_count)
9994 {
9995 WARN("Invalid index specified\n");
9996 return NULL;
9997 }
9998
9999 typem = &This->members[index];
10000
10001 TRACE("Returning name %s\n", debugstr_a(typem->name));
10002
10003 return typem->name;
10004}
10005
10007{
10009 struct d3d10_effect_type_member *typem;
10010
10011 TRACE("iface %p, index %u\n", iface, index);
10012
10013 if (index >= This->member_count)
10014 {
10015 WARN("Invalid index specified\n");
10016 return NULL;
10017 }
10018
10019 typem = &This->members[index];
10020
10021 TRACE("Returning semantic %s\n", debugstr_a(typem->semantic));
10022
10023 return typem->semantic;
10024}
10025
10026static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl =
10027{
10028 /* ID3D10EffectType */
10036};
10037
10039 REFIID riid, void **object)
10040{
10041 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
10042
10043 if (IsEqualGUID(riid, &IID_ID3D10EffectPool) ||
10045 {
10046 IUnknown_AddRef(iface);
10047 *object = iface;
10048 return S_OK;
10049 }
10050
10051 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
10052
10053 *object = NULL;
10054 return E_NOINTERFACE;
10055}
10056
10058{
10059 struct d3d10_effect *effect = impl_from_ID3D10EffectPool(iface);
10060 return d3d10_effect_AddRef(&effect->ID3D10Effect_iface);
10061}
10062
10064{
10065 struct d3d10_effect *effect = impl_from_ID3D10EffectPool(iface);
10067}
10068
10070{
10071 struct d3d10_effect *effect = impl_from_ID3D10EffectPool(iface);
10072
10073 TRACE("%p.\n", iface);
10074
10075 return &effect->ID3D10Effect_iface;
10076}
10077
10078const struct ID3D10EffectPoolVtbl d3d10_effect_pool_vtbl =
10079{
10080 /* IUnknown methods */
10084 /* ID3D10EffectPool methods */
10086};
10087
10088
10089static int d3d10_effect_type_compare(const void *key, const struct wine_rb_entry *entry)
10090{
10091 const struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, const struct d3d10_effect_type, entry);
10092 const DWORD *id = key;
10093
10094 return *id - t->id;
10095}
10096
10098 struct d3d10_effect *pool, unsigned int flags, struct d3d10_effect **effect)
10099{
10100 struct d3d10_effect *object;
10101 HRESULT hr;
10102
10103 if (!device)
10104 return D3DERR_INVALIDCALL;
10105
10106 if (!(object = calloc(1, sizeof(*object))))
10107 return E_OUTOFMEMORY;
10108
10110 object->ID3D10Effect_iface.lpVtbl = flags & D3D10_EFFECT_IS_POOL ?
10112 object->ID3D10EffectPool_iface.lpVtbl = &d3d10_effect_pool_vtbl;
10113 object->refcount = 1;
10114 ID3D10Device_AddRef(device);
10115 object->device = device;
10116 object->pool = pool;
10117 object->flags = flags;
10118 if (pool) IUnknown_AddRef(&pool->ID3D10Effect_iface);
10119
10120 hr = d3d10_effect_parse(object, data, data_size);
10121 if (FAILED(hr))
10122 {
10123 ERR("Failed to parse effect\n");
10124 IUnknown_Release(&object->ID3D10Effect_iface);
10125 return hr;
10126 }
10127
10128 *effect = object;
10129
10130 return S_OK;
10131}
10132
10134 ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3D10Effect **effect)
10135{
10136 struct d3d10_effect *object, *pool = NULL;
10137 HRESULT hr;
10138
10139 TRACE("data %p, data_size %Iu, flags %#x, device %p, effect_pool %p, effect %p.\n",
10140 data, data_size, flags, device, effect_pool, effect);
10141
10142 if (!(flags & D3D10_EFFECT_COMPILE_CHILD_EFFECT) != !effect_pool)
10143 return E_INVALIDARG;
10144
10145 if (effect_pool && !(pool = unsafe_impl_from_ID3D10EffectPool(effect_pool)))
10146 {
10147 WARN("External pool implementations are not supported.\n");
10148 return E_INVALIDARG;
10149 }
10150
10151 if (FAILED(hr = d3d10_create_effect(data, data_size, device, pool, 0, &object)))
10152 {
10153 WARN("Failed to create an effect, hr %#lx.\n", hr);
10154 return hr;
10155 }
10156
10157 *effect = &object->ID3D10Effect_iface;
10158
10159 TRACE("Created effect %p\n", object);
10160
10161 return hr;
10162}
10163
10165 REFIID riid, void **object)
10166{
10167 struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
10168
10169 TRACE("iface %p, riid %s, obj %p.\n", iface, debugstr_guid(riid), object);
10170
10171 return IUnknown_QueryInterface(&effect->ID3D10EffectPool_iface, riid, object);
10172}
10173
10174static const struct ID3D10EffectVtbl d3d10_effect_pool_effect_vtbl =
10175{
10176 /* IUnknown methods */
10180 /* ID3D10Effect methods */
10194};
10195
10197 ID3D10Device *device, ID3D10EffectPool **effect_pool)
10198{
10199 struct d3d10_effect *object;
10200 HRESULT hr;
10201
10202 TRACE("data %p, data_size %Iu, fx_flags %#x, device %p, effect_pool %p.\n",
10203 data, data_size, fx_flags, device, effect_pool);
10204
10205 if (!data)
10206 return E_INVALIDARG;
10207
10208 if (FAILED(hr = d3d10_create_effect(data, data_size, device, NULL,
10209 D3D10_EFFECT_IS_POOL, &object)))
10210 {
10211 WARN("Failed to create an effect, hr %#lx.\n", hr);
10212 return hr;
10213 }
10214
10215 *effect_pool = &object->ID3D10EffectPool_iface;
10216
10217 TRACE("Created effect pool %p.\n", object);
10218
10219 return hr;
10220}
#define isspace(c)
Definition: acclib.h:69
#define isdigit(c)
Definition: acclib.h:68
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
operation
Definition: copy.c:29
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
signed char INT8
Definition: basetsd.h:183
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
r l[0]
Definition: byte_order.h:168
HRESULT WINAPI D3D10StateBlockMaskEnableCapture(D3D10_STATE_BLOCK_MASK *mask, D3D10_DEVICE_STATE_TYPES state_type, UINT start_idx, UINT count)
Definition: stateblock.c:771
@ D3D10_STENCIL_OP_KEEP
Definition: d3d10.idl:317
@ D3D10_FILL_SOLID
Definition: d3d10.idl:347
@ D3D10_TEXTURE_ADDRESS_WRAP
Definition: d3d10.idl:392
const unsigned int D3D10_DEFAULT_STENCIL_WRITE_MASK
Definition: d3d10.idl:118
const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
Definition: d3d10.idl:93
@ D3D10_USAGE_DEFAULT
Definition: d3d10.idl:461
@ D3D10_BLEND_INV_SRC_ALPHA
Definition: d3d10.idl:266
@ D3D10_BLEND_SRC_ALPHA
Definition: d3d10.idl:265
const unsigned int D3D10_DEFAULT_STENCIL_READ_MASK
Definition: d3d10.idl:116
@ D3D10_DEPTH_WRITE_MASK_ALL
Definition: d3d10.idl:302
@ D3D10_FILTER_MIN_MAG_MIP_POINT
Definition: d3d10.idl:370
@ D3D10_CULL_BACK
Definition: d3d10.idl:353
@ D3D10_COMPARISON_LESS
Definition: d3d10.idl:307
@ D3D10_COMPARISON_ALWAYS
Definition: d3d10.idl:313
@ D3D10_COMPARISON_NEVER
Definition: d3d10.idl:306
@ D3D10_BLEND_OP_ADD
Definition: d3d10.idl:281
@ D3D10_BIND_SHADER_RESOURCE
Definition: d3d10.idl:471
@ D3D10_BIND_CONSTANT_BUFFER
Definition: d3d10.idl:470
@ D3D10_EFFECT_OPTIMIZED
@ D3D10_EFFECT_IS_POOL
@ D3D10_EOO_VALUE_EXPRESSION
Definition: d3d10_private.h:56
@ D3D10_EOO_CONST
Definition: d3d10_private.h:51
@ D3D10_EOO_INDEX_EXPRESSION
Definition: d3d10_private.h:55
@ D3D10_EOO_VAR
Definition: d3d10_private.h:52
@ D3D10_EOO_ANONYMOUS_SHADER
Definition: d3d10_private.h:57
@ D3D10_EOO_CONST_INDEX
Definition: d3d10_private.h:53
#define D3DERR_INVALIDCALL
Definition: d3d10_private.h:42
@ D3D10_EOT_FLAG_GS_SO
Definition: d3d10_private.h:46
const unsigned int D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
Definition: d3d10effect.idl:46
const unsigned int D3D10_EFFECT_COMPILE_CHILD_EFFECT
const unsigned int D3D10_EFFECT_VARIABLE_POOLED
Definition: d3d10effect.idl:44
const unsigned int D3D10_EFFECT_VARIABLE_ANNOTATION
Definition: d3d10effect.idl:45
@ D3D10_DST_VS
Definition: d3d10effect.idl:54
@ D3D10_DST_OM_BLEND_STATE
Definition: d3d10effect.idl:53
@ D3D10_DST_PS
Definition: d3d10effect.idl:62
@ D3D10_DST_GS
Definition: d3d10effect.idl:58
@ D3D10_DST_OM_DEPTH_STENCIL_STATE
Definition: d3d10effect.idl:52
@ D3D10_DST_RS_RASTERIZER_STATE
Definition: d3d10effect.idl:72
D3D_SHADER_VARIABLE_TYPE D3D10_SHADER_VARIABLE_TYPE
Definition: d3d10shader.idl:60
D3D_SHADER_VARIABLE_CLASS D3D10_SHADER_VARIABLE_CLASS
Definition: d3d10shader.idl:45
@ D3D10_SVC_MATRIX_COLUMNS
Definition: d3dcommon.idl:145
@ D3D10_SVC_STRUCT
Definition: d3dcommon.idl:147
@ D3D10_SVC_VECTOR
Definition: d3dcommon.idl:143
@ D3D10_SVC_MATRIX_ROWS
Definition: d3dcommon.idl:144
@ D3D10_SVC_SCALAR
Definition: d3dcommon.idl:142
@ D3D10_SVC_OBJECT
Definition: d3dcommon.idl:146
@ D3D10_SVT_DEPTHSTENCILVIEW
Definition: d3dcommon.idl:257
@ D3D10_SVT_GEOMETRYSHADER
Definition: d3dcommon.idl:247
@ D3D10_SVT_BOOL
Definition: d3dcommon.idl:227
@ D3D10_SVT_TEXTURE2D
Definition: d3dcommon.idl:233
@ D3D10_SVT_TEXTURE
Definition: d3dcommon.idl:231
@ D3D10_SVT_TEXTURE3D
Definition: d3dcommon.idl:234
@ D3D10_SVT_PIXELSHADER
Definition: d3dcommon.idl:241
@ D3D10_SVT_TEXTURE2DMSARRAY
Definition: d3dcommon.idl:259
@ D3D10_SVT_TBUFFER
Definition: d3dcommon.idl:253
@ D3D10_SVT_BLEND
Definition: d3dcommon.idl:250
@ D3D10_SVT_TEXTURE2DARRAY
Definition: d3dcommon.idl:255
@ D3D10_SVT_STRING
Definition: d3dcommon.idl:230
@ D3D10_SVT_CBUFFER
Definition: d3dcommon.idl:252
@ D3D10_SVT_TEXTURECUBEARRAY
Definition: d3dcommon.idl:260
@ D3D10_SVT_RENDERTARGETVIEW
Definition: d3dcommon.idl:256
@ D3D10_SVT_TEXTURE1DARRAY
Definition: d3dcommon.idl:254
@ D3D10_SVT_TEXTURECUBE
Definition: d3dcommon.idl:235
@ D3D10_SVT_RASTERIZER
Definition: d3dcommon.idl:248
@ D3D10_SVT_DEPTHSTENCIL
Definition: d3dcommon.idl:249
@ D3D10_SVT_TEXTURE1D
Definition: d3dcommon.idl:232
@ D3D10_SVT_UINT
Definition: d3dcommon.idl:245
@ D3D10_SVT_VOID
Definition: d3dcommon.idl:226
@ D3D10_SVT_SAMPLER
Definition: d3dcommon.idl:236
@ D3D10_SVT_TEXTURE2DMS
Definition: d3dcommon.idl:258
@ D3D10_SVT_UINT8
Definition: d3dcommon.idl:246
@ D3D10_SVT_VERTEXSHADER
Definition: d3dcommon.idl:242
@ D3D10_SVT_FLOAT
Definition: d3dcommon.idl:229
@ D3D10_SVT_INT
Definition: d3dcommon.idl:228
@ D3D10_SVT_BUFFER
Definition: d3dcommon.idl:251
@ D3D_SRV_DIMENSION_BUFFER
Definition: d3dcommon.idl:550
@ D3D10_SIT_TBUFFER
Definition: d3dcommon.idl:709
@ D3D10_SIT_TEXTURE
Definition: d3dcommon.idl:710
@ D3D10_SIT_CBUFFER
Definition: d3dcommon.idl:708
@ D3D10_SIT_SAMPLER
Definition: d3dcommon.idl:711
enum _D3D_SHADER_VARIABLE_TYPE D3D_SHADER_VARIABLE_TYPE
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
size_t const element_size
Definition: debug_heap.cpp:510
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT32 uint32_t
Definition: types.h:75
static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetBackingStore(ID3D10EffectRasterizerVariable *iface, UINT index, D3D10_RASTERIZER_DESC *desc)
Definition: effect.c:9564
static struct d3d10_effect_variable null_vector_variable
Definition: effect.c:81
static void d3d10_effect_preshader_clear(struct d3d10_effect_preshader *p)
Definition: effect.c:901
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencil(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6552
static void pres_bult(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:555
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsScalar(ID3D10EffectVariable *iface)
Definition: effect.c:5723
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsRasterizer(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8632
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable *iface, int *value)
Definition: effect.c:6640
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShader(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6878
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsRasterizer(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9755
static void pres_movc(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:717
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix(ID3D10EffectVariable *iface)
Definition: effect.c:5749
static const struct ID3D10EffectVtbl d3d10_effect_vtbl
Definition: effect.c:4965
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsShader(ID3D10EffectBlendVariable *iface)
Definition: effect.c:9018
static BOOL STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_IsValid(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7783
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsRasterizer(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9516
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsMatrix(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9221
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsMatrix(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9701
static void pres_sqrt(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:304
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsRenderTargetView(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8371
static void set_shader_resource_variable(ID3D10ShaderResourceView **src, ID3D10ShaderResourceView **dst)
Definition: effect.c:7762
static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetBackingStore(ID3D10EffectSamplerVariable *iface, UINT index, D3D10_SAMPLER_DESC *desc)
Definition: effect.c:9803
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName(ID3D10EffectVariable *iface, const char *name)
Definition: effect.c:5601
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsSampler(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6111
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_SetRawValue(ID3D10EffectDepthStencilVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:9287
static BOOL STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_IsValid(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9387
static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRenderTargetArray(ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **views, UINT offset, UINT count)
Definition: effect.c:8217
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsScalar(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9450
static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_SetRawValue(ID3D10EffectBlendVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:9048
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencilView(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6528
static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer *iface, void *data, UINT offset, UINT count)
Definition: effect.c:6117
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsDepthStencil(ID3D10EffectBlendVariable *iface)
Definition: effect.c:9030
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable *iface, float *values, UINT offset, UINT count)
Definition: effect.c:7010
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsMatrix(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8353
static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetDesc(ID3D10EffectRenderTargetViewVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:8061
static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
Definition: effect.c:4560
static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer *iface, ID3D10ShaderResourceView *view)
Definition: effect.c:6163
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberBySemantic(ID3D10EffectDepthStencilVariable *iface, const char *semantic)
Definition: effect.c:9191
static void pres_max(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:412
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsScalar(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9689
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetElement(ID3D10EffectDepthStencilVariable *iface, UINT index)
Definition: effect.c:9197
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencil(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6099
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencil(ID3D10EffectVariable *iface)
Definition: effect.c:5852
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetDesc(ID3D10EffectMatrixVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:7271
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsSampler(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9761
static struct d3d10_effect_pass null_pass
Definition: effect.c:73
static void read_variable_array_from_buffer(struct d3d10_effect_variable *variable, void *dst, D3D_SHADER_VARIABLE_TYPE dst_type, unsigned int offset, unsigned int count)
Definition: effect.c:6383
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:6908
static void pres_sin(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:259
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsShaderResource(ID3D10EffectVariable *iface)
Definition: effect.c:5775
static struct d3d10_effect_variable * impl_from_ID3D10EffectScalarVariable(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6424
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_shader_variable_GetParentConstantBuffer(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8560
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsScalar(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8341
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsBlend(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7900
static struct d3d10_effect_type anonymous_vs_type
Definition: effect.c:117
static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetStringArray(ID3D10EffectStringVariable *iface, const char **strs, UINT offset, UINT count)
Definition: effect.c:7720
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsDepthStencil(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8626
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByIndex(ID3D10EffectMatrixVariable *iface, UINT index)
Definition: effect.c:7277
static void pres_rcp(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:214
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass *iface, const char *name)
Definition: effect.c:5305
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetAnnotationByIndex(ID3D10EffectDepthStencilVariable *iface, UINT index)
Definition: effect.c:9167
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberBySemantic(ID3D10EffectRasterizerVariable *iface, const char *semantic)
Definition: effect.c:9432
static char anonymous_vertexshader_name[]
Definition: effect.c:114
static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_SetRawValue(ID3D10EffectSamplerVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:9767
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsScalar(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7319
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable *iface, int *values, UINT offset, UINT count)
Definition: effect.c:6999
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsShader(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7894
static struct d3d10_effect_type * get_fx10_type(struct d3d10_effect *effect, const char *data, size_t data_size, uint32_t offset)
Definition: effect.c:2121
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetDepthStencil(ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView *view)
Definition: effect.c:8433
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsVector(ID3D10EffectStringVariable *iface)
Definition: effect.c:7615
static HRESULT fxlvm_chunk_handler(const struct vkd3d_shader_dxbc_section_desc *section, struct d3d10_preshader_parse_context *ctx)
Definition: effect.c:2848
static struct d3d10_effect * impl_from_ID3D10EffectPool(ID3D10EffectPool *iface)
Definition: effect.c:37
static BOOL STDMETHODCALLTYPE d3d10_effect_variable_IsValid(ID3D10EffectVariable *iface)
Definition: effect.c:5542
static struct d3d10_effect_type null_type
Definition: effect.c:74
static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetRawValue(ID3D10EffectSamplerVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:9773
static struct d3d10_effect_variable anonymous_vs
Definition: effect.c:123
static BOOL STDMETHODCALLTYPE d3d10_effect_blend_variable_IsValid(ID3D10EffectBlendVariable *iface)
Definition: effect.c:8907
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsDepthStencil(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7906
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsShader(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8389
static HRESULT get_fx10_shader_resources(struct d3d10_effect_variable *v)
Definition: effect.c:1550
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsSampler(ID3D10EffectVariable *iface)
Definition: effect.c:5878
static struct d3d10_effect_technique * impl_from_ID3D10EffectTechnique(ID3D10EffectTechnique *iface)
Definition: effect.c:4989
static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl
Definition: effect.c:53
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberBySemantic(ID3D10EffectSamplerVariable *iface, const char *semantic)
Definition: effect.c:9671
static HRESULT parse_fx10_buffer(const char *data, size_t data_size, const char **ptr, BOOL local, struct d3d10_effect_variable *l)
Definition: effect.c:3796
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6094
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrix(ID3D10EffectMatrixVariable *iface, float *data)
Definition: effect.c:7422
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetResourceArray(ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resources, UINT offset, UINT count)
Definition: effect.c:7961
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetAnnotationByIndex(ID3D10EffectSamplerVariable *iface, UINT index)
Definition: effect.c:9647
static struct d3d10_effect_variable * impl_from_ID3D10EffectRenderTargetViewVariable(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8039
static BOOL STDMETHODCALLTYPE d3d10_effect_shader_variable_IsValid(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8503
static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
Definition: effect.c:4387
static BOOL d3d10_effect_read_numeric_value(uint32_t value, D3D_SHADER_VARIABLE_TYPE in_type, D3D_SHADER_VARIABLE_TYPE out_type, void *out_data, unsigned int out_idx)
Definition: effect.c:1287
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsShaderResource(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9474
static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:5891
static struct d3d10_effect_variable * impl_from_ID3D10EffectVariable(ID3D10EffectVariable *iface)
Definition: effect.c:133
static void pres_and(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:635
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsBlend(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9263
static float get_value_as_float(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_type)
Definition: effect.c:6267
const struct ID3D10EffectPoolVtbl d3d10_effect_pool_vtbl
Definition: effect.c:42
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetPixelShader(ID3D10EffectShaderVariable *iface, UINT index, ID3D10PixelShader **shader)
Definition: effect.c:8780
static struct d3d10_effect_variable * impl_from_ID3D10EffectDepthStencilVariable(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9140
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName(ID3D10EffectVariable *iface, const char *name)
Definition: effect.c:5632
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_GetAnnotationByIndex(ID3D10EffectStringVariable *iface, UINT index)
Definition: effect.c:7567
static void pres_ushr(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:703
static void pres_ishr(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:690
static struct d3d10_effect_type * impl_from_ID3D10EffectType(ID3D10EffectType *iface)
Definition: effect.c:9859
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShaderResource(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7343
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsConstantBuffer(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9492
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex(ID3D10EffectDepthStencilViewVariable *iface, UINT index)
Definition: effect.c:8299
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsScalar(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7846
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsVector(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9215
static HRESULT d3d10_effect_add_prop_dependency(struct d3d10_effect_prop_dependencies *d, const struct d3d10_effect_prop_dependency *dep)
Definition: effect.c:2924
static struct d3d10_effect_variable * d3d10_array_get_element(struct d3d10_effect_variable *v, unsigned int index)
Definition: effect.c:143
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsRasterizer(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9275
static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer *iface, void *data, UINT offset, UINT count)
Definition: effect.c:6123
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsRenderTargetView(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9719
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByName(ID3D10EffectScalarVariable *iface, const char *name)
Definition: effect.c:6456
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetRawValue(ID3D10EffectScalarVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:6570
static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface, D3D10_PASS_DESC *desc)
Definition: effect.c:5169
static void pres_ftob(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:369
static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl
Definition: effect.c:68
static struct d3d10_effect_variable null_render_target_view_variable
Definition: effect.c:87
static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_IsValid(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9146
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsConstantBuffer(ID3D10EffectBlendVariable *iface)
Definition: effect.c:9012
static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:5992
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsVector(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6498
static HRESULT parse_fx10_preshader_instr(struct d3d10_preshader_parse_context *context, unsigned int *offset, const char **ptr, unsigned int data_size)
Definition: effect.c:2620
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsShader(ID3D10EffectStringVariable *iface)
Definition: effect.c:7657
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsSampler(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8638
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsConstantBuffer(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7361
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsConstantBuffer(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8383
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetParentConstantBuffer(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9203
static BOOL read_int8_value(uint32_t value, D3D_SHADER_VARIABLE_TYPE in_type, INT8 *out_data, unsigned int out_idx)
Definition: effect.c:1271
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsDepthStencilView(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9486
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetGeometryShader(ID3D10EffectShaderVariable *iface, UINT index, ID3D10GeometryShader **shader)
Definition: effect.c:8753
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetType(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7792
static BOOL read_float_value(uint32_t value, D3D_SHADER_VARIABLE_TYPE in_type, float *out_data, unsigned int out_idx)
Definition: effect.c:1227
static BOOL require_space(size_t offset, size_t count, size_t size, size_t data_size)
Definition: effect.c:1439
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetParentConstantBuffer(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8103
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable *iface, int *value)
Definition: effect.c:6933
static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl
Definition: effect.c:55
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsScalar(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6040
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_GetAnnotationByName(ID3D10EffectShaderVariable *iface, const char *name)
Definition: effect.c:8530
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsString(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6510
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8335
static struct d3d10_effect_variable * d3d10_effect_get_buffer_by_index(struct d3d10_effect *effect, unsigned int index)
Definition: effect.c:4688
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsBlend(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8163
static void pres_atan2(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:439
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetParentConstantBuffer(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6034
static void pres_utof(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:348
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetRawValue(ID3D10EffectDepthStencilViewVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:8425
static HRESULT d3d10_reg_table_allocate(struct d3d10_reg_table *table, unsigned int count)
Definition: effect.c:893
static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBackingStore(ID3D10EffectBlendVariable *iface, UINT index, D3D10_BLEND_DESC *desc)
Definition: effect.c:9084
static const struct preshader_op_info preshader_ops[]
Definition: effect.c:761
static struct d3d10_effect_variable * d3d10_effect_get_variable_by_name(const struct d3d10_effect *effect, const char *name)
Definition: effect.c:1524
static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:5926
static struct d3d10_effect_variable null_scalar_variable
Definition: effect.c:79
static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, size_t data_size)
Definition: effect.c:4230
static HRESULT d3d10_effect_variable_get_raw_value(struct d3d10_effect_variable *v, void *data, unsigned int offset, unsigned int count)
Definition: effect.c:1202
static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface, D3D10_PASS_SHADER_DESC *desc)
Definition: effect.c:5241
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable *iface, BOOL *value)
Definition: effect.c:6684
static void pres_log(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:241
#define TAG_FXLC
Definition: effect.c:33
static BOOL d3d_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
Definition: effect.c:1413
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetShaderDesc(ID3D10EffectShaderVariable *iface, UINT index, D3D10_EFFECT_SHADER_DESC *desc)
Definition: effect.c:8691
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_SetRawValue(ID3D10EffectShaderVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:8644
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsBlend(ID3D10EffectVariable *iface)
Definition: effect.c:5840
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberByIndex(ID3D10EffectSamplerVariable *iface, UINT index)
Definition: effect.c:9659
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_GetAnnotationByIndex(ID3D10EffectBlendVariable *iface, UINT index)
Definition: effect.c:8928
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex(ID3D10EffectVariable *iface, UINT index)
Definition: effect.c:5611
static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetString(ID3D10EffectStringVariable *iface, const char **str)
Definition: effect.c:7701
static BOOL get_value_as_bool(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_type)
Definition: effect.c:6229
static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6767
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetElement(ID3D10EffectConstantBuffer *iface, UINT index)
Definition: effect.c:6028
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable *iface, float *values, UINT offset, UINT count)
Definition: effect.c:7043
static HRESULT parse_fx10_annotations(const char *data, size_t data_size, const char **ptr, struct d3d10_effect *effect, struct d3d10_effect_annotations *annotations)
Definition: effect.c:2406
static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique *iface, D3D10_STATE_BLOCK_MASK *mask)
Definition: effect.c:5133
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_vector_variable_GetType(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6776
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsDepthStencilView(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8145
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsScalar(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8109
static ULONG STDMETHODCALLTYPE d3d10_effect_pool_AddRef(ID3D10EffectPool *iface)
Definition: effect.c:10057
static HRESULT STDMETHODCALLTYPE d3d10_effect_pool_QueryInterface(ID3D10EffectPool *iface, REFIID riid, void **object)
Definition: effect.c:10038
static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass *iface, D3D10_STATE_BLOCK_MASK *mask)
Definition: effect.c:5503
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberByName(ID3D10EffectDepthStencilViewVariable *iface, const char *name)
Definition: effect.c:8317
static struct d3d10_effect_variable null_blend_variable
Definition: effect.c:93
static void pres_acos(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:286
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsShaderResource(ID3D10EffectStringVariable *iface)
Definition: effect.c:7633
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsVector(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8572
static BOOL STDMETHODCALLTYPE d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:5978
static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl
Definition: effect.c:58
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsShaderResource(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7870
static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p)
Definition: effect.c:4469
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByName(ID3D10EffectMatrixVariable *iface, const char *name)
Definition: effect.c:7295
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetDesc(ID3D10EffectShaderVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:8518
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsRasterizer(ID3D10EffectBlendVariable *iface)
Definition: effect.c:9036
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTranspose(ID3D10EffectMatrixVariable *iface, float *data)
Definition: effect.c:7466
static void pres_min(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:403
static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer *iface, ID3D10Buffer **buffer)
Definition: effect.c:6138
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_variable_GetType(ID3D10EffectVariable *iface)
Definition: effect.c:5549
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTranspose(ID3D10EffectMatrixVariable *iface, float *data)
Definition: effect.c:7455
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, const char *name)
Definition: effect.c:4780
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsString(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6848
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberByIndex(ID3D10EffectShaderVariable *iface, UINT index)
Definition: effect.c:8536
static char anonymous_geometryshader_name[]
Definition: effect.c:116
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsString(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8127
static void d3d10_effect_cleanup_so_decl(struct d3d10_effect_so_decl *so_decl)
Definition: effect.c:1617
HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT flags, ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3D10Effect **effect)
Definition: effect.c:10133
#define WINE_D3D10_TO_STR(x)
Definition: effect.c:1143
static void pres_imax(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:596
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsScalar(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8566
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetRawValue(ID3D10EffectMatrixVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:7403
static struct d3d10_effect_variable null_depth_stencil_variable
Definition: effect.c:95
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShader(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6088
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShader(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6540
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsShaderResource(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8133
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:5987
static struct d3d10_effect_variable null_variable
Definition: effect.c:77
static void pres_buge(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:541
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsRenderTargetView(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7876
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetParentConstantBuffer(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9444
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsConstantBuffer(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6534
static const struct d3d10_effect_state_storage_info * get_storage_info(D3D_SHADER_VARIABLE_TYPE id)
Definition: effect.c:2485
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsScalar(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6830
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetType(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7265
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberByName(ID3D10EffectShaderVariable *iface, const char *name)
Definition: effect.c:8542
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByName(ID3D10EffectConstantBuffer *iface, const char *name)
Definition: effect.c:6004
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_vector_variable_GetParentConstantBuffer(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6824
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable *iface, int *values, UINT offset, UINT count)
Definition: effect.c:6651
static void pres_imul(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:471
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface, UINT index)
Definition: effect.c:4703
static struct d3d10_effect_variable * impl_from_ID3D10EffectVectorVariable(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6762
static void set_variable_vtbl(struct d3d10_effect_variable *v)
Definition: effect.c:2161
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsBlend(ID3D10EffectBlendVariable *iface)
Definition: effect.c:9024
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsConstantBuffer(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9731
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_blend_variable_GetParentConstantBuffer(ID3D10EffectBlendVariable *iface)
Definition: effect.c:8964
static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRenderTargetArray(ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **views, UINT offset, UINT count)
Definition: effect.c:8225
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByIndex(ID3D10EffectVectorVariable *iface, UINT index)
Definition: effect.c:6800
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetOutputSignatureElementDesc(ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index, D3D10_SIGNATURE_PARAMETER_DESC *desc)
Definition: effect.c:8843
static const char * debug_d3d10_shader_variable_class(D3D10_SHADER_VARIABLE_CLASS c)
Definition: effect.c:1145
static void write_matrix_variable_array_to_buffer(struct d3d10_effect_variable *variable, void *src_data, unsigned int offset, unsigned int count, BOOL transpose)
Definition: effect.c:7136
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberBySemantic(ID3D10EffectRenderTargetViewVariable *iface, const char *semantic)
Definition: effect.c:8091
static void pres_mov(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:196
static struct d3d10_effect_variable * d3d10_effect_get_buffer_by_name(struct d3d10_effect *effect, const char *name)
Definition: effect.c:1509
static int d3d10_effect_type_compare(const void *key, const struct wine_rb_entry *entry)
Definition: effect.c:10089
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetAnnotationByIndex(ID3D10EffectShaderResourceVariable *iface, UINT index)
Definition: effect.c:7804
static BOOL fx10_get_string(const char *data, size_t data_size, uint32_t offset, const char **s, size_t *l)
Definition: effect.c:1444
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberBySemantic(ID3D10EffectVectorVariable *iface, const char *semantic)
Definition: effect.c:6812
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsVector(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8347
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_string_variable_GetParentConstantBuffer(ID3D10EffectStringVariable *iface)
Definition: effect.c:7603
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDepthStencil(ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **view)
Definition: effect.c:8441
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetRawValue(ID3D10EffectScalarVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:6576
static struct d3d10_effect_variable null_shader_resource_variable
Definition: effect.c:104
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByIndex(ID3D10EffectMatrixVariable *iface, UINT index)
Definition: effect.c:7289
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsScalar(ID3D10EffectBlendVariable *iface)
Definition: effect.c:8970
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetElement(ID3D10EffectScalarVariable *iface, UINT index)
Definition: effect.c:6480
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface, float *data, UINT offset, UINT count)
Definition: effect.c:7488
static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl
Definition: effect.c:60
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencilView(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7355
static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface)
Definition: effect.c:5160
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberByIndex(ID3D10EffectDepthStencilVariable *iface, UINT index)
Definition: effect.c:9179
static ID3D10ShaderResourceView * null_srvs[D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT]
Definition: effect.c:102
static void read_variable_from_buffer(struct d3d10_effect_variable *variable, void *dst, D3D_SHADER_VARIABLE_TYPE dst_type)
Definition: effect.c:6374
static struct d3d10_effect_variable * d3d10_effect_get_variable_by_semantic(const struct d3d10_effect *effect, const char *semantic)
Definition: effect.c:4805
HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *data, SIZE_T data_size, UINT fx_flags, ID3D10Device *device, ID3D10EffectPool **effect_pool)
Definition: effect.c:10196
static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetDesc(ID3D10EffectBlendVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:8922
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsRenderTargetView(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8596
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByIndex(ID3D10EffectVariable *iface, UINT index)
Definition: effect.c:5591
static void pres_ftou(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:357
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsVector(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6046
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsString(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7864
static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl
Definition: effect.c:67
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRasterizer(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6558
static void pres_bieq(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:513
#define TAG_CTAB
Definition: effect.c:35
static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl
Definition: effect.c:57
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetBackingStore(ID3D10EffectDepthStencilVariable *iface, UINT index, D3D10_DEPTH_STENCIL_DESC *desc)
Definition: effect.c:9323
static const D3D10_RASTERIZER_DESC default_rasterizer_desc
Definition: effect.c:1075
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsRenderTargetView(ID3D10EffectBlendVariable *iface)
Definition: effect.c:9000
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsConstantBuffer(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7888
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsSampler(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6564
static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetDesc(ID3D10EffectRasterizerVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:9402
static void pres_umax(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:622
static void pres_cos(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:268
static struct d3d10_effect_technique null_technique
Definition: effect.c:72
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsShader(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9257
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable *iface, float *value)
Definition: effect.c:6595
static struct ID3D10EffectTechnique *STDMETHODCALLTYPE d3d10_effect_GetTechniqueByName(ID3D10Effect *iface, const char *name)
Definition: effect.c:4881
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencil(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6890
static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_IsValid(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8277
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetParentConstantBuffer(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7840
static BOOL fx10_copy_string(const char *data, size_t data_size, DWORD offset, char **s)
Definition: effect.c:1471
static void pres_div(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:448
d3d10_reg_table_type
Definition: effect.c:845
@ D3D10_REG_TABLE_TEMP
Definition: effect.c:849
@ D3D10_REG_TABLE_RESULT
Definition: effect.c:848
@ D3D10_REG_TABLE_CB
Definition: effect.c:847
@ D3D10_REG_TABLE_CONSTANTS
Definition: effect.c:846
@ D3D10_REG_TABLE_COUNT
Definition: effect.c:850
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable *iface, BOOL *value)
Definition: effect.c:6922
static struct d3d10_effect_variable null_matrix_variable
Definition: effect.c:83
static void pres_itof(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:339
static BOOL STDMETHODCALLTYPE d3d10_effect_technique_IsValid(ID3D10EffectTechnique *iface)
Definition: effect.c:4994
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsRasterizer(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8407
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsVector(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7852
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberByName(ID3D10EffectRenderTargetViewVariable *iface, const char *name)
Definition: effect.c:8085
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray(ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **views, UINT offset, UINT count)
Definition: effect.c:8457
static void d3d10_effect_type_member_destroy(struct d3d10_effect_type_member *typem)
Definition: effect.c:4002
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsVector(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9456
static struct d3d10_effect_type anonymous_ps_type
Definition: effect.c:119
static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6429
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:6914
static void pres_atan(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:295
static HRESULT STDMETHODCALLTYPE d3d10_effect_type_GetDesc(ID3D10EffectType *iface, D3D10_EFFECT_TYPE_DESC *desc)
Definition: effect.c:9873
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRasterizer(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6896
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsMatrix(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8578
static void parse_fx10_default_value(const char **ptr, struct d3d10_effect_variable *var)
Definition: effect.c:3416
static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBlendState(ID3D10EffectBlendVariable *iface, UINT index, ID3D10BlendState **blend_state)
Definition: effect.c:9062
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsBlend(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8620
static BOOL is_var_shared(const struct d3d10_effect_variable *v)
Definition: effect.c:4698
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsMatrix(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8121
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsDepthStencilView(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9725
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsShaderResource(ID3D10EffectBlendVariable *iface)
Definition: effect.c:8994
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsShader(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8157
static enum d3d10_effect_container_type get_var_container_type(const struct d3d10_effect_variable *v)
Definition: effect.c:174
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsString(ID3D10EffectBlendVariable *iface)
Definition: effect.c:8988
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeBySemantic(ID3D10EffectType *iface, const char *semantic)
Definition: effect.c:9956
static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl
Definition: effect.c:63
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetType(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8055
static BOOL STDMETHODCALLTYPE d3d10_effect_string_variable_IsValid(ID3D10EffectStringVariable *iface)
Definition: effect.c:7546
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsDepthStencil(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9269
static void write_matrix_to_buffer(struct d3d10_effect_variable *variable, void *dst_void, struct d3d10_matrix *src, BOOL transpose)
Definition: effect.c:7097
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsConstantBuffer(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6872
static void pres_bilt(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:485
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsShader(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8614
static void d3d10_effect_variable_update_buffer_offsets(struct d3d10_effect_variable *v, unsigned int offset)
Definition: effect.c:3444
static void pres_udiv(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:569
static void pres_or(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:649
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable *iface, BOOL value)
Definition: effect.c:6673
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsDepthStencil(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8401
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrix(ID3D10EffectMatrixVariable *iface, float *data)
Definition: effect.c:7411
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsDepthStencilView(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8377
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsBlend(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9504
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetParentConstantBuffer(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9683
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetVertexShader(ID3D10EffectShaderVariable *iface, UINT index, ID3D10VertexShader **shader)
Definition: effect.c:8726
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_variable_AsConstantBuffer(ID3D10EffectVariable *iface)
Definition: effect.c:5814
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShader(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7367
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsBlend(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6546
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByIndex(ID3D10EffectConstantBuffer *iface, UINT index)
Definition: effect.c:6010
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetElement(ID3D10EffectMatrixVariable *iface, UINT index)
Definition: effect.c:7307
static const char * debug_d3d10_shader_variable_type(D3D10_SHADER_VARIABLE_TYPE t)
Definition: effect.c:1161
static void write_variable_array_to_buffer(struct d3d10_effect_variable *variable, void *src, D3D_SHADER_VARIABLE_TYPE src_type, unsigned int offset, unsigned int count)
Definition: effect.c:6333
static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
Definition: effect.c:4645
static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetRawValue(ID3D10EffectStringVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:7693
static BOOL is_object_property_type_matching(const struct d3d10_effect_state_property_info *property_info, const struct d3d10_effect_variable *v)
Definition: effect.c:2598
static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_SetRawValue(ID3D10EffectRasterizerVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:9528
static void d3d10_effect_pass_set_shader(struct d3d10_effect_pass *pass, const struct d3d10_effect_pass_shader_desc *shader_desc)
Definition: effect.c:5448
static void pres_not(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:326
static struct d3d10_effect_variable * d3d10_get_state_variable(struct d3d10_effect_variable *v, unsigned int index, const struct d3d10_effect_var_array *array)
Definition: effect.c:150
static char anonymous_name[]
Definition: effect.c:113
#define TAG_CLI4
Definition: effect.c:34
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsString(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9227
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsScalar(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9209
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsRenderTargetView(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9239
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberByName(ID3D10EffectShaderResourceVariable *iface, const char *name)
Definition: effect.c:7822
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_shader_variable_GetType(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8512
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberByIndex(ID3D10EffectRenderTargetViewVariable *iface, UINT index)
Definition: effect.c:8079
static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
Definition: effect.c:4636
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsString(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7337
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsConstantBuffer(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8608
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByName(ID3D10EffectConstantBuffer *iface, const char *name)
Definition: effect.c:6016
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetDepthStencilState(ID3D10EffectDepthStencilVariable *iface, UINT index, ID3D10DepthStencilState **depth_stencil_state)
Definition: effect.c:9301
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable *iface, int value)
Definition: effect.c:6629
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByName(ID3D10EffectMatrixVariable *iface, const char *name)
Definition: effect.c:7283
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsVector(ID3D10EffectBlendVariable *iface)
Definition: effect.c:8976
static void read_matrix_from_buffer(struct d3d10_effect_variable *variable, void *src_void, struct d3d10_matrix *dst, BOOL transpose)
Definition: effect.c:7175
static void pres_exp(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:232
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberByIndex(ID3D10EffectBlendVariable *iface, UINT index)
Definition: effect.c:8940
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable *iface, int *values, UINT offset, UINT count)
Definition: effect.c:6662
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsDepthStencil(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8169
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByName(ID3D10EffectType *iface, const char *name)
Definition: effect.c:9926
d3d10_effect_container_type
Definition: effect.c:165
@ D3D10_C_NONE
Definition: effect.c:166
@ D3D10_C_PASS
Definition: effect.c:167
@ D3D10_C_SAMPLER
Definition: effect.c:171
@ D3D10_C_DEPTHSTENCIL
Definition: effect.c:169
@ D3D10_C_RASTERIZER
Definition: effect.c:168
@ D3D10_C_BLEND
Definition: effect.c:170
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsConstantBuffer(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8151
static void pres_iadd(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:457
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetDesc(ID3D10EffectScalarVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:6444
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetType(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9396
static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context)
Definition: effect.c:4011
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetAnnotationByName(ID3D10EffectSamplerVariable *iface, const char *name)
Definition: effect.c:9653
static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, D3D_SHADER_VARIABLE_TYPE basetype, struct d3d10_effect_anonymous_shader *s)
Definition: effect.c:2432
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsString(ID3D10EffectStringVariable *iface)
Definition: effect.c:7627
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByIndex(ID3D10EffectType *iface, UINT index)
Definition: effect.c:9905
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsBlend(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8395
static struct d3d10_effect_variable * impl_from_ID3D10EffectRasterizerVariable(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9381
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetType(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9155
static HRESULT create_state_object(struct d3d10_effect_variable *v)
Definition: effect.c:3525
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsRasterizer(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7912
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetAnnotationByIndex(ID3D10EffectRenderTargetViewVariable *iface, UINT index)
Definition: effect.c:8067
static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
Definition: effect.c:4478
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable *iface, float *value)
Definition: effect.c:6944
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetRawValue(ID3D10EffectShaderResourceVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:7930
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberByName(ID3D10EffectSamplerVariable *iface, const char *name)
Definition: effect.c:9665
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberByIndex(ID3D10EffectRasterizerVariable *iface, UINT index)
Definition: effect.c:9420
static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_GetDesc(ID3D10EffectTechnique *iface, D3D10_TECHNIQUE_DESC *desc)
Definition: effect.c:5003
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsString(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6058
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_GetElement(ID3D10EffectVectorVariable *iface, UINT index)
Definition: effect.c:6818
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic(ID3D10EffectDepthStencilViewVariable *iface, const char *semantic)
Definition: effect.c:8323
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetResource(ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView *resource)
Definition: effect.c:7938
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetAnnotationByName(ID3D10EffectDepthStencilViewVariable *iface, const char *name)
Definition: effect.c:8305
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsBlend(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9743
static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, size_t data_size)
Definition: effect.c:4092
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberByName(ID3D10EffectDepthStencilVariable *iface, const char *name)
Definition: effect.c:9185
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberBySemantic(ID3D10EffectScalarVariable *iface, const char *semantic)
Definition: effect.c:6474
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetDesc(ID3D10EffectDepthStencilVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:9161
static void pres_dotswiz(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:737
static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetRasterizerState(ID3D10EffectRasterizerVariable *iface, UINT index, ID3D10RasterizerState **rasterizer_state)
Definition: effect.c:9542
static struct ID3D10EffectTechnique *STDMETHODCALLTYPE d3d10_effect_GetTechniqueByIndex(ID3D10Effect *iface, UINT index)
Definition: effect.c:4860
static const struct d3d10_effect_state_property_info property_infos[]
Definition: effect.c:1008
static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_variable *l)
Definition: effect.c:4497
static HRESULT parse_fx10_ctab(void *ctx, const char *data, unsigned int data_size)
Definition: effect.c:2762
static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRawValue(ID3D10EffectRenderTargetViewVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:8187
static ID3D10EffectVariable * d3d10_annotation_get_by_index(const struct d3d10_effect_annotations *annotations, unsigned int index)
Definition: effect.c:5029
static HRESULT parse_fx10_annotation(const char *data, size_t data_size, const char **ptr, struct d3d10_effect_variable *a)
Definition: effect.c:2374
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsConstantBuffer(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6082
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsVector(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8115
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsDepthStencil(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9749
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsRenderTargetView(ID3D10EffectVariable *iface)
Definition: effect.c:5788
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsRasterizer(ID3D10EffectStringVariable *iface)
Definition: effect.c:7675
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsRenderTargetView(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8139
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsString(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9707
static HRESULT d3d10_create_effect(void *data, SIZE_T data_size, ID3D10Device *device, struct d3d10_effect *pool, unsigned int flags, struct d3d10_effect **effect)
Definition: effect.c:10097
static void pres_xor(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:663
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic(ID3D10EffectVariable *iface, const char *semantic)
Definition: effect.c:5662
static void apply_shader_resources(ID3D10Device *device, struct d3d10_effect_variable *v)
Definition: effect.c:5351
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberBySemantic(ID3D10EffectConstantBuffer *iface, const char *semantic)
Definition: effect.c:6022
static void set_sampler(ID3D10Device *device, D3D10_SHADER_VARIABLE_TYPE shader_type, struct d3d10_effect_variable *v, unsigned int bind_point)
Definition: effect.c:5328
static const struct preshader_op_info * d3d10_effect_get_op_info(int opcode)
Definition: effect.c:821
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetElement(ID3D10EffectRasterizerVariable *iface, UINT index)
Definition: effect.c:9438
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShaderResource(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6854
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRasterizer(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6105
static ID3D10Effect *STDMETHODCALLTYPE d3d10_effect_pool_AsEffect(ID3D10EffectPool *iface)
Definition: effect.c:10069
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable *iface, float *values, UINT offset, UINT count)
Definition: effect.c:6618
static HRESULT parse_fx10_object_variable(const char *data, size_t data_size, const char **ptr, BOOL shared_type_desc, struct d3d10_effect_variable *v)
Definition: effect.c:3564
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsShader(ID3D10EffectVariable *iface)
Definition: effect.c:5827
static struct d3d10_effect * unsafe_impl_from_ID3D10EffectPool(ID3D10EffectPool *iface)
Definition: effect.c:43
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetRawValue(ID3D10EffectShaderResourceVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:7924
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByIndex(ID3D10EffectScalarVariable *iface, UINT index)
Definition: effect.c:6462
static void pres_mul(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:430
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberBySemantic(ID3D10EffectBlendVariable *iface, const char *semantic)
Definition: effect.c:8952
static void pres_imin(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:583
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetType(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6438
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable *iface, BOOL *values, UINT offset, UINT count)
Definition: effect.c:7021
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_variable_GetElement(ID3D10EffectVariable *iface, UINT index)
Definition: effect.c:5692
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberByName(ID3D10EffectBlendVariable *iface, const char *name)
Definition: effect.c:8946
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable *iface, BOOL *values, UINT offset, UINT count)
Definition: effect.c:6695
static BOOL STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_IsValid(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8045
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRasterizer(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7385
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsShader(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9737
static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRawValue(ID3D10EffectRenderTargetViewVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:8193
static ULONG STDMETHODCALLTYPE d3d10_effect_pool_Release(ID3D10EffectPool *iface)
Definition: effect.c:10063
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberBySemantic(ID3D10EffectStringVariable *iface, const char *semantic)
Definition: effect.c:7591
static void pres_floor(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:382
static float * d3d10_effect_preshader_get_reg_ptr(const struct d3d10_effect_preshader *p, enum d3d10_reg_table_type regt, unsigned int offset)
Definition: effect.c:913
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable *iface, BOOL *values, UINT offset, UINT count)
Definition: effect.c:6706
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsVector(ID3D10EffectVariable *iface)
Definition: effect.c:5736
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsScalar(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6492
static void pres_ineg(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:313
static HRESULT parse_fx10_technique(const char *data, size_t data_size, const char **ptr, struct d3d10_effect_technique *t)
Definition: effect.c:3335
static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetDesc(ID3D10EffectSamplerVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:9641
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsMatrix(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6052
static struct d3d10_effect_variable null_shader_variable
Definition: effect.c:91
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetParentConstantBuffer(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6486
static HRESULT parse_fx10_shader(const char *data, size_t data_size, uint32_t offset, struct d3d10_effect_variable *v)
Definition: effect.c:1732
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencilView(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6866
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRenderTargetView(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6522
static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface)
Definition: effect.c:4956
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByName(ID3D10EffectVectorVariable *iface, const char *name)
Definition: effect.c:6806
static struct ID3D10EffectScalarVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsScalar(ID3D10EffectStringVariable *iface)
Definition: effect.c:7609
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsSampler(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6902
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetElement(ID3D10EffectSamplerVariable *iface, UINT index)
Definition: effect.c:9677
static HRESULT parse_fx10_numeric_variable(const char *data, size_t data_size, const char **ptr, BOOL local, struct d3d10_effect_variable *v)
Definition: effect.c:3458
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsBlend(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7373
static HRESULT parse_fx10_cli4(void *ctx, const char *data, unsigned int data_size)
Definition: effect.c:2729
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetElement(ID3D10EffectShaderResourceVariable *iface, UINT index)
Definition: effect.c:7834
static void pres_ceil(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:393
static BOOL STDMETHODCALLTYPE d3d10_effect_IsValid(ID3D10Effect *iface)
Definition: effect.c:4629
static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer *iface, ID3D10Buffer *buffer)
Definition: effect.c:6130
static void d3d10_effect_get_desc(const struct d3d10_effect *effect, D3D10_EFFECT_DESC *desc)
Definition: effect.c:4657
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetRawValue(ID3D10EffectMatrixVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:7397
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByIndex(ID3D10EffectConstantBuffer *iface, UINT index)
Definition: effect.c:5998
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable *iface, int *values, UINT offset, UINT count)
Definition: effect.c:7032
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsSampler(ID3D10EffectBlendVariable *iface)
Definition: effect.c:9042
static HRESULT d3d10_effect_preshader_eval(struct d3d10_effect_preshader *p)
Definition: effect.c:928
static void pres_asin(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:277
static struct d3d10_effect_variable * impl_from_ID3D10EffectConstantBuffer(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:5973
static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetDesc(ID3D10EffectVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:5558
static const char *STDMETHODCALLTYPE d3d10_effect_type_GetMemberSemantic(ID3D10EffectType *iface, UINT index)
Definition: effect.c:10006
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface, float *data, UINT offset, UINT count)
Definition: effect.c:7477
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_variable_GetParentConstantBuffer(ID3D10EffectVariable *iface)
Definition: effect.c:5713
static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl
Definition: effect.c:69
static HRESULT copy_variableinfo_from_type(struct d3d10_effect_variable *v)
Definition: effect.c:2248
static struct d3d10_effect_variable * impl_from_ID3D10EffectStringVariable(ID3D10EffectStringVariable *iface)
Definition: effect.c:7541
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsDepthStencilView(ID3D10EffectBlendVariable *iface)
Definition: effect.c:9006
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_blend_variable_GetType(ID3D10EffectBlendVariable *iface)
Definition: effect.c:8916
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencilView(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6076
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberByIndex(ID3D10EffectShaderResourceVariable *iface, UINT index)
Definition: effect.c:7816
static struct d3d10_effect * impl_from_ID3D10Effect(ID3D10Effect *iface)
Definition: effect.c:4527
static ULONG STDMETHODCALLTYPE d3d10_effect_AddRef(ID3D10Effect *iface)
Definition: effect.c:4550
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable *iface, float *values, UINT offset, UINT count)
Definition: effect.c:6607
static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface, D3D10_PASS_SHADER_DESC *desc)
Definition: effect.c:5268
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsBlend(ID3D10EffectStringVariable *iface)
Definition: effect.c:7663
static HRESULT create_buffer_object(struct d3d10_effect_variable *v)
Definition: effect.c:3753
static struct d3d10_effect_variable null_depth_stencil_view_variable
Definition: effect.c:89
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetAnnotationByIndex(ID3D10EffectRasterizerVariable *iface, UINT index)
Definition: effect.c:9408
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_GetElement(ID3D10EffectShaderVariable *iface, UINT index)
Definition: effect.c:8554
static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl
Definition: effect.c:59
static struct d3d10_effect_variable * impl_from_ID3D10EffectBlendVariable(ID3D10EffectBlendVariable *iface)
Definition: effect.c:8901
static struct d3d10_effect_type anonymous_gs_type
Definition: effect.c:121
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetRawValue(ID3D10EffectDepthStencilViewVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:8419
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface, const char *name)
Definition: effect.c:4723
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberByName(ID3D10EffectRasterizerVariable *iface, const char *name)
Definition: effect.c:9426
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDesc(ID3D10EffectDepthStencilViewVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:8293
static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl
Definition: effect.c:54
static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer *iface, ID3D10ShaderResourceView **view)
Definition: effect.c:6171
static BOOL STDMETHODCALLTYPE d3d10_effect_type_IsValid(ID3D10EffectType *iface)
Definition: effect.c:9864
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface, const char *semantic)
Definition: effect.c:4835
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_GetAnnotationByName(ID3D10EffectBlendVariable *iface, const char *name)
Definition: effect.c:8934
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsSampler(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9281
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsRenderTargetView(ID3D10EffectStringVariable *iface)
Definition: effect.c:7639
static void write_variable_to_buffer(struct d3d10_effect_variable *variable, void *src, D3D_SHADER_VARIABLE_TYPE src_type)
Definition: effect.c:6322
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRenderTargetView(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7349
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_GetElement(ID3D10EffectBlendVariable *iface, UINT index)
Definition: effect.c:8958
static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl
Definition: effect.c:62
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsString(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8359
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRenderTargetView(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6860
static HRESULT STDMETHODCALLTYPE d3d10_effect_pool_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
Definition: effect.c:10164
static void pres_bine(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:527
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsRenderTargetView(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9480
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsShaderResource(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9233
static HRESULT parse_fx10_variable_head(const char *data, size_t data_size, const char **ptr, struct d3d10_effect_variable *v)
Definition: effect.c:2341
static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(uint32_t t, BOOL is_object, uint32_t *flags)
Definition: effect.c:1832
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsString(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8584
static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size, const char **ptr, enum d3d10_effect_container_type container_type, struct d3d10_effect *effect, void *container, struct d3d10_effect_prop_dependencies *d)
Definition: effect.c:2935
static void pres_bige(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:499
static D3D10_SHADER_VARIABLE_CLASS d3d10_variable_class(uint32_t c, BOOL is_column_major)
Definition: effect.c:1818
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsMatrix(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9462
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetRawValue(ID3D10EffectDepthStencilVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:9293
static HRESULT d3d10_effect_parse_stream_output_declaration(const char *decl, struct d3d10_effect_so_decl *so_decl)
Definition: effect.c:1624
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_blend_variable_AsMatrix(ID3D10EffectBlendVariable *iface)
Definition: effect.c:8982
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShaderResource(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6516
static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetSampler(ID3D10EffectSamplerVariable *iface, UINT index, ID3D10SamplerState **sampler)
Definition: effect.c:9781
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsSampler(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7918
static void pres_add(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:421
static void pres_umin(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:609
static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
Definition: effect.c:5474
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsDepthStencilView(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8602
static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl
Definition: effect.c:56
static HRESULT d3d10_get_shader_variable(struct d3d10_effect_variable *v, UINT shader_index, struct d3d10_effect_shader_variable **s, D3D10_SHADER_VARIABLE_TYPE *basetype)
Definition: effect.c:8658
static struct d3d10_effect_variable anonymous_gs
Definition: effect.c:127
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsShaderResource(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9713
static void parse_fx10_set_default_numeric_value(const char **ptr, struct d3d10_effect_variable *v)
Definition: effect.c:3385
static const D3D10_DEPTH_STENCIL_DESC default_depth_stencil_desc
Definition: effect.c:1089
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass *iface, UINT index)
Definition: effect.c:5295
static void d3d10_effect_update_dependent_props(struct d3d10_effect_prop_dependencies *deps, void *container)
Definition: effect.c:1306
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_string_variable_AsConstantBuffer(ID3D10EffectStringVariable *iface)
Definition: effect.c:7651
static struct d3d10_effect_variable anonymous_ps
Definition: effect.c:125
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsSampler(ID3D10EffectStringVariable *iface)
Definition: effect.c:7681
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetAnnotationByName(ID3D10EffectShaderResourceVariable *iface, const char *name)
Definition: effect.c:7810
static struct d3d10_effect_variable null_rasterizer_variable
Definition: effect.c:97
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberByName(ID3D10EffectStringVariable *iface, const char *name)
Definition: effect.c:7585
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable *iface, float value)
Definition: effect.c:6584
static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl
Definition: effect.c:64
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsVector(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9695
static BOOL read_int32_value(uint32_t value, D3D_SHADER_VARIABLE_TYPE in_type, int *out_data, unsigned int out_idx)
Definition: effect.c:1250
static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
Definition: effect.c:4910
static char anonymous_pixelshader_name[]
Definition: effect.c:115
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_AsShaderResource(ID3D10EffectShaderVariable *iface)
Definition: effect.c:8590
static struct d3d10_effect_variable * d3d10_effect_get_variable_by_index(const struct d3d10_effect *effect, unsigned int index)
Definition: effect.c:4742
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsSampler(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8181
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencil(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7379
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsSampler(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8413
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable *iface, BOOL *value)
Definition: effect.c:6955
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_GetElement(ID3D10EffectStringVariable *iface, UINT index)
Definition: effect.c:7597
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetElement(ID3D10EffectRenderTargetViewVariable *iface, UINT index)
Definition: effect.c:8097
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByIndex(ID3D10EffectTechnique *iface, UINT index)
Definition: effect.c:5067
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberBySemantic(ID3D10EffectShaderVariable *iface, const char *semantic)
Definition: effect.c:8548
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsMatrix(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6842
static struct ID3D10EffectPass *STDMETHODCALLTYPE d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique *iface, UINT index)
Definition: effect.c:5087
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsString(ID3D10EffectVariable *iface)
Definition: effect.c:5762
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberBySemantic(ID3D10EffectMatrixVariable *iface, const char *semantic)
Definition: effect.c:7301
static void pres_dot(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:727
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsMatrix(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7858
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsDepthStencil(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9510
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsMatrix(ID3D10EffectStringVariable *iface)
Definition: effect.c:7621
static HRESULT d3d10_get_shader_variable_signature(struct d3d10_effect_variable *v, UINT shader_index, UINT element_index, BOOL output, D3D10_SIGNATURE_PARAMETER_DESC *desc)
Definition: effect.c:8807
static BOOL copy_name(const char *ptr, char **name)
Definition: effect.c:1496
static void read_matrix_variable_from_buffer(struct d3d10_effect_variable *variable, void *dst, BOOL transpose)
Definition: effect.c:7205
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_variable_GetAnnotationByIndex(ID3D10EffectShaderVariable *iface, UINT index)
Definition: effect.c:8524
static struct ID3D10EffectDepthStencilVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsDepthStencil(ID3D10EffectStringVariable *iface)
Definition: effect.c:7669
static void pres_rsq(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:250
static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl
Definition: effect.c:65
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_GetAnnotationByName(ID3D10EffectStringVariable *iface, const char *name)
Definition: effect.c:7573
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetElement(ID3D10EffectDepthStencilViewVariable *iface, UINT index)
Definition: effect.c:8329
void(* pres_op_func)(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:194
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsDepthStencilView(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9245
static void update_buffer(ID3D10Device *device, struct d3d10_effect_variable *v)
Definition: effect.c:5315
static struct d3d10_effect_variable null_local_buffer
Definition: effect.c:75
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsVector(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6836
static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRenderTarget(ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **view)
Definition: effect.c:8209
static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl
Definition: effect.c:66
static int __cdecl preshader_op_compare(const void *a, const void *b)
Definition: effect.c:814
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByName(ID3D10EffectTechnique *iface, const char *name)
Definition: effect.c:5077
static void pres_neg(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:205
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable *iface, int *value)
Definition: effect.c:6966
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetAnnotationByName(ID3D10EffectRenderTargetViewVariable *iface, const char *name)
Definition: effect.c:8073
static struct d3d10_effect_variable * impl_from_ID3D10EffectMatrixVariable(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7251
static void d3d10_effect_shader_variable_destroy(struct d3d10_effect_shader_variable *s, D3D10_SHADER_VARIABLE_TYPE type)
Definition: effect.c:4346
static void pres_frc(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:223
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixArray(ID3D10EffectMatrixVariable *iface, float *data, UINT offset, UINT count)
Definition: effect.c:7433
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetResource(ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resource)
Definition: effect.c:7953
static void write_matrix_variable_to_buffer(struct d3d10_effect_variable *variable, void *src_data, BOOL transpose)
Definition: effect.c:7127
static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRenderTarget(ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView *view)
Definition: effect.c:8201
static void pres_ishl(float **args, unsigned int n, const struct preshader_instr *instr)
Definition: effect.c:677
static struct d3d10_effect_variable null_string_variable
Definition: effect.c:85
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index)
Definition: effect.c:4762
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByName(ID3D10EffectVectorVariable *iface, const char *name)
Definition: effect.c:6794
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetResourceArray(ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resources, UINT offset, UINT count)
Definition: effect.c:7993
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsShaderResource(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8365
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsSampler(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7391
static struct d3d10_effect_variable * impl_from_ID3D10EffectDepthStencilViewVariable(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8271
static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetRawValue(ID3D10EffectRasterizerVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:9534
static const struct ID3D10EffectVtbl d3d10_effect_pool_effect_vtbl
Definition: effect.c:50
static BOOL is_object_property(const struct d3d10_effect_state_property_info *property_info)
Definition: effect.c:2579
static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
Definition: effect.c:4532
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetDesc(ID3D10EffectShaderResourceVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:7798
static int get_value_as_int(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_type)
Definition: effect.c:6248
static ID3D10EffectVariable * d3d10_annotation_get_by_name(const struct d3d10_effect_annotations *annotations, const char *name)
Definition: effect.c:5047
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberByIndex(ID3D10EffectDepthStencilViewVariable *iface, UINT index)
Definition: effect.c:8311
static BOOL d3d10_effect_types_match(const struct d3d10_effect_type *t1, const struct d3d10_effect_type *t2)
Definition: effect.c:4038
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsMatrix(ID3D10EffectScalarVariable *iface)
Definition: effect.c:6504
static HRESULT parse_fx10_pass(const char *data, size_t data_size, const char **ptr, struct d3d10_effect_pass *p)
Definition: effect.c:3288
static void get_vector_as_type(BYTE *dst_data, D3D_SHADER_VARIABLE_TYPE dst_type, BYTE *src_data, D3D_SHADER_VARIABLE_TYPE src_type, unsigned int count)
Definition: effect.c:6286
static BOOL STDMETHODCALLTYPE d3d10_effect_sampler_variable_IsValid(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9626
static void read_matrix_variable_array_from_buffer(struct d3d10_effect_variable *variable, void *dst_data, UINT offset, UINT count, BOOL transpose)
Definition: effect.c:7212
static struct ID3D10EffectSamplerVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsSampler(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9522
static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7256
static struct ID3D10EffectStringVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsString(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9468
static void d3d10_effect_annotations_destroy(struct d3d10_effect_annotations *a)
Definition: effect.c:4374
static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_SetRawValue(ID3D10EffectStringVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:7687
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetType(ID3D10EffectDepthStencilViewVariable *iface)
Definition: effect.c:8287
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_AsDepthStencilView(ID3D10EffectStringVariable *iface)
Definition: effect.c:7645
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable *iface, float *value)
Definition: effect.c:6977
static const D3D10_SAMPLER_DESC default_sampler_desc
Definition: effect.c:1114
static struct ID3D10EffectBlendVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_AsBlend(ID3D10EffectVectorVariable *iface)
Definition: effect.c:6884
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByIndex(ID3D10EffectVectorVariable *iface, UINT index)
Definition: effect.c:6788
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetType(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9635
static struct d3d10_effect_pass * impl_from_ID3D10EffectPass(ID3D10EffectPass *iface)
Definition: effect.c:5155
static struct ID3D10EffectShaderResourceVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShaderResource(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6064
static HRESULT parse_fx10_type(const char *data, size_t data_size, uint32_t offset, struct d3d10_effect_type *t)
Definition: effect.c:1896
HRESULT d3d10_effect_parse(struct d3d10_effect *effect, const void *data, SIZE_T data_size)
Definition: effect.c:4308
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetAnnotationByName(ID3D10EffectRasterizerVariable *iface, const char *name)
Definition: effect.c:9414
static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl
Definition: effect.c:61
static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray(ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **views, UINT offset, UINT count)
Definition: effect.c:8449
static struct d3d10_effect_variable * impl_from_ID3D10EffectShaderVariable(ID3D10EffectShaderVariable *iface)
Definition: effect.c:138
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencilView(ID3D10EffectVariable *iface)
Definition: effect.c:5801
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsConstantBuffer(ID3D10EffectDepthStencilVariable *iface)
Definition: effect.c:9251
#define TAG_FX10
Definition: effect.c:32
static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixArray(ID3D10EffectMatrixVariable *iface, float *data, UINT offset, UINT count)
Definition: effect.c:7444
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable *iface, BOOL *values, UINT offset, UINT count)
Definition: effect.c:6988
static struct d3d10_effect_variable * impl_from_ID3D10EffectShaderResourceVariable(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7777
static struct d3d10_effect_variable * impl_from_ID3D10EffectSamplerVariable(ID3D10EffectSamplerVariable *iface)
Definition: effect.c:9620
static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface, D3D10_PASS_SHADER_DESC *desc)
Definition: effect.c:5214
static struct ID3D10EffectPass *STDMETHODCALLTYPE d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique *iface, const char *name)
Definition: effect.c:5108
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberByIndex(ID3D10EffectStringVariable *iface, UINT index)
Definition: effect.c:7579
static HRESULT parse_fx10_fxlc(void *ctx, const char *data, unsigned int data_size)
Definition: effect.c:2689
static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetRawValue(ID3D10EffectBlendVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:9054
static struct d3d10_effect_variable null_sampler_variable
Definition: effect.c:99
static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetDesc(ID3D10EffectStringVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:7561
static BOOL read_value_list(const char *data, size_t data_size, uint32_t offset, D3D_SHADER_VARIABLE_TYPE out_type, unsigned int out_base, unsigned int out_size, void *out_data)
Definition: effect.c:2498
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByName(ID3D10EffectScalarVariable *iface, const char *name)
Definition: effect.c:6468
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
Definition: effect.c:6782
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByIndex(ID3D10EffectScalarVariable *iface, UINT index)
Definition: effect.c:6450
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetAnnotationByName(ID3D10EffectDepthStencilVariable *iface, const char *name)
Definition: effect.c:9173
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetInputSignatureElementDesc(ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index, D3D10_SIGNATURE_PARAMETER_DESC *desc)
Definition: effect.c:8825
static struct ID3D10EffectVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberBySemantic(ID3D10EffectShaderResourceVariable *iface, const char *semantic)
Definition: effect.c:7828
static struct ID3D10EffectDepthStencilViewVariable *STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsDepthStencilView(ID3D10EffectShaderResourceVariable *iface)
Definition: effect.c:7882
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsRasterizer(ID3D10EffectRenderTargetViewVariable *iface)
Definition: effect.c:8175
static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)
Definition: effect.c:4667
static struct ID3D10EffectMatrixVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsMatrix(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7331
static void d3d10_effect_clear_prop_dependencies(struct d3d10_effect_prop_dependencies *d)
Definition: effect.c:976
static HRESULT d3d10_effect_validate_shared_variable(const struct d3d10_effect *effect, const struct d3d10_effect_variable *v)
Definition: effect.c:4062
static struct ID3D10EffectShaderVariable *STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsShader(ID3D10EffectRasterizerVariable *iface)
Definition: effect.c:9498
static const char *STDMETHODCALLTYPE d3d10_effect_type_GetMemberName(ID3D10EffectType *iface, UINT index)
Definition: effect.c:9986
static struct ID3D10EffectVectorVariable *STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsVector(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7325
static struct ID3D10EffectType *STDMETHODCALLTYPE d3d10_effect_string_variable_GetType(ID3D10EffectStringVariable *iface)
Definition: effect.c:7555
static struct ID3D10EffectConstantBuffer *STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetParentConstantBuffer(ID3D10EffectMatrixVariable *iface)
Definition: effect.c:7313
static HRESULT parse_fx10_preshader(const char *data, size_t data_size, struct d3d10_effect *effect, struct d3d10_effect_preshader *preshader)
Definition: effect.c:2874
static struct ID3D10EffectRasterizerVariable *STDMETHODCALLTYPE d3d10_effect_variable_AsRasterizer(ID3D10EffectVariable *iface)
Definition: effect.c:5865
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetRawValue(ID3D10EffectShaderVariable *iface, void *data, UINT offset, UINT count)
Definition: effect.c:8650
static const D3D10_BLEND_DESC default_blend_desc
Definition: effect.c:1101
static struct ID3D10EffectRenderTargetViewVariable *STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRenderTargetView(ID3D10EffectConstantBuffer *iface)
Definition: effect.c:6070
HRESULT WINAPI D3DGetInputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob)
Definition: blob.c:421
HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3DBlob **blob)
Definition: blob.c:133
HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector)
Definition: reflection.c:1969
static uint32_t read_u32(const char **ptr)
Definition: utils.h:24
unsigned int idx
Definition: utils.c:40
#define stricmp(_String1, _String2)
Definition: compat.h:24
static const WCHAR version[]
Definition: asmname.c:66
container_type
Definition: metafile.c:150
#define __cdecl
Definition: corecrt.h:121
#define FLT_MAX
Definition: float.h:37
#define UINT_MAX
Definition: limits.h:27
_ACRTIMP float __cdecl asinf(float)
Definition: asinf.c:47
_ACRTIMP float __cdecl atanf(float)
Definition: atanf.c:47
_ACRTIMP float __cdecl acosf(float)
Definition: acosf.c:47
_ACRTIMP double __cdecl sin(double)
Definition: sin.c:21
_ACRTIMP float __cdecl fabsf(float)
_ACRTIMP double __cdecl floor(double)
Definition: floor.c:18
_ACRTIMP float __cdecl log2f(float)
Definition: stubs.c:68
_ACRTIMP double __cdecl cos(double)
Definition: cos.c:21
_ACRTIMP float __cdecl exp2f(float)
Definition: mathf.c:69
_ACRTIMP float __cdecl atan2f(float, float)
Definition: atan2f.c:51
_ACRTIMP int __cdecl atoi(const char *)
Definition: string.c:1720
_ACRTIMP char *__cdecl strchr(const char *, int)
Definition: string.c:3291
_ACRTIMP size_t __cdecl strnlen(const char *, size_t)
Definition: string.c:1607
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
_ACRTIMP char *__cdecl strstr(const char *, const char *)
Definition: string.c:3420
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324
static char * strdup(const char *buf)
Definition: string.h:83
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
return ret
Definition: mutex.c:147
r reserved
Definition: btrfs.c:3006
@ DXGI_FORMAT_R32G32B32A32_UINT
Definition: dxgiformat.idl:26
static void blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: ffp_gl.c:337
static void rasterizer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: ffp_gl.c:1230
static void depth_stencil(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: ffp_gl.c:766
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define local
Definition: zutil.h:30
FxCmResList * resources
FillMode
Definition: gdiplusenums.h:54
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble t
Definition: gl.h:2047
GLdouble n
Definition: glext.h:7729
GLenum GLuint texture
Definition: glext.h:6295
GLsizei stride
Definition: glext.h:5848
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
const GLubyte * c
Definition: glext.h:8905
GLuint sampler
Definition: glext.h:7283
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
Definition: glext.h:9515
GLuint shader
Definition: glext.h:6030
GLuint index
Definition: glext.h:6031
GLenum GLint GLuint mask
Definition: glext.h:6028
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLsizei GLboolean transpose
Definition: glext.h:6077
GLenum GLenum dst
Definition: glext.h:6340
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666
GLbitfield flags
Definition: glext.h:7161
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLenum variable
Definition: glext.h:9031
GLenum GLsizei len
Definition: glext.h:6722
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLuint id
Definition: glext.h:5910
const GLfloat * m
Definition: glext.h:10848
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned int UINT
Definition: sysinfo.c:13
#define gs
Definition: i386-dis.c:445
REFIID riid
Definition: atlbase.h:39
HRESULT GetResourceBindingDesc(UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc)
HRESULT GetDesc(D3D10_SHADER_DESC *desc)
ULONG Release()
nsrefcnt Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
#define d
Definition: ke_i.h:81
#define e
Definition: ke_i.h:82
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
UINT blob_size
Definition: effect.c:1153
const char * var
Definition: shader.c:5879
constants
Definition: resource.c:30
static ULONG ** element_count
Definition: exception.c:124
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
Definition: file.c:72
static vector_t * vs
Definition: server.c:146
static float(__cdecl *square_half_float)(float x
WORD unused[29]
Definition: crypt.c:1298
#define min(a, b)
Definition: monoChain.cc:55
#define ceilf(x)
Definition: mymath.h:62
#define floorf(x)
Definition: mymath.h:65
#define sqrtf(x)
Definition: mymath.h:59
long object_count
Definition: nc_alloc.cpp:37
#define uint32_t
Definition: nsiface.idl:61
long LONG
Definition: pedump.c:60
#define INT
Definition: polytest.cpp:20
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
static unsigned __int64 next
Definition: rand_nt.c:6
#define calloc
Definition: rosglue.h:14
const WCHAR * str
static __inline const char * debugstr_fourcc(unsigned int cc)
Definition: debug.h:397
#define wine_rb_entry
Definition: rbtree.h:404
#define WINE_RB_ENTRY_VALUE
Definition: rbtree.h:414
#define wine_rb_put
Definition: rbtree.h:410
#define wine_rb_init
Definition: rbtree.h:406
#define wine_rb_destroy
Definition: rbtree.h:408
#define wine_rb_get
Definition: rbtree.h:409
#define memset(x, y, z)
Definition: compat.h:39
#define args
Definition: format.c:66
int is_object(const type_t *iface)
Definition: header.c:972
#define major(rdev)
Definition: propsheet.cpp:928
#define TRACE(s)
Definition: solgame.cpp:4
D3D10_USAGE Usage
Definition: d3d10.idl:479
UINT CPUAccessFlags
Definition: d3d10.idl:481
UINT ElementOffset
Definition: d3d10.idl:733
UINT ElementWidth
Definition: d3d10.idl:737
D3D10_SRV_DIMENSION ViewDimension
Definition: d3d10.idl:786
D3D10_BUFFER_SRV Buffer
Definition: d3d10.idl:788
Definition: d3d10.idl:816
const void * pSysMem
Definition: d3d10.idl:810
D3D10_SHADER_INPUT_TYPE Type
Definition: d3d10shader.idl:71
Definition: vfat.h:185
Definition: match.c:390
Definition: undname.c:54
Definition: http.c:7252
unsigned int offset
Definition: effect.c:830
struct d3d10_effect_variable * v
Definition: effect.c:829
unsigned int length
Definition: effect.c:831
struct d3d10_effect_variable * shader
ID3D10EffectPass ID3D10EffectPass_iface
struct d3d10_reg_table reg_tables[D3D10_REG_TABLE_COUNT]
Definition: effect.c:855
ID3D10Blob * code
Definition: effect.c:856
struct d3d10_ctab_var * vars
Definition: effect.c:858
unsigned int vars_count
Definition: effect.c:859
struct d3d10_effect_prop_dependency * entries
struct d3d10_effect_prop_dependency::@261::@265 value_expr
struct d3d10_effect_variable * v
Definition: effect.c:878
struct d3d10_effect_prop_dependency::@261::@263 var
unsigned int operation
Definition: effect.c:873
struct d3d10_effect_prop_dependency::@261::@264 index_expr
struct d3d10_effect_variable * variable
Definition: d3d10_private.h:71
D3D10_SHADER_INPUT_TYPE in_type
Definition: d3d10_private.h:67
union d3d10_effect_shader_variable::@255 shader
ID3D10ShaderReflection * reflection
Definition: d3d10_private.h:84
struct d3d10_effect_shader_resource * resources
Definition: d3d10_private.h:96
D3D10_SO_DECLARATION_ENTRY * entries
Definition: effect.c:1610
unsigned int stride
Definition: effect.c:1613
D3D_SHADER_VARIABLE_TYPE type
Definition: effect.c:1000
enum d3d10_effect_container_type container_type
Definition: effect.c:1003
D3D_SHADER_VARIABLE_TYPE id
Definition: effect.c:1130
struct d3d10_effect * effect
struct d3d10_effect_annotations annotations
ID3D10EffectTechnique ID3D10EffectTechnique_iface
struct d3d10_effect_type * type
D3D10_SHADER_VARIABLE_CLASS type_class
struct d3d10_effect_type * elementtype
unsigned int member_count
D3D10_SHADER_VARIABLE_TYPE basetype
unsigned int element_count
struct d3d10_effect * effect
unsigned int row_count
struct d3d10_effect_type_member * members
ID3D10EffectType ID3D10EffectType_iface
unsigned int column_count
struct d3d10_effect_variable ** v
struct d3d10_effect * effect
struct d3d10_effect_resource_variable resource
struct d3d10_effect_variable * elements
struct d3d10_effect_annotations annotations
union d3d10_effect_variable::@258 u
ID3D10EffectVariable ID3D10EffectVariable_iface
struct d3d10_effect_shader_variable shader
struct d3d10_effect_type * type
struct d3d10_effect_variable * buffer
struct d3d10_effect_state_object_variable state
ID3D10EffectPool ID3D10EffectPool_iface
unsigned int numeric_variable_count
struct d3d10_effect_var_array shaders
struct d3d10_effect_variable * object_variables
struct d3d10_effect * pool
struct d3d10_effect_anonymous_shader * anonymous_shaders
unsigned int local_buffer_count
ID3D10Effect ID3D10Effect_iface
uint32_t flags
struct d3d10_effect_var_array dsvs
struct d3d10_effect_var_array blend_states
struct d3d10_effect_var_array rtvs
struct d3d10_effect_var_array ds_states
unsigned int object_count
ID3D10Device * device
struct d3d10_effect_technique * techniques
struct d3d10_effect_var_array rs_states
struct d3d10_effect_variable * local_buffers
struct wine_rb_tree types
unsigned int technique_count
struct d3d10_effect_var_array samplers
unsigned int anonymous_shader_count
struct d3d10_effect * effect
Definition: effect.c:865
unsigned int table_sizes[D3D10_REG_TABLE_COUNT]
Definition: effect.c:866
struct d3d10_effect_preshader * preshader
Definition: effect.c:864
float * f
Definition: effect.c:838
DWORD * dword
Definition: effect.c:839
unsigned int count
Definition: effect.c:841
char * value
Definition: wpp.c:53
Definition: devices.h:37
Definition: dhcpd.h:62
Definition: copy.c:22
Definition: name.c:39
WCHAR * name
Definition: name.c:42
uint32_t unknown
Definition: effect.c:1893
uint32_t base_type
Definition: effect.c:1889
uint32_t type_class
Definition: effect.c:1888
uint32_t column_major
Definition: effect.c:1892
uint32_t rows
Definition: effect.c:1890
uint32_t columns
Definition: effect.c:1891
unsigned int opcode
Definition: preshader.c:151
unsigned int reserved
Definition: effect.c:189
unsigned int scalar
Definition: effect.c:191
unsigned int opcode
Definition: effect.c:190
unsigned int comp_count
Definition: effect.c:188
pres_op_func func
Definition: effect.c:758
const WCHAR * name
Definition: jsdisp.idl:28
Definition: parser.c:56
Definition: ecma_167.h:138
Definition: tools.h:99
const void * code
Definition: vkd3d_shader.h:413
struct vkd3d_shader_dxbc_section_desc * sections
#define max(a, b)
Definition: svc.c:63
Character const *const prefix
Definition: tempnam.cpp:195
#define bsearch
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
pass
Definition: typegen.h:25
Definition: pdh_main.c:64
struct _slot slot
Definition: vfat.h:196
VKD3D_SHADER_API void vkd3d_shader_free_dxbc(struct vkd3d_shader_dxbc_desc *dxbc)
Definition: dxbc.c:290
VKD3D_SHADER_API int vkd3d_shader_parse_dxbc(const struct vkd3d_shader_code *dxbc, uint32_t flags, struct vkd3d_shader_dxbc_desc *desc, char **messages)
Definition: dxbc.c:320
int retval
Definition: wcstombs.cpp:91
type_kind
Definition: widltypes.h:232
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_UNEXPECTED
Definition: winerror.h:3528
unsigned char BYTE
Definition: xxhash.c:193