28#define D3DXERR_INVALIDDATA 0x88760b59
41 unsigned int i = 0,
j = 0;
64 ok(
hr ==
S_OK,
"Test %s, shader %d: D3DAssemble failed with error 0x%x - %d\n",
name,
i,
hr,
hr & 0x0000FFFF);
66 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
73 res = ID3D10Blob_GetBufferPointer(
shader);
82 ok(
FALSE,
"Test %s, shader %d: Generated code differs\n",
name,
i);
85 ID3D10Blob_Release(
shader);
95 "; yet another comment\r\n"
97 {0xfffe0101, 0x00000002, 0x800f0000, 0x80e40000, 0x80e40001, 0x0000ffff}
100 "#line 1 \"vertex.vsh\"\n"
102 {0xfffe0101, 0x0000ffff}
105 "#define REG 1 + 2 +\\\n"
108 "mov r0, c0[ REG ]\n",
109 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e4000a, 0x0000ffff}
121 "add r0.rgb, r0, r1\r\n"
123 {0xffff0101, 0x00000042, 0xb00f0000, 0x00000002, 0x80070000, 0x80e40000,
124 0x80e40001, 0x40000001, 0x80080000, 0xb0e40000, 0x0000ffff}
129 {0xffff0101, 0x00000001, 0x8e0f0000, 0x80e40001, 0x0000ffff}
133 "def c2, 0, 0., 0, 0.\n",
134 {0xffff0101, 0x00000051, 0xa00f0002, 0x00000000, 0x00000000, 0x00000000,
135 0x00000000, 0x0000ffff}
148 {0xfffe0101, 0x00000002, 0x800f0000, 0x80e40001, 0x80e40002, 0x0000ffff}
153 {0xfffe0101, 0x00000000, 0x0000ffff}
159 {0xfffe0101, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff}
164 {0xfffe0101, 0x00000001, 0xe00f0000, 0xa0e40000, 0x0000ffff}
169 {0xfffe0101, 0x00000001, 0xe00f0005, 0xa0e40000, 0x0000ffff}
174 {0xfffe0101, 0x00000001, 0xd00f0000, 0xa0e40000, 0x0000ffff}
179 {0xfffe0101, 0x00000001, 0xd00f0001, 0xa0e40000, 0x0000ffff}
184 {0xfffe0101, 0x00000001, 0xc00f0001, 0xa0000000, 0x0000ffff}
189 {0xfffe0101, 0x00000001, 0xc00f0002, 0xa0000000, 0x0000ffff}
195 {0xfffe0101, 0x0000001f, 0x80000000, 0x900f0000, 0x0000ffff}
200 {0xfffe0101, 0x0000001f, 0x80000000, 0x900f0001, 0x0000ffff}
205 {0xfffe0101, 0x0000001f, 0x800c0003, 0x900f000f, 0x0000ffff}
210 {0xfffe0101, 0x00000002, 0x800f0000, 0x90e40000, 0x90e40001, 0x0000ffff}
214 "def c12, 0, -1, -0.5, 1024\n",
215 {0xfffe0101, 0x00000051, 0xa00f000c, 0x00000000, 0xbf800000, 0xbf000000,
216 0x44800000, 0x0000ffff}
220 "dp4 r0.xw, r1.wzyx, r2.xxww\n",
221 {0xfffe0101, 0x00000009, 0x80090000, 0x801b0001, 0x80f00002, 0x0000ffff}
225 "add r0, -r0.x, -r1\n",
226 {0xfffe0101, 0x00000002, 0x800f0000, 0x81000000, 0x81e40001, 0x0000ffff}
230 "mov r0, c0[a0.x]\n",
231 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e42000, 0x0000ffff}
235 "mov r0, c1[a0.x + 2]\n",
236 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e42003, 0x0000ffff}
240 "def c0, 1.0f, 1.0f, 1.0f, 0.5f\n",
241 {0xfffe0101, 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000,
242 0x3f000000, 0x0000ffff}
247 "mov r0, c[ a0.x + 12 ]\n",
248 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e4200c, 0x0000ffff}
252 "mov r0, c[ 2 + a0.x ]\n",
253 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e42002, 0x0000ffff}
257 "mov r0, c[ 2 + a0.x + 12 ]\n",
258 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e4200e, 0x0000ffff}
262 "mov r0, c[ 2 + 10 + 12 ]\n",
263 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e40018, 0x0000ffff}
268 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e40006, 0x0000ffff}
273 {0xfffe0101, 0x00000006, 0x800f0000, 0x90000000, 0x0000ffff}
278 {0xfffe0101, 0x00000007, 0x800f0000, 0x90000000, 0x0000ffff}
291 {0xffff0103, 0x00000001, 0x800f0000, 0x80e40001, 0x0000ffff}
296 {0xffff0103, 0x00000002, 0x800f0000, 0x80e40001, 0x80e40000, 0x0000ffff}
302 {0xffff0103, 0x00000001, 0x800f0000, 0x90e40000, 0x0000ffff}
307 {0xffff0103, 0x00000001, 0x800f0000, 0x90e40001, 0x0000ffff}
313 {0xffff0103, 0x00000042, 0xb00f0000, 0x0000ffff}
318 "texreg2ar t1, t0\n",
319 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000045, 0xb00f0001, 0xb0e40000,
325 "texreg2gb t1, t0\n",
326 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000046, 0xb00f0001, 0xb0e40000,
332 "texreg2rgb t1, t0\n",
333 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000052, 0xb00f0001, 0xb0e40000,
338 "cnd r0, r1, r0, v0\n",
339 {0xffff0103, 0x00000050, 0x800f0000, 0x80e40001, 0x80e40000, 0x90e40000,
344 "cmp r0, r1, r0, v0\n",
345 {0xffff0103, 0x00000058, 0x800f0000, 0x80e40001, 0x80e40000, 0x90e40000,
351 {0xffff0103, 0x00000041, 0xb00f0000, 0x0000ffff}
356 "texm3x2pad t1, t0\n"
357 "texm3x2tex t2, t0\n",
358 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000047, 0xb00f0001, 0xb0e40000,
359 0x00000048, 0xb00f0002, 0xb0e40000, 0x0000ffff}
364 "texm3x2pad t1, t0\n"
365 "texm3x2depth t2, t0\n",
366 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000047, 0xb00f0001, 0xb0e40000,
367 0x00000054, 0xb00f0002, 0xb0e40000, 0x0000ffff}
373 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000043, 0xb00f0001, 0xb0e40000,
380 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000044, 0xb00f0001, 0xb0e40000,
386 "texdp3tex t1, t0\n",
387 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000053, 0xb00f0001, 0xb0e40000,
394 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000055, 0xb00f0001, 0xb0e40000,
400 "texm3x3pad t1, t0\n"
401 "texm3x3pad t2, t0\n"
402 "texm3x3tex t3, t0\n",
403 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb00f0001, 0xb0e40000,
404 0x00000049, 0xb00f0002, 0xb0e40000, 0x0000004a, 0xb00f0003, 0xb0e40000,
410 "texm3x3pad t1, t0\n"
411 "texm3x3pad t2, t0\n"
413 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb00f0001, 0xb0e40000,
414 0x00000049, 0xb00f0002, 0xb0e40000, 0x00000056, 0xb00f0003, 0xb0e40000,
420 "texm3x3pad t1, t0\n"
421 "texm3x3pad t2, t0\n"
422 "texm3x3spec t3, t0, c0\n",
423 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb00f0001, 0xb0e40000,
424 0x00000049, 0xb00f0002, 0xb0e40000, 0x0000004c, 0xb00f0003, 0xb0e40000,
425 0xa0e40000, 0x0000ffff}
430 "texm3x3pad t1, t0\n"
431 "texm3x3pad t2, t0\n"
432 "texm3x3vspec t3, t0\n",
433 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb00f0001, 0xb0e40000,
434 0x00000049, 0xb00f0002, 0xb0e40000, 0x0000004d, 0xb00f0003, 0xb0e40000,
440 {0xffff0103, 0x00000040, 0xb00f0000, 0x0000ffff}
445 "mov_x2_sat r0, 1 - r1\n",
446 {0xffff0103, 0x00000001, 0x811f0000, 0x86e40001, 0x0000ffff}
451 {0xffff0103, 0x00000001, 0x8d0f0000, 0x81e40001, 0x0000ffff}
455 "mov_sat r0, r1_bx2\n",
456 {0xffff0103, 0x00000001, 0x801f0000, 0x84e40001, 0x0000ffff}
460 "mov_sat r0, r1_bias\n",
461 {0xffff0103, 0x00000001, 0x801f0000, 0x82e40001, 0x0000ffff}
465 "mov_sat r0, -r1_bias\n",
466 {0xffff0103, 0x00000001, 0x801f0000, 0x83e40001, 0x0000ffff}
470 "mov_sat r0, -r1_bx2\n",
471 {0xffff0103, 0x00000001, 0x801f0000, 0x85e40001, 0x0000ffff}
475 "mov_sat r0, -r1_x2\n",
476 {0xffff0103, 0x00000001, 0x801f0000, 0x88e40001, 0x0000ffff}
480 "mov_x4_sat r0.a, -r1_bx2.a\n",
481 {0xffff0103, 0x00000001, 0x82180000, 0x85ff0001, 0x0000ffff}
486 {0xffff0103, 0x00000040, 0xb10f0000, 0x0000ffff}
491 {0xffff0103, 0x00000042, 0xb10f0000, 0x0000ffff}
495 "texreg2ar_x4 t0, t1\n",
496 {0xffff0103, 0x00000045, 0xb20f0000, 0xb0e40001, 0x0000ffff}
500 "texbem_d4 t1, t0\n",
501 {0xffff0103, 0x00000043, 0xbe0f0001, 0xb0e40000, 0x0000ffff}
506 "texm3x3pad_x2 t1, t0\n"
507 "texm3x3pad_x2 t2, t0\n"
508 "texm3x3tex_x2 t3, t0\n",
509 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb10f0001, 0xb0e40000,
510 0x00000049, 0xb10f0002, 0xb0e40000, 0x0000004a, 0xb10f0003, 0xb0e40000,
516 "texdp3tex_x8 t1, t0\n",
517 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000053, 0xb30f0001, 0xb0e40000,
531 {0xffff0104, 0x00000001, 0x800f0000, 0x80e40001, 0x0000ffff}
536 {0xffff0104, 0x00000001, 0x800f0000, 0x80e40005, 0x0000ffff}
541 {0xffff0104, 0x00000001, 0x800f0000, 0xa0e40007, 0x0000ffff}
546 {0xffff0104, 0x00000001, 0x800f0000, 0x90e40001, 0x0000ffff}
551 {0xffff0104, 0x0000fffd, 0x0000ffff}
556 {0xffff0104, 0x00000040, 0x800f0000, 0xb0e40000, 0x0000ffff}
561 {0xffff0104, 0x00000040, 0x800f0004, 0xb0e40003, 0x0000ffff}
565 "texcrd_sat r4, t3\n",
566 {0xffff0104, 0x00000040, 0x801f0004, 0xb0e40003, 0x0000ffff}
571 {0xffff0104, 0x00000042, 0x800f0000, 0xb0e40000, 0x0000ffff}
576 {0xffff0104, 0x00000042, 0x800f0001, 0xb0e40004, 0x0000ffff}
581 {0xffff0104, 0x00000042, 0x800f0005, 0x80e40000, 0x0000ffff}
586 {0xffff0104, 0x00000042, 0x800f0005, 0xa0e40000, 0x0000ffff}
591 {0xffff0104, 0x00000042, 0x800f0005, 0x89e40002, 0x0000ffff}
595 "bem r1.rg, c0, r0\n",
596 {0xffff0104, 0x00000059, 0x80030001, 0xa0e40000, 0x80e40000, 0x0000ffff}
601 {0xffff0104, 0x00000057, 0x800f0005, 0x0000ffff}
605 "add r0, r1, r2_bx2\n",
606 {0xffff0104, 0x00000002, 0x800f0000, 0x80e40001, 0x84e40002, 0x0000ffff}
610 "add_x4 r0, r1, r2\n",
611 {0xffff0104, 0x00000002, 0x820f0000, 0x80e40001, 0x80e40002, 0x0000ffff}
615 "add r0.rgb, r1, r2\n"
616 "+add r0.a, r1, r2\n",
617 {0xffff0104, 0x00000002, 0x80070000, 0x80e40001, 0x80e40002, 0x40000002,
618 0x80080000, 0x80e40001, 0x80e40002, 0x0000ffff}
623 {0xffff0104, 0x00000057, 0x810f0005, 0x0000ffff}
627 "bem_d2 r1, c0, r0\n",
628 {0xffff0104, 0x00000059, 0x8f0f0001, 0xa0e40000, 0x80e40000, 0x0000ffff}
641 {0xfffe0200, 0x02000001, 0x800f0000, 0x80e40001, 0x0000ffff}
645 "lrp r0, v0, c0, r1\n",
646 {0xfffe0200, 0x04000012, 0x800f0000, 0x90e40000, 0xa0e40000, 0x80e40001,
651 "dp4 oPos, v0, c0\n",
652 {0xfffe0200, 0x03000009, 0xc00f0000, 0x90e40000, 0xa0e40000, 0x0000ffff}
656 "mov r0, c0[a0.x]\n",
657 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0000000, 0x0000ffff}
661 "mov r0, c0[a0.y]\n",
662 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0550000, 0x0000ffff}
666 "mov r0, c0[a0.z]\n",
667 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0aa0000, 0x0000ffff}
671 "mov r0, c0[a0.w]\n",
672 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0ff0000, 0x0000ffff}
676 "mov r0, c0[a0.w].x\n",
677 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0002000, 0xb0ff0000, 0x0000ffff}
681 "mov r0, -c0[a0.w+5].x\n",
682 {0xfffe0200, 0x03000001, 0x800f0000, 0xa1002005, 0xb0ff0000, 0x0000ffff}
687 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0e40000, 0x0000ffff}
691 "mov r0, c0[a0.xyww]\n",
692 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0f40000, 0x0000ffff}
696 "add r0, c0[a0.x], c1[a0.y]\n",
697 {0xfffe0200, 0x05000002, 0x800f0000, 0xa0e42000, 0xb0000000, 0xa0e42001,
698 0xb0550000, 0x0000ffff}
704 {0xfffe0200, 0x01000026, 0xf0e40000, 0x00000027, 0x0000ffff}
711 {0xfffe0200, 0x01000028, 0xe0e40800, 0x0000002a, 0x0000002b, 0x0000ffff}
717 {0xfffe0200, 0x0200001b, 0xf0e40800, 0xf0e40000, 0x0000001d, 0x0000ffff}
722 {0xfffe0200, 0x02000024, 0x800f0000, 0xa0e40000, 0x0000ffff}
727 {0xfffe0200, 0x03000021, 0x800f0000, 0x80e40001, 0x80e40002, 0x0000ffff}
731 "sgn r0, r1, r2, r3\n",
732 {0xfffe0200, 0x04000022, 0x800f0000, 0x80e40001, 0x80e40002, 0x80e40003,
737 "sincos r0, r1, r2, r3\n",
738 {0xfffe0200, 0x04000025, 0x800f0000, 0x80e40001, 0x80e40002, 0x80e40003,
744 {0xfffe0200, 0x03000020, 0x800f0000, 0x80e40001, 0x80e40002, 0x0000ffff}
749 {0xfffe0200, 0x0200002e, 0xb0020000, 0xa0aa0000, 0x0000ffff}
755 {0xfffe0200, 0x0200002f, 0xe00f0800, 0x00000001, 0x0200002f, 0xe00f0801,
756 0x00000000, 0x0000ffff}
760 "defi i0, -1, 1, 10, 0\n"
761 "defi i1, 0, 40, 30, 10\n",
762 {0xfffe0200, 0x05000030, 0xf00f0000, 0xffffffff, 0x00000001, 0x0000000a,
763 0x00000000, 0x05000030, 0xf00f0001, 0x00000000, 0x00000028, 0x0000001e,
764 0x0000000a, 0x0000ffff}
771 {0xfffe0200, 0x0200001b, 0xf0e40800, 0xf0e40000, 0x03000001, 0x800f0000,
772 0xa0e42000, 0xf0e40800, 0x0000001d, 0x0000ffff}
780 {0xfffe0200, 0x01000019, 0xa0e41000, 0x0000001c, 0x0100001e, 0xa0e41000,
781 0x0000001c, 0x0000ffff}
789 {0xfffe0200, 0x0200001a, 0xa0e41000, 0xe0e40800, 0x0000001c, 0x0100001e,
790 0xa0e41000, 0x0000001c, 0x0000ffff}
798 {0xfffe0200, 0x0200001a, 0xa0e41000, 0xede40800, 0x0000001c, 0x0100001e,
799 0xa0e41000, 0x0000001c, 0x0000ffff}
806 {0xfffe0200, 0x01000028, 0xede40800, 0x0000002a, 0x0000002b, 0x0000ffff}
814 {0xfffe0200, 0x01000019, 0xa0e41003, 0x0000001c, 0x0100001e, 0xa0e41003, 0x0000001c, 0x0000ffff}
819 {0xfffe0200, 0x01000019, 0xa0e417ff, 0x0000ffff}
833 {0xfffe0201, 0x01000026, 0xf0e40000, 0x0000002c, 0x00000027, 0x0000ffff}
839 {0xfffe0201, 0x02030029, 0x80e40000, 0x80e40001, 0x0000002b, 0x0000ffff}
846 {0xfffe0201, 0x01000026, 0xf0e40000, 0x0205002d, 0x80e40000, 0x80e40001,
847 0x00000027, 0x0000ffff}
853 "setp_gt p0, r0, r1\n"
854 "(!p0) add r2, r2, r3\n",
855 {0xfffe0201, 0x0301005e, 0xb00f1000, 0x80e40000, 0x80e40001, 0x14000002,
856 0x800f0002, 0xbde41000, 0x80e40002, 0x80e40003, 0x0000ffff}
863 {0xfffe0201, 0x01000028, 0xb0001000, 0x0000002a, 0x0000002b, 0x0000ffff}
871 {0xfffe0201, 0x0200001a, 0xa0e41000, 0xbdaa1000, 0x0000001c,
872 0x0100001e, 0xa0e41000, 0x0000001c, 0x0000ffff}
879 {0xfffe0201, 0x01000026, 0xf0e40000, 0x01000060, 0xb0ff1000,
880 0x00000027, 0x0000ffff}
892 {0xffff0200, 0x0200001f, 0x90000000, 0xa00f0800, 0x0000ffff}
897 {0xffff0200, 0x0200001f, 0x98000000, 0xa00f0800, 0x0000ffff}
902 {0xffff0200, 0x0200001f, 0xa0000000, 0xa00f0800, 0x0000ffff}
909 {0xffff0200, 0x0200001f, 0xa0000000, 0xa00f0800, 0x0200001f, 0x98000000,
910 0xa00f0801, 0x0200001f, 0x90000000, 0xa00f0802, 0x0000ffff}
915 {0xffff0200, 0x02000001, 0x800f0000, 0xb0e40000, 0x0000ffff}
920 "texld r0, t1, s2\n",
921 {0xffff0200, 0x0200001f, 0x90000000, 0xa00f0802, 0x03000042, 0x800f0000,
922 0xb0e40001, 0xa0e40802, 0x0000ffff}
927 {0xffff0200, 0x01000041, 0xb00f0000, 0x0000ffff}
933 {0xffff0200, 0x02000001, 0x800f0800, 0xa0e40000, 0x02000001, 0x800f0801,
934 0xa0e40001, 0x0000ffff}
938 "mov oDepth, c0.x\n",
939 {0xffff0200, 0x02000001, 0x900f0800, 0xa0000000, 0x0000ffff}
944 "texldp r0, t1, s2\n",
945 {0xffff0200, 0x0200001f, 0x90000000, 0xa00f0802, 0x03010042, 0x800f0000,
946 0xb0e40001, 0xa0e40802, 0x0000ffff}
951 "texldb r0, t1, s2\n",
952 {0xffff0200, 0x0200001f, 0x90000000, 0xa00f0802, 0x03020042, 0x800f0000,
953 0xb0e40001, 0xa0e40802, 0x0000ffff}
967 {0xffff0201, 0x0200002f, 0xe00f0800, 0x00000001, 0x0200002f, 0xe00f0801,
968 0x00000000, 0x0000ffff}
972 "defi i0, -1, 1, 10, 0\n"
973 "defi i1, 0, 40, 30, 10\n",
974 {0xffff0201, 0x05000030, 0xf00f0000, 0xffffffff, 0x00000001, 0x0000000a,
975 0x00000000, 0x05000030, 0xf00f0001, 0x00000000, 0x00000028, 0x0000001e,
976 0x0000000a, 0x0000ffff}
981 {0xffff0201, 0x0200005b, 0x800f0000, 0x80e40000, 0x0000ffff}
986 {0xffff0201, 0x0200005c, 0x800f0000, 0x80e40000, 0x0000ffff}
991 "texldd r0, v1, s2, r3, r4\n",
992 {0xffff0201, 0x0200001f, 0x90000000, 0xa00f0802, 0x0500005d, 0x800f0000,
993 0x90e40001, 0xa0e40802, 0x80e40003, 0x80e40004, 0x0000ffff}
1002 {0xffff0201, 0x01000019, 0xa0e41000, 0x0000001c, 0x0100001e, 0xa0e41000,
1003 0x0000001c, 0x0000ffff}
1011 {0xffff0201, 0x0200001a, 0xa0e41000, 0xe0e40800, 0x0000001c, 0x0100001e,
1012 0xa0e41000, 0x0000001c, 0x0000ffff}
1020 {0xffff0201, 0x0200001a, 0xa0e41000, 0xede40800, 0x0000001c, 0x0100001e,
1021 0xa0e41000, 0x0000001c, 0x0000ffff}
1028 {0xffff0201, 0x01000028, 0xede40800, 0x0000002a, 0x0000002b, 0x0000ffff}
1036 {0xffff0201, 0x01000026, 0xf0e40000, 0x0000002c, 0x00000027, 0x0000ffff}
1042 {0xffff0201, 0x02030029, 0x80e40000, 0x80e40001, 0x0000002b, 0x0000ffff}
1049 {0xffff0201, 0x01000026, 0xf0e40000, 0x0205002d, 0x80e40000, 0x80e40001,
1050 0x00000027, 0x0000ffff}
1055 "setp_gt p0, r0, r1\n"
1056 "(!p0) add r2, r2, r3\n",
1057 {0xffff0201, 0x0301005e, 0xb00f1000, 0x80e40000, 0x80e40001, 0x14000002,
1058 0x800f0002, 0xbde41000, 0x80e40002, 0x80e40003, 0x0000ffff}
1065 {0xffff0201, 0x01000028, 0xb0001000, 0x0000002a, 0x0000002b, 0x0000ffff}
1069 "callnz l0, !p0.z\n"
1073 {0xffff0201, 0x0200001a, 0xa0e41000, 0xbdaa1000, 0x0000001c,
1074 0x0100001e, 0xa0e41000, 0x0000001c, 0x0000ffff}
1081 {0xffff0201, 0x01000026, 0xf0e40000, 0x01000060, 0xb0ff1000,
1082 0x00000027, 0x0000ffff}
1090 {0xffff0201, 0x01000019, 0xa0e417ff, 0x0000001c, 0x0100001e, 0xa0e417ff,
1091 0x0000001c, 0x0000ffff}
1103 {0xfffe0300, 0x02000001, 0x800f0000, 0xa0e40000, 0x0000ffff}
1108 {0xfffe0300, 0x0200001f, 0x90000000, 0xa00f0800, 0x0000ffff}
1112 "dcl_position o0\n",
1113 {0xfffe0300, 0x0200001f, 0x80000000, 0xe00f0000, 0x0000ffff}
1117 "dcl_texcoord12 o11\n",
1118 {0xfffe0300, 0x0200001f, 0x800c0005, 0xe00f000b, 0x0000ffff}
1122 "texldl r0, v0, s0\n",
1123 {0xfffe0300, 0x0300005f, 0x800f0000, 0x90e40000, 0xa0e40800, 0x0000ffff}
1128 {0xfffe0300, 0x03000001, 0x800f0000, 0xa0e42000, 0xf0e40800, 0x0000ffff}
1132 "mov o[ a0.x + 12 ], r0\n",
1133 {0xfffe0300, 0x03000001, 0xe00f200c, 0xb0000000, 0x80e40000, 0x0000ffff}
1137 "add_sat r0, r0, r1\n",
1138 {0xfffe0300, 0x03000002, 0x801f0000, 0x80e40000, 0x80e40001, 0x0000ffff}
1143 {0xfffe0300, 0x02000001, 0x800f0002, 0x8be40001, 0x0000ffff}
1147 "mov r2, r1.xygb\n",
1148 {0xfffe0300, 0x02000001, 0x800f0002, 0x80940001, 0x0000ffff}
1153 {0xfffe0300, 0x02000001, 0x80070002, 0x80e40001, 0x0000ffff}
1157 "mova_sat a0.x, r1\n",
1158 {0xfffe0300, 0x0200002e, 0xb0110000, 0x80e40001, 0x0000ffff}
1163 {0xfffe0300, 0x02000025, 0x800f0000, 0x80e40001, 0x0000ffff}
1167 "def c0, 1.0f, 1.0f, 1.0f, 0.5f\n",
1168 {0xfffe0300, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000,
1169 0x3f000000, 0x0000ffff}
1173 "add r0, v20[aL], r2\n",
1174 {0xfffe0300, 0x04000002, 0x800f0000, 0x90e42014, 0xf0e40800, 0x80e40002,
1188 {0xffff0300, 0x02000001, 0x800f0000, 0xa0e40000, 0x0000ffff}
1193 {0xffff0300, 0x0200001f, 0x80050003, 0x900f0000, 0x0000ffff}
1198 {0xffff0300, 0x02000001, 0x800f0000, 0x90e41000, 0x0000ffff}
1203 {0xffff0300, 0x02000001, 0x800f0000, 0x90e41001, 0x0000ffff}
1207 "mov r0, v[ aL + 12 ]\n",
1208 {0xffff0300, 0x03000001, 0x800f0000, 0x90e4200c, 0xf0e40800, 0x0000ffff}
1215 {0xffff0300, 0x0200001b, 0xf0e40800, 0xf0e40000, 0x03000001, 0x800f0000,
1216 0x90e42000, 0xf0e40800, 0x0000001d, 0x0000ffff}
1220 "texldl r0, v0, s0\n",
1221 {0xffff0300, 0x0300005f, 0x800f0000, 0x90e40000, 0xa0e40800, 0x0000ffff}
1225 "add_pp r0, r0, r1\n",
1226 {0xffff0300, 0x03000002, 0x802f0000, 0x80e40000, 0x80e40001, 0x0000ffff}
1231 {0xffff0300, 0x0200005b, 0x801f0000, 0x80e40001, 0x0000ffff}
1235 "texldd_pp r0, r1, r2, r3, r4\n",
1236 {0xffff0300, 0x0500005d, 0x802f0000, 0x80e40001, 0x80e40002, 0x80e40003,
1237 0x80e40004, 0x0000ffff}
1242 {0xffff0300, 0x01000041, 0x900f0000, 0x0000ffff}
1246 "add oC3, r0, r1\n",
1247 {0xffff0300, 0x03000002, 0x800f0803, 0x80e40000, 0x80e40001, 0x0000ffff}
1251 "dcl_texcoord0_centroid v0\n",
1252 {0xffff0300, 0x0200001f, 0x80000005, 0x904f0000, 0x0000ffff}
1256 "dcl_2d_centroid s0\n",
1257 {0xffff0300, 0x0200001f, 0x90000000, 0xa04f0800, 0x0000ffff}
1262 {0xffff0300, 0x0200001f, 0x90000000, 0xa02f0800, 0x0000ffff}
1270 const char *
tests[] = {
1274 "texldd_x2 r0, v1, s2, v3, v4\n",
1277 "add r0.rgb, r0, r1\n"
1278 "+add r0.a, r0, r2\n",
1281 "texld r0, t0, s0\n"
1282 "add r0.rgb, r0, r1\n"
1283 "+add r0.a, r0, v1\n",
1286 "(p0) add r0, r0, v0\n",
1289 "mov r0, v[ a0 + 12 ]\n",
1295 "mov r0, v[ aL.x + 12 ]\n",
1299 "texldd r0, t1, s2, v3, v4\n",
1302 "mov_x2_x2 r0, r1\n",
1308 "texld r5, -r2_dz\n",
1317 "mov r2, c[ aL + 3.4 ]\n",
1332 "mov r0, r1.abcd\n",
1335 "mov r0, r1.xyzwx\n",
1341 "mov r0.xxyz, r1\n",
1347 "dcl_positiont o0\n",
1350 "add_pp r0, r0, r1\n",
1353 "add_x4 r0, r0, r1\n",
1356 "add oC0, r0, r1\n",
1359 "add oC4, r0, r1\n",
1362 "add r0, r0, v17\n",
1365 "add o13, r0, r1\n",
1371 "texld r0, r1, s20\n",
1377 "add r0, r0[ a0.x ], r1\n",
1380 "add r0, v[ a0.x ], r1\n",
1383 "add r0, v[ aL ], r1\n",
1386 "add r0, v[ r0 ], r1\n",
1389 "add r0, v[ a0.x ], r1\n",
1392 "mov r0, c0[ a0 ]\n",
1395 "dcl_texcoord0_sat v0\n",
1398 "dcl_texcoord0_x2 v0\n",
1401 "dcl_texcoord0_centroid v0\n",
1407 "texm3x3vspec t3, t0\n",
1421 "expected D3DAssemble failure with D3DXERR_INVALIDDATA, "
1422 "got 0x%x - %d\n",
i,
hr,
hr & 0x0000FFFF);
1424 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1430 ID3D10Blob_Release(
shader);
1438 static const char include[] =
"#define REGISTER r0\nvs.1.1\n";
1439 static const char include2[] =
"#include \"incl3.vsh\"\n";
1440 static const char include3[] =
"vs.1.1\n";
1441 static const char include4[] =
"#include <incl3.vsh>\n";
1444 trace(
"include_type = %d, filename %s\n", include_type,
filename);
1445 trace(
"parent_data (%p) -> %s\n", parent_data, parent_data ? (
char *)parent_data :
"(null)");
1452 ok(!parent_data,
"Wrong parent_data value.\n");
1458 *
bytes =
sizeof(include2);
1459 ok(!parent_data,
"Wrong parent_data value.\n");
1466 *
bytes =
sizeof(include3);
1471 "Wrong parent_data value.\n");
1477 *
bytes =
sizeof(include4);
1478 ok(parent_data ==
NULL,
"Wrong parent_data value.\n");
1486 ok(!parent_data,
"Wrong parent_data value.\n");
1516 static const char test1[] =
1521 static const char testshader[] =
1523 "#include \"incl.vsh\"\n"
1524 "mov REGISTER, v0\n"
1548 ok(
hr ==
S_OK,
"defines test failed with error 0x%x - %d\n",
hr,
hr & 0x0000FFFF);
1550 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1560 ok(
hr ==
S_OK,
"NULL messages test failed with error 0x%x - %d\n",
hr,
hr & 0x0000FFFF);
1568 ok(
hr ==
S_OK,
"NULL shader test failed with error 0x%x - %d\n",
hr,
hr & 0x0000FFFF);
1570 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1580 ok(
hr ==
S_OK,
"D3DInclude test failed with error 0x%x - %d\n",
hr,
hr & 0x0000FFFF);
1582 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1595 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1603 static const char test1[] =
1608 static const char quotation_marks_test[] =
1615 static const char *include_test_shaders[] =
1617 "#include \"incl.vsh\"\n"
1618 "mov REGISTER, v0\n",
1620 "#include \"incl2.vsh\"\n"
1621 "mov REGISTER, v0\n",
1623 "#include <incl.vsh>\n"
1624 "mov REGISTER, v0\n",
1626 "#include <incl4.vsh>\n"
1627 "mov REGISTER, v0\n",
1629 "#include \"includes/incl.vsh\"\n"
1630 "mov REGISTER, v0\n"
1654 ok(
hr ==
S_OK,
"pDefines test failed with error 0x%x - %d\n",
hr,
hr & 0x0000FFFF);
1657 trace(
"D3DPreprocess messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1666 ok(
hr ==
S_OK,
"NULL messages test failed with error 0x%x - %d\n",
hr,
hr & 0x0000FFFF);
1676 trace(
"D3DPreprocess messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1685 todo_wine ok(
hr ==
S_OK,
"quotation marks test failed with error 0x%x - %d\n",
hr,
hr & 0x0000FFFF);
1688 trace(
"D3DPreprocess messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1701 ok(
hr ==
S_OK,
"pInclude test failed with error 0x%x - %d\n",
hr,
hr & 0x0000FFFF);
1704 trace(
"D3DPreprocess messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1718 trace(
"D3DPreprocess messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1739 win_skip(
"Could not load d3dcompiler_43.dll\n");
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
static unsigned char bytes[4]
enum _D3D_INCLUDE_TYPE D3D_INCLUDE_TYPE
HRESULT(WINAPI * pD3DPreprocess)(const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **shader, ID3DBlob **error_messages)
#define D3DCOMPILE_SKIP_VALIDATION
static void vs_3_0_test(void)
static const struct ID3DIncludeVtbl D3DInclude_Vtbl
static void ps_2_0_test(void)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
static void preproc_test(void)
static void exec_tests(const char *name, struct shader_test tests[], unsigned int count)
static void ps_1_4_test(void)
#define D3DXERR_INVALIDDATA
static void ps_1_1_test(void)
static void vs_1_1_test(void)
static void dump_shader(DWORD *shader)
static HRESULT WINAPI testD3DInclude_close(ID3DInclude *iface, const void *data)
static void ps_1_3_test(void)
static HRESULT WINAPI testD3DInclude_open(ID3DInclude *iface, D3D_INCLUDE_TYPE include_type, const char *filename, const void *parent_data, const void **data, UINT *bytes)
static void failure_test(void)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
static void ps_2_x_test(void)
static void ps_3_0_test(void)
static void vs_2_x_test(void)
static pD3DPreprocess ppD3DPreprocess
static void vs_2_0_test(void)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT flags
static void assembleshader_test(void)
static void d3dpreprocess_test(void)
static SIZE_T const char * filename
static SIZE_T const char const D3D_SHADER_MACRO * defines
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ** shader
static BOOL load_d3dcompiler(void)
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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
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
static struct test_info tests[]
ID3DInclude ID3DInclude_iface