28#define D3DXERR_INVALIDDATA 0x88760b59
40 unsigned int i = 0,
j = 0;
62 ok(
hr ==
S_OK,
"Test %s, shader %u: D3DAssemble failed with error %#lx - %ld.\n",
name,
i,
hr,
hr & 0xffff);
64 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
71 res = ID3D10Blob_GetBufferPointer(
shader);
80 ok(
FALSE,
"Test %s, shader %d: Generated code differs\n",
name,
i);
83 ID3D10Blob_Release(
shader);
93 "; yet another comment\r\n"
95 {0xfffe0101, 0x00000002, 0x800f0000, 0x80e40000, 0x80e40001, 0x0000ffff}
98 "#line 1 \"vertex.vsh\"\n"
100 {0xfffe0101, 0x0000ffff}
103 "#define REG 1 + 2 +\\\n"
106 "mov r0, c0[ REG ]\n",
107 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e4000a, 0x0000ffff}
119 "add r0.rgb, r0, r1\r\n"
121 {0xffff0101, 0x00000042, 0xb00f0000, 0x00000002, 0x80070000, 0x80e40000,
122 0x80e40001, 0x40000001, 0x80080000, 0xb0e40000, 0x0000ffff}
127 {0xffff0101, 0x00000001, 0x8e0f0000, 0x80e40001, 0x0000ffff}
131 "def c2, 0, 0., 0, 0.\n",
132 {0xffff0101, 0x00000051, 0xa00f0002, 0x00000000, 0x00000000, 0x00000000,
133 0x00000000, 0x0000ffff}
146 {0xfffe0101, 0x00000002, 0x800f0000, 0x80e40001, 0x80e40002, 0x0000ffff}
151 {0xfffe0101, 0x00000000, 0x0000ffff}
157 {0xfffe0101, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff}
162 {0xfffe0101, 0x00000001, 0xe00f0000, 0xa0e40000, 0x0000ffff}
167 {0xfffe0101, 0x00000001, 0xe00f0005, 0xa0e40000, 0x0000ffff}
172 {0xfffe0101, 0x00000001, 0xd00f0000, 0xa0e40000, 0x0000ffff}
177 {0xfffe0101, 0x00000001, 0xd00f0001, 0xa0e40000, 0x0000ffff}
182 {0xfffe0101, 0x00000001, 0xc00f0001, 0xa0000000, 0x0000ffff}
187 {0xfffe0101, 0x00000001, 0xc00f0002, 0xa0000000, 0x0000ffff}
193 {0xfffe0101, 0x0000001f, 0x80000000, 0x900f0000, 0x0000ffff}
198 {0xfffe0101, 0x0000001f, 0x80000000, 0x900f0001, 0x0000ffff}
203 {0xfffe0101, 0x0000001f, 0x800c0003, 0x900f000f, 0x0000ffff}
208 {0xfffe0101, 0x00000002, 0x800f0000, 0x90e40000, 0x90e40001, 0x0000ffff}
212 "def c12, 0, -1, -0.5, 1024\n",
213 {0xfffe0101, 0x00000051, 0xa00f000c, 0x00000000, 0xbf800000, 0xbf000000,
214 0x44800000, 0x0000ffff},
218 "dp4 r0.xw, r1.wzyx, r2.xxww\n",
219 {0xfffe0101, 0x00000009, 0x80090000, 0x801b0001, 0x80f00002, 0x0000ffff}
223 "add r0, -r0.x, -r1\n",
224 {0xfffe0101, 0x00000002, 0x800f0000, 0x81000000, 0x81e40001, 0x0000ffff}
228 "mov r0, c0[a0.x]\n",
229 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e42000, 0x0000ffff}
233 "mov r0, c1[a0.x + 2]\n",
234 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e42003, 0x0000ffff}
238 "def c0, 1.0f, 1.0f, 1.0f, 0.5f\n",
239 {0xfffe0101, 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000,
240 0x3f000000, 0x0000ffff}
245 "mov r0, c[ a0.x + 12 ]\n",
246 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e4200c, 0x0000ffff}
250 "mov r0, c[ 2 + a0.x ]\n",
251 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e42002, 0x0000ffff}
255 "mov r0, c[ 2 + a0.x + 12 ]\n",
256 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e4200e, 0x0000ffff}
260 "mov r0, c[ 2 + 10 + 12 ]\n",
261 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e40018, 0x0000ffff}
266 {0xfffe0101, 0x00000001, 0x800f0000, 0xa0e40006, 0x0000ffff}
271 {0xfffe0101, 0x00000006, 0x800f0000, 0x90000000, 0x0000ffff}
276 {0xfffe0101, 0x00000007, 0x800f0000, 0x90000000, 0x0000ffff}
289 {0xffff0103, 0x00000001, 0x800f0000, 0x80e40001, 0x0000ffff}
294 {0xffff0103, 0x00000002, 0x800f0000, 0x80e40001, 0x80e40000, 0x0000ffff}
300 {0xffff0103, 0x00000001, 0x800f0000, 0x90e40000, 0x0000ffff}
305 {0xffff0103, 0x00000001, 0x800f0000, 0x90e40001, 0x0000ffff}
311 {0xffff0103, 0x00000042, 0xb00f0000, 0x0000ffff}
316 "texreg2ar t1, t0\n",
317 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000045, 0xb00f0001, 0xb0e40000,
323 "texreg2gb t1, t0\n",
324 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000046, 0xb00f0001, 0xb0e40000,
330 "texreg2rgb t1, t0\n",
331 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000052, 0xb00f0001, 0xb0e40000,
336 "cnd r0, r1, r0, v0\n",
337 {0xffff0103, 0x00000050, 0x800f0000, 0x80e40001, 0x80e40000, 0x90e40000,
342 "cmp r0, r1, r0, v0\n",
343 {0xffff0103, 0x00000058, 0x800f0000, 0x80e40001, 0x80e40000, 0x90e40000,
349 {0xffff0103, 0x00000041, 0xb00f0000, 0x0000ffff}
354 "texm3x2pad t1, t0\n"
355 "texm3x2tex t2, t0\n",
356 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000047, 0xb00f0001, 0xb0e40000,
357 0x00000048, 0xb00f0002, 0xb0e40000, 0x0000ffff}
362 "texm3x2pad t1, t0\n"
363 "texm3x2depth t2, t0\n",
364 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000047, 0xb00f0001, 0xb0e40000,
365 0x00000054, 0xb00f0002, 0xb0e40000, 0x0000ffff}
371 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000043, 0xb00f0001, 0xb0e40000,
378 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000044, 0xb00f0001, 0xb0e40000,
384 "texdp3tex t1, t0\n",
385 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000053, 0xb00f0001, 0xb0e40000,
392 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000055, 0xb00f0001, 0xb0e40000,
398 "texm3x3pad t1, t0\n"
399 "texm3x3pad t2, t0\n"
400 "texm3x3tex t3, t0\n",
401 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb00f0001, 0xb0e40000,
402 0x00000049, 0xb00f0002, 0xb0e40000, 0x0000004a, 0xb00f0003, 0xb0e40000,
408 "texm3x3pad t1, t0\n"
409 "texm3x3pad t2, t0\n"
411 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb00f0001, 0xb0e40000,
412 0x00000049, 0xb00f0002, 0xb0e40000, 0x00000056, 0xb00f0003, 0xb0e40000,
418 "texm3x3pad t1, t0\n"
419 "texm3x3pad t2, t0\n"
420 "texm3x3spec t3, t0, c0\n",
421 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb00f0001, 0xb0e40000,
422 0x00000049, 0xb00f0002, 0xb0e40000, 0x0000004c, 0xb00f0003, 0xb0e40000,
423 0xa0e40000, 0x0000ffff}
428 "texm3x3pad t1, t0\n"
429 "texm3x3pad t2, t0\n"
430 "texm3x3vspec t3, t0\n",
431 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb00f0001, 0xb0e40000,
432 0x00000049, 0xb00f0002, 0xb0e40000, 0x0000004d, 0xb00f0003, 0xb0e40000,
438 {0xffff0103, 0x00000040, 0xb00f0000, 0x0000ffff}
443 "mov_x2_sat r0, 1 - r1\n",
444 {0xffff0103, 0x00000001, 0x811f0000, 0x86e40001, 0x0000ffff}
449 {0xffff0103, 0x00000001, 0x8d0f0000, 0x81e40001, 0x0000ffff}
453 "mov_sat r0, r1_bx2\n",
454 {0xffff0103, 0x00000001, 0x801f0000, 0x84e40001, 0x0000ffff}
458 "mov_sat r0, r1_bias\n",
459 {0xffff0103, 0x00000001, 0x801f0000, 0x82e40001, 0x0000ffff}
463 "mov_sat r0, -r1_bias\n",
464 {0xffff0103, 0x00000001, 0x801f0000, 0x83e40001, 0x0000ffff}
468 "mov_sat r0, -r1_bx2\n",
469 {0xffff0103, 0x00000001, 0x801f0000, 0x85e40001, 0x0000ffff}
473 "mov_sat r0, -r1_x2\n",
474 {0xffff0103, 0x00000001, 0x801f0000, 0x88e40001, 0x0000ffff}
478 "mov_x4_sat r0.a, -r1_bx2.a\n",
479 {0xffff0103, 0x00000001, 0x82180000, 0x85ff0001, 0x0000ffff}
484 {0xffff0103, 0x00000040, 0xb10f0000, 0x0000ffff}
489 {0xffff0103, 0x00000042, 0xb10f0000, 0x0000ffff}
493 "texreg2ar_x4 t0, t1\n",
494 {0xffff0103, 0x00000045, 0xb20f0000, 0xb0e40001, 0x0000ffff}
498 "texbem_d4 t1, t0\n",
499 {0xffff0103, 0x00000043, 0xbe0f0001, 0xb0e40000, 0x0000ffff}
504 "texm3x3pad_x2 t1, t0\n"
505 "texm3x3pad_x2 t2, t0\n"
506 "texm3x3tex_x2 t3, t0\n",
507 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb10f0001, 0xb0e40000,
508 0x00000049, 0xb10f0002, 0xb0e40000, 0x0000004a, 0xb10f0003, 0xb0e40000,
514 "texdp3tex_x8 t1, t0\n",
515 {0xffff0103, 0x00000042, 0xb00f0000, 0x00000053, 0xb30f0001, 0xb0e40000,
529 {0xffff0104, 0x00000001, 0x800f0000, 0x80e40001, 0x0000ffff}
534 {0xffff0104, 0x00000001, 0x800f0000, 0x80e40005, 0x0000ffff}
539 {0xffff0104, 0x00000001, 0x800f0000, 0xa0e40007, 0x0000ffff}
544 {0xffff0104, 0x00000001, 0x800f0000, 0x90e40001, 0x0000ffff}
549 {0xffff0104, 0x0000fffd, 0x0000ffff}
554 {0xffff0104, 0x00000040, 0x800f0000, 0xb0e40000, 0x0000ffff}
559 {0xffff0104, 0x00000040, 0x800f0004, 0xb0e40003, 0x0000ffff}
563 "texcrd_sat r4, t3\n",
564 {0xffff0104, 0x00000040, 0x801f0004, 0xb0e40003, 0x0000ffff}
569 {0xffff0104, 0x00000042, 0x800f0000, 0xb0e40000, 0x0000ffff}
574 {0xffff0104, 0x00000042, 0x800f0001, 0xb0e40004, 0x0000ffff}
579 {0xffff0104, 0x00000042, 0x800f0005, 0x80e40000, 0x0000ffff}
584 {0xffff0104, 0x00000042, 0x800f0005, 0xa0e40000, 0x0000ffff}
589 {0xffff0104, 0x00000042, 0x800f0005, 0x89e40002, 0x0000ffff}
593 "bem r1.rg, c0, r0\n",
594 {0xffff0104, 0x00000059, 0x80030001, 0xa0e40000, 0x80e40000, 0x0000ffff}
599 {0xffff0104, 0x00000057, 0x800f0005, 0x0000ffff}
603 "add r0, r1, r2_bx2\n",
604 {0xffff0104, 0x00000002, 0x800f0000, 0x80e40001, 0x84e40002, 0x0000ffff}
608 "add_x4 r0, r1, r2\n",
609 {0xffff0104, 0x00000002, 0x820f0000, 0x80e40001, 0x80e40002, 0x0000ffff}
613 "add r0.rgb, r1, r2\n"
614 "+add r0.a, r1, r2\n",
615 {0xffff0104, 0x00000002, 0x80070000, 0x80e40001, 0x80e40002, 0x40000002,
616 0x80080000, 0x80e40001, 0x80e40002, 0x0000ffff}
621 {0xffff0104, 0x00000057, 0x810f0005, 0x0000ffff}
625 "bem_d2 r1, c0, r0\n",
626 {0xffff0104, 0x00000059, 0x8f0f0001, 0xa0e40000, 0x80e40000, 0x0000ffff}
639 {0xfffe0200, 0x02000001, 0x800f0000, 0x80e40001, 0x0000ffff}
643 "lrp r0, v0, c0, r1\n",
644 {0xfffe0200, 0x04000012, 0x800f0000, 0x90e40000, 0xa0e40000, 0x80e40001,
649 "dp4 oPos, v0, c0\n",
650 {0xfffe0200, 0x03000009, 0xc00f0000, 0x90e40000, 0xa0e40000, 0x0000ffff}
654 "mov r0, c0[a0.x]\n",
655 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0000000, 0x0000ffff}
659 "mov r0, c0[a0.y]\n",
660 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0550000, 0x0000ffff}
664 "mov r0, c0[a0.z]\n",
665 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0aa0000, 0x0000ffff}
669 "mov r0, c0[a0.w]\n",
670 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0ff0000, 0x0000ffff}
674 "mov r0, c0[a0.w].x\n",
675 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0002000, 0xb0ff0000, 0x0000ffff}
679 "mov r0, -c0[a0.w+5].x\n",
680 {0xfffe0200, 0x03000001, 0x800f0000, 0xa1002005, 0xb0ff0000, 0x0000ffff}
685 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0e40000, 0x0000ffff}
689 "mov r0, c0[a0.xyww]\n",
690 {0xfffe0200, 0x03000001, 0x800f0000, 0xa0e42000, 0xb0f40000, 0x0000ffff}
694 "add r0, c0[a0.x], c1[a0.y]\n",
695 {0xfffe0200, 0x05000002, 0x800f0000, 0xa0e42000, 0xb0000000, 0xa0e42001,
696 0xb0550000, 0x0000ffff}
702 {0xfffe0200, 0x01000026, 0xf0e40000, 0x00000027, 0x0000ffff}
709 {0xfffe0200, 0x01000028, 0xe0e40800, 0x0000002a, 0x0000002b, 0x0000ffff}
715 {0xfffe0200, 0x0200001b, 0xf0e40800, 0xf0e40000, 0x0000001d, 0x0000ffff}
720 {0xfffe0200, 0x02000024, 0x800f0000, 0xa0e40000, 0x0000ffff}
725 {0xfffe0200, 0x03000021, 0x800f0000, 0x80e40001, 0x80e40002, 0x0000ffff}
729 "sgn r0, r1, r2, r3\n",
730 {0xfffe0200, 0x04000022, 0x800f0000, 0x80e40001, 0x80e40002, 0x80e40003,
735 "sincos r0, r1, r2, r3\n",
736 {0xfffe0200, 0x04000025, 0x800f0000, 0x80e40001, 0x80e40002, 0x80e40003,
742 {0xfffe0200, 0x03000020, 0x800f0000, 0x80e40001, 0x80e40002, 0x0000ffff}
747 {0xfffe0200, 0x0200002e, 0xb0020000, 0xa0aa0000, 0x0000ffff}
753 {0xfffe0200, 0x0200002f, 0xe00f0800, 0x00000001, 0x0200002f, 0xe00f0801,
754 0x00000000, 0x0000ffff}
758 "defi i0, - 1, 1, 10, 0\n"
759 "defi i1, 0, 40, 30, 10\n",
760 {0xfffe0200, 0x05000030, 0xf00f0000, 0xffffffff, 0x00000001, 0x0000000a,
761 0x00000000, 0x05000030, 0xf00f0001, 0x00000000, 0x00000028, 0x0000001e,
762 0x0000000a, 0x0000ffff},
769 {0xfffe0200, 0x0200001b, 0xf0e40800, 0xf0e40000, 0x03000001, 0x800f0000,
770 0xa0e42000, 0xf0e40800, 0x0000001d, 0x0000ffff}
778 {0xfffe0200, 0x01000019, 0xa0e41000, 0x0000001c, 0x0100001e, 0xa0e41000,
779 0x0000001c, 0x0000ffff}
787 {0xfffe0200, 0x0200001a, 0xa0e41000, 0xe0e40800, 0x0000001c, 0x0100001e,
788 0xa0e41000, 0x0000001c, 0x0000ffff}
796 {0xfffe0200, 0x0200001a, 0xa0e41000, 0xede40800, 0x0000001c, 0x0100001e,
797 0xa0e41000, 0x0000001c, 0x0000ffff}
804 {0xfffe0200, 0x01000028, 0xede40800, 0x0000002a, 0x0000002b, 0x0000ffff}
812 {0xfffe0200, 0x01000019, 0xa0e41003, 0x0000001c, 0x0100001e, 0xa0e41003, 0x0000001c, 0x0000ffff}
817 {0xfffe0200, 0x01000019, 0xa0e417ff, 0x0000ffff}
831 {0xfffe0201, 0x01000026, 0xf0e40000, 0x0000002c, 0x00000027, 0x0000ffff}
837 {0xfffe0201, 0x02030029, 0x80e40000, 0x80e40001, 0x0000002b, 0x0000ffff}
844 {0xfffe0201, 0x01000026, 0xf0e40000, 0x0205002d, 0x80e40000, 0x80e40001,
845 0x00000027, 0x0000ffff}
851 "setp_gt p0, r0, r1\n"
852 "(!p0) add r2, r2, r3\n",
853 {0xfffe0201, 0x0301005e, 0xb00f1000, 0x80e40000, 0x80e40001, 0x14000002,
854 0x800f0002, 0xbde41000, 0x80e40002, 0x80e40003, 0x0000ffff}
861 {0xfffe0201, 0x01000028, 0xb0001000, 0x0000002a, 0x0000002b, 0x0000ffff}
869 {0xfffe0201, 0x0200001a, 0xa0e41000, 0xbdaa1000, 0x0000001c,
870 0x0100001e, 0xa0e41000, 0x0000001c, 0x0000ffff}
877 {0xfffe0201, 0x01000026, 0xf0e40000, 0x01000060, 0xb0ff1000,
878 0x00000027, 0x0000ffff}
890 {0xffff0200, 0x0200001f, 0x90000000, 0xa00f0800, 0x0000ffff}
895 {0xffff0200, 0x0200001f, 0x98000000, 0xa00f0800, 0x0000ffff}
900 {0xffff0200, 0x0200001f, 0xa0000000, 0xa00f0800, 0x0000ffff}
907 {0xffff0200, 0x0200001f, 0xa0000000, 0xa00f0800, 0x0200001f, 0x98000000,
908 0xa00f0801, 0x0200001f, 0x90000000, 0xa00f0802, 0x0000ffff}
913 {0xffff0200, 0x02000001, 0x800f0000, 0xb0e40000, 0x0000ffff}
918 "texld r0, t1, s2\n",
919 {0xffff0200, 0x0200001f, 0x90000000, 0xa00f0802, 0x03000042, 0x800f0000,
920 0xb0e40001, 0xa0e40802, 0x0000ffff}
925 {0xffff0200, 0x01000041, 0xb00f0000, 0x0000ffff}
931 {0xffff0200, 0x02000001, 0x800f0800, 0xa0e40000, 0x02000001, 0x800f0801,
932 0xa0e40001, 0x0000ffff}
936 "mov oDepth, c0.x\n",
937 {0xffff0200, 0x02000001, 0x900f0800, 0xa0000000, 0x0000ffff}
942 "texldp r0, t1, s2\n",
943 {0xffff0200, 0x0200001f, 0x90000000, 0xa00f0802, 0x03010042, 0x800f0000,
944 0xb0e40001, 0xa0e40802, 0x0000ffff}
949 "texldb r0, t1, s2\n",
950 {0xffff0200, 0x0200001f, 0x90000000, 0xa00f0802, 0x03020042, 0x800f0000,
951 0xb0e40001, 0xa0e40802, 0x0000ffff}
965 {0xffff0201, 0x0200002f, 0xe00f0800, 0x00000001, 0x0200002f, 0xe00f0801,
966 0x00000000, 0x0000ffff}
970 "defi i0, -1, 1, 10, 0\n"
971 "defi i1, 0, 40, 30, 10\n",
972 {0xffff0201, 0x05000030, 0xf00f0000, 0xffffffff, 0x00000001, 0x0000000a,
973 0x00000000, 0x05000030, 0xf00f0001, 0x00000000, 0x00000028, 0x0000001e,
974 0x0000000a, 0x0000ffff},
979 {0xffff0201, 0x0200005b, 0x800f0000, 0x80e40000, 0x0000ffff}
984 {0xffff0201, 0x0200005c, 0x800f0000, 0x80e40000, 0x0000ffff}
989 "texldd r0, v1, s2, r3, r4\n",
990 {0xffff0201, 0x0200001f, 0x90000000, 0xa00f0802, 0x0500005d, 0x800f0000,
991 0x90e40001, 0xa0e40802, 0x80e40003, 0x80e40004, 0x0000ffff}
1000 {0xffff0201, 0x01000019, 0xa0e41000, 0x0000001c, 0x0100001e, 0xa0e41000,
1001 0x0000001c, 0x0000ffff}
1009 {0xffff0201, 0x0200001a, 0xa0e41000, 0xe0e40800, 0x0000001c, 0x0100001e,
1010 0xa0e41000, 0x0000001c, 0x0000ffff}
1018 {0xffff0201, 0x0200001a, 0xa0e41000, 0xede40800, 0x0000001c, 0x0100001e,
1019 0xa0e41000, 0x0000001c, 0x0000ffff}
1026 {0xffff0201, 0x01000028, 0xede40800, 0x0000002a, 0x0000002b, 0x0000ffff}
1034 {0xffff0201, 0x01000026, 0xf0e40000, 0x0000002c, 0x00000027, 0x0000ffff}
1040 {0xffff0201, 0x02030029, 0x80e40000, 0x80e40001, 0x0000002b, 0x0000ffff}
1047 {0xffff0201, 0x01000026, 0xf0e40000, 0x0205002d, 0x80e40000, 0x80e40001,
1048 0x00000027, 0x0000ffff}
1053 "setp_gt p0, r0, r1\n"
1054 "(!p0) add r2, r2, r3\n",
1055 {0xffff0201, 0x0301005e, 0xb00f1000, 0x80e40000, 0x80e40001, 0x14000002,
1056 0x800f0002, 0xbde41000, 0x80e40002, 0x80e40003, 0x0000ffff}
1063 {0xffff0201, 0x01000028, 0xb0001000, 0x0000002a, 0x0000002b, 0x0000ffff}
1067 "callnz l0, !p0.z\n"
1071 {0xffff0201, 0x0200001a, 0xa0e41000, 0xbdaa1000, 0x0000001c,
1072 0x0100001e, 0xa0e41000, 0x0000001c, 0x0000ffff}
1079 {0xffff0201, 0x01000026, 0xf0e40000, 0x01000060, 0xb0ff1000,
1080 0x00000027, 0x0000ffff}
1088 {0xffff0201, 0x01000019, 0xa0e417ff, 0x0000001c, 0x0100001e, 0xa0e417ff,
1089 0x0000001c, 0x0000ffff}
1101 {0xfffe0300, 0x02000001, 0x800f0000, 0xa0e40000, 0x0000ffff}
1106 {0xfffe0300, 0x0200001f, 0x90000000, 0xa00f0800, 0x0000ffff}
1110 "dcl_position o0\n",
1111 {0xfffe0300, 0x0200001f, 0x80000000, 0xe00f0000, 0x0000ffff}
1115 "dcl_texcoord12 o11\n",
1116 {0xfffe0300, 0x0200001f, 0x800c0005, 0xe00f000b, 0x0000ffff}
1120 "texldl r0, v0, s0\n",
1121 {0xfffe0300, 0x0300005f, 0x800f0000, 0x90e40000, 0xa0e40800, 0x0000ffff}
1126 {0xfffe0300, 0x03000001, 0x800f0000, 0xa0e42000, 0xf0e40800, 0x0000ffff}
1130 "mov o[ a0.x + 12 ], r0\n",
1131 {0xfffe0300, 0x03000001, 0xe00f200c, 0xb0000000, 0x80e40000, 0x0000ffff}
1135 "add_sat r0, r0, r1\n",
1136 {0xfffe0300, 0x03000002, 0x801f0000, 0x80e40000, 0x80e40001, 0x0000ffff}
1141 {0xfffe0300, 0x02000001, 0x800f0002, 0x8be40001, 0x0000ffff}
1145 "mov r2, r1.xygb\n",
1146 {0xfffe0300, 0x02000001, 0x800f0002, 0x80940001, 0x0000ffff}
1151 {0xfffe0300, 0x02000001, 0x80070002, 0x80e40001, 0x0000ffff}
1155 "mova_sat a0.x, r1\n",
1156 {0xfffe0300, 0x0200002e, 0xb0110000, 0x80e40001, 0x0000ffff}
1161 {0xfffe0300, 0x02000025, 0x800f0000, 0x80e40001, 0x0000ffff}
1165 "def c0, 1.0f, 1.0f, 1.0f, 0.5f\n",
1166 {0xfffe0300, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000,
1167 0x3f000000, 0x0000ffff}
1171 "add r0, v20[aL], r2\n",
1172 {0xfffe0300, 0x04000002, 0x800f0000, 0x90e42014, 0xf0e40800, 0x80e40002,
1177 "add r0, v0[aL + 1 + 3], r2\n",
1178 {0xfffe0300, 0x04000002, 0x800f0000, 0x90e42004, 0xf0e40800, 0x80e40002,
1191 {0xffff0300, 0x02000001, 0x800f0000, 0xa0e40000, 0x0000ffff}
1196 {0xffff0300, 0x0200001f, 0x80050003, 0x900f0000, 0x0000ffff}
1201 {0xffff0300, 0x02000001, 0x800f0000, 0x90e41000, 0x0000ffff}
1206 {0xffff0300, 0x02000001, 0x800f0000, 0x90e41001, 0x0000ffff}
1210 "mov r0, v[ aL + 12 ]\n",
1211 {0xffff0300, 0x03000001, 0x800f0000, 0x90e4200c, 0xf0e40800, 0x0000ffff}
1218 {0xffff0300, 0x0200001b, 0xf0e40800, 0xf0e40000, 0x03000001, 0x800f0000,
1219 0x90e42000, 0xf0e40800, 0x0000001d, 0x0000ffff}
1223 "texldl r0, v0, s0\n",
1224 {0xffff0300, 0x0300005f, 0x800f0000, 0x90e40000, 0xa0e40800, 0x0000ffff}
1228 "add_pp r0, r0, r1\n",
1229 {0xffff0300, 0x03000002, 0x802f0000, 0x80e40000, 0x80e40001, 0x0000ffff}
1234 {0xffff0300, 0x0200005b, 0x801f0000, 0x80e40001, 0x0000ffff}
1238 "texldd_pp r0, r1, r2, r3, r4\n",
1239 {0xffff0300, 0x0500005d, 0x802f0000, 0x80e40001, 0x80e40002, 0x80e40003,
1240 0x80e40004, 0x0000ffff}
1245 {0xffff0300, 0x01000041, 0x900f0000, 0x0000ffff}
1249 "add oC3, r0, r1\n",
1250 {0xffff0300, 0x03000002, 0x800f0803, 0x80e40000, 0x80e40001, 0x0000ffff}
1254 "dcl_texcoord0_centroid v0\n",
1255 {0xffff0300, 0x0200001f, 0x80000005, 0x904f0000, 0x0000ffff}
1259 "dcl_2d_centroid s0\n",
1260 {0xffff0300, 0x0200001f, 0x90000000, 0xa04f0800, 0x0000ffff}
1265 {0xffff0300, 0x0200001f, 0x90000000, 0xa02f0800, 0x0000ffff}
1273 const char *
tests[] = {
1277 "texldd_x2 r0, v1, s2, v3, v4\n",
1280 "add r0.rgb, r0, r1\n"
1281 "+add r0.a, r0, r2\n",
1284 "texld r0, t0, s0\n"
1285 "add r0.rgb, r0, r1\n"
1286 "+add r0.a, r0, v1\n",
1289 "(p0) add r0, r0, v0\n",
1292 "mov r0, v[ a0 + 12 ]\n",
1298 "mov r0, v[ aL.x + 12 ]\n",
1302 "texldd r0, t1, s2, v3, v4\n",
1305 "mov_x2_x2 r0, r1\n",
1311 "texld r5, -r2_dz\n",
1320 "mov r2, c[ aL + 3.4 ]\n",
1335 "mov r0, r1.abcd\n",
1338 "mov r0, r1.xyzwx\n",
1344 "mov r0.xxyz, r1\n",
1350 "dcl_positiont o0\n",
1353 "add_pp r0, r0, r1\n",
1356 "add_x4 r0, r0, r1\n",
1359 "add oC0, r0, r1\n",
1362 "add oC4, r0, r1\n",
1365 "add r0, r0, v17\n",
1368 "add o13, r0, r1\n",
1374 "texld r0, r1, s20\n",
1380 "add r0, r0[ a0.x ], r1\n",
1383 "add r0, v[ a0.x ], r1\n",
1386 "add r0, v[ aL ], r1\n",
1389 "add r0, v[ r0 ], r1\n",
1392 "add r0, v[ a0.x ], r1\n",
1395 "mov r0, c0[ a0 ]\n",
1398 "dcl_texcoord0_sat v0\n",
1401 "dcl_texcoord0_x2 v0\n",
1404 "dcl_texcoord0_centroid v0\n",
1410 "texm3x3vspec t3, t0\n",
1413 "defi i0, -1 - 1, 1, 10, 0\n"
1414 "defi i1, 0, 40, 30, 10\n",
1417 "add r0, v0[aL - 3 + 5], r2\n",
1420 "defi i0, 1.0, 1.1, 10.2, 0.3\n"
1421 "defi i1, 0, 40, 30, 10\n",
1424 "defi c0, -1, --1, 0, 0\n",
1438 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1444 ID3D10Blob_Release(
shader);
1452 static const char include[] =
"#define REGISTER r0\nvs.1.1\n";
1453 static const char include2[] =
"#include \"incl3.vsh\"\n";
1454 static const char include3[] =
"vs.1.1\n";
1455 static const char include4[] =
"#include <incl3.vsh>\n";
1458 trace(
"include_type = %d, filename %s\n", include_type,
filename);
1459 trace(
"parent_data (%p) -> %s\n", parent_data, parent_data ? (
char *)parent_data :
"(null)");
1465 ok(!parent_data,
"Wrong parent_data value.\n");
1470 *
bytes =
sizeof(include2);
1471 ok(!parent_data,
"Wrong parent_data value.\n");
1472 ok(include_type == D3D_INCLUDE_LOCAL,
"Wrong include type %d.\n", include_type);
1477 *
bytes =
sizeof(include3);
1482 "Wrong parent_data value.\n");
1487 *
bytes =
sizeof(include4);
1488 ok(parent_data ==
NULL,
"Wrong parent_data value.\n");
1495 ok(!parent_data,
"Wrong parent_data value.\n");
1525 static const char test1[] =
1530 static const char testshader[] =
1532 "#include \"incl.vsh\"\n"
1533 "mov REGISTER, v0\n"
1555 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1558 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1566 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1568 ID3D10Blob_Release(
shader);
1573 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1576 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1586 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1589 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1601 trace(
"D3DAssemble messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1609 static const char test1[] =
1614 static const char quotation_marks_test[] =
1621 static const char *include_test_shaders[] =
1623 "#include \"incl.vsh\"\n"
1624 "mov REGISTER, v0\n",
1626 "#include \"incl2.vsh\"\n"
1627 "mov REGISTER, v0\n",
1629 "#include <incl.vsh>\n"
1630 "mov REGISTER, v0\n",
1632 "#include <incl4.vsh>\n"
1633 "mov REGISTER, v0\n",
1635 "#include \"includes/incl.vsh\"\n"
1636 "mov REGISTER, v0\n"
1659 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1662 trace(
"D3DPreprocess messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1670 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1672 ID3D10Blob_Release(
shader);
1680 trace(
"D3DPreprocess messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1688 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1691 trace(
"D3DPreprocess messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1704 ok(
hr ==
S_OK,
"Test %u: Got unexpected hr %#lx.\n",
i,
hr);
1707 trace(
"D3DPreprocess messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1720 trace(
"D3DPreprocess messages:\n%s", (
char *)ID3D10Blob_GetBufferPointer(
messages));
1729 0x0200001f, 0x80000000, 0x900f0000,
1730 0x0200001f, 0x80000003, 0x900f0001,
1731 0x0200001f, 0x8001000a, 0x900f0002,
1732 0x0200001f, 0x80000005, 0x900f0003,
1733 0x02000001, 0xc00f0000, 0x90e40000,
1734 0x02000001, 0xd00f0001, 0x90e40002,
1735 0x02000001, 0xe0070000, 0x90e40003,
1736 0x02000001, 0xc00f0001, 0x90ff0002,
1737 0x02000001, 0xc00f0002, 0x90ff0001,
1747#if D3D_COMPILER_VERSION >= 46
1754 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1755 ID3D10Blob_Release(
blob);
1765 pD3DAssemble = (
void *)
GetProcAddress(d3dcompiler,
"D3DAssemble");
static unsigned char bytes[4]
#define D3D_COMPILER_VERSION
#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 test_disassemble_shader(void)
static void ps_2_x_test(void)
static void ps_3_0_test(void)
static void vs_2_x_test(void)
static void vs_2_0_test(void)
static const DWORD vs_2_0[]
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
HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **shader, ID3DBlob **error_messages)
HRESULT WINAPI D3DDisassemble(const void *data, SIZE_T size, UINT flags, const char *comments, ID3DBlob **disassembly)
#define GetProcAddress(x, y)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
_ACRTIMP int __cdecl strncmp(const char *, const char *, size_t)
static char * strdup(const char *buf)
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